Jump to content

Help, Item That Changes Stats


Recommended Posts

Then you want to attach the line to the function that gets run when the teleport thing is used.

And pass a parameter to make caster equal the player entity that is using the thing.

 

I can't really know unless I know what thing is that teleport thing.

Link to comment
Share on other sites

im trying to make rasmus teleport on right click, but i was trying in it in an item, also trying to make hounds dont attack ted when his mask is on

Edited by Fredson
Link to comment
Share on other sites

Well, there are many ways to blink. The difficult part here is that rasmus is not an equippable item.

So we have to tie the action to the character when he has certain properties.

Pretty much like how Woodie gains the gnaw action on werebeaver transformation.

 

I'm going to abuse the fact that an item with the blinkstaff component exists.

 

The Ted thing is easy.

-- for Tedinst:AddTag("houndfriend")-- for Richardinst:RemoveTag("houndfriend")

Rasmus is tricky, we are going to use the blink of the staff, so your sanity line won't be needed.

-- for Rasmusinst:DoTaskInTime(0, function()	local self = inst.components.playeractionpicker	self.rightclickoverride = function(inst, target, position)		local actions = {}		if not target and position then			table.insert(actions, ACTIONS.RASMUSFLY)		end		return self:SortActionList(actions, position)	endend)-- for Richardinst:DoTaskInTime(0, function()    local self = inst.components.playeractionpicker    self.rightclickoverride = nilend)

Now, we added the RASMUSFLY action for the player when he becomes rasmus, like when Woodie becomes werebeaver.

What is RASMUSFLY?

 

In modmain:

local RASMUSFLY = AddAction("RASMUSFLY", "Poof here", function(act)	local faketele = GLOBAL.SpawnPrefab("orangestaff")	act.doer.AnimState:PlayAnimation("jump_pre")	act.doer.AnimState:PushAnimation("jump", false)	act.doer:DoTaskInTime(19 * GLOBAL.FRAMES, function()		faketele.components.blinkstaff:Blink(act.pos, act.doer)		faketele:Remove()		act.doer.AnimState:PlayAnimation("jumpout")	end)	return trueend)RASMUSFLY.instant = true

I spawn a dummy orange staff, and use its blinkstaff properties to teleport.

I also use the wormhole animations to make a cool disappearance act.

 

I saw the item you were talking about.

The remote control of the deadpool mod, right?

The sanity line goes inside

inst.components.blinkstaff.onblinkfn = function(item, position, caster)   -- Here goes the line, reducing the caster sanityend
Edited by DarkXero
Link to comment
Share on other sites

so it will spawn the staff for he to use or it just like a replacement ? and yes it was the deadpool teleport device, i got it working :)) now im working his dynamite and in the masks :D

Link to comment
Share on other sites

ok here's rasmus code

if mask == "rasmus" then        -- normal stats overriden        inst.components.health.maxhealth = 100        inst.components.health:DoDelta(0)        inst.components.hunger.max = 100        inst.components.hunger:DoDelta(0)        inst.components.sanity.max = 100        inst.components.sanity:DoDelta(0)        inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1)        inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1)        inst.components.combat.damagemultiplier = 1.0        inst.components.combat.defaultdamage = 10                  -- special mask stats that must be overriden when normalizing        inst.rasmus = true        inst:ListenForEvent("killed", onkilled)

where should i put the inst:DoTaskInTime(0, function()

 

ive already added rasmusfly to the modmain.lua

Link to comment
Share on other sites

here

error: 

 

error loading module 'components/maskswitch' from file '..\mods\Jacket\scripts\components/maskswitch.lua':

[string "cannot OLDFILEACCESSMETHOD @..\mods\Jacket\scripts\components/m..."]:102: ')' expected (to close '(' at line 90) near 'local'

maskswitch.lua

Link to comment
Share on other sites

@Fredson, I replicated the issue with the right click. I'm looking into it.

 

However, I never crash, do you friends have a xbox controller or are they playing with keyboard and mouse?

Or what are they doing? Just entering the server?

Entering the server for first time or second time?

Edited by DarkXero
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...