Jump to content

Problem with character speed when revived, and do we have OnRevive function?

Recommended Posts

The problem I had in my mod is that when player died and got revived, the speed of the character went back to default Wilson's speed.


So, are there any onRevive function, where it triggers when the character got revived? (like, onLoad, onSave thing)


or any method that could fix this?


Thanks : )


Link to comment
Share on other sites

@Abatrozz, What I used for Webber (who has similar issues with being slowed by webs and such again upon revival was this:

local function DontTriggerCreep(inst)	inst.components.locomotor.triggerscreep = false	inst.components.locomotor:SetSlowMultiplier(1)endlocal function master_postinit(inst)	-- lots of master_postinit stuff	inst:ListenForEvent("ms_respawnedfromghost", DontTriggerCreep)	DontTriggerCreep(inst)	-- more master_postinit stuffend
Link to comment
Share on other sites



oh, thanks a lot : )

This is really helpful.


I really find it interesting using these trigger, but sometimes I can't find the list of those triggers, unless rumbling through the scripts.


I wonder if there's anyone who would made a list of those triggers. At least for the reference : )


Anyway, thanks again : D

Link to comment
Share on other sites

@Abatrozz, There's no list. There's really no substitution for just digging through the game's code-- if you want to know how the game does things, and what things you can hook into to run your mod code, you just have to read the game code. In this case, I started with player_common and saw that the ms_respawnedfromghost event was pushed after it reset the player's locomotor stuff.

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

  • Create New...