Sign in to follow this  
Abatrozz

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

Recommended Posts

Abatrozz    0

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 : )

-Abatrozz

Share this post


Link to post
Share on other sites
rezecib    3187

@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

Share this post


Link to post
Share on other sites
Abatrozz    0

@rezecib

 

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

Share this post


Link to post
Share on other sites
rezecib    3187

@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.

Share this post


Link to post
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
Sign in to follow this