Jump to content

Sanity event for custom charecter: and some advice


Recommended Posts

Hi forum!. So I am building a custom character who has a custom creature spawn when his sanity is below a certain % . So my question is where do I put the scripting for the event? do I include it in the character prefab? or do I put it in the creatures script? AND if I put it in the creatures script, do I need to create my own component or behavior for the aforementioned events? 

The next challenge I have, is I would like for the event to trigger in the swamp tiled areas. Would anyone know how to exactly write a script like that? or is it feasable?

 

AND finally. If I can find the answers to those two, and I can get his swamp spawn to work. How difficult is it going to be to transfer all this stuff when I port the character over to DST? 

 

 

Link to comment
Share on other sites

custom creature spawn when his sanity is below a certain %

i would add an eventlistener on the character, that listens for the sanitydelta of your character and stores the last value in a variable and trigger the creature when the last value is above the threshold and the current sanity is below. (and the other way around to despawn it, in case u want it to despawn again above the threshold)

the event to trigger in the swamp tiled areas.

even if the sanity is above the threshold? then i would add an eventlistener on the character, that listen for locomote and checks what tile u are on. (using the GetTileAtPoint function)

and it shouldnt be hard to port this to DST(possibly, if u code it right, u will have to change nothing).

Link to comment
Share on other sites

i would add an eventlistener on the character, that listens for the sanitydelta of your character and stores the last value in a variable and trigger the creature when the last value is above the threshold and the current sanity is below. (and the other way around to despawn it, in case u want it to despawn again above the threshold)

even if the sanity is above the threshold? then i would add an eventlistener on the character, that listen for locomote and checks what tile u are on. (using the GetTileAtPoint function)

and it shouldnt be hard to port this to DST(possibly, if u code it right, u will have to change nothing).

 

 

Thank you so much for the reply! All I have right now is the artwork completed, and I am working on the animations in Spriter, I have to rework some body parts. The creature has tentacles, and making them just one arm piece provided to be too stiff looking. So I researched how to segment the arms to appear to be flexible, It might be a while before the coding portion goes, But I needed an answer so I could start planning. Also, I needed to know if it was possible if at any moment I get burned out on the tedious task of animating frames to continue a forward progression with the mod. 

It's funny how working on a mod, you always think "just one more thing" and then a month later "well I could do this! this will make it unique and cool!" which is where I am at now. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...