I'm a little confused by a simple piece of code I tested. Thought I'd share it with the board and see if anyone can explain it.
:state=0:state=1
:state=1,plrdistwithin=400:plraddhealth=-2
:state=1,plrdistfurther=400:plraddhealth=1
I saved it as test01.fpi. Made a floor out of ground segments and placed a crateD in the top left corner (0,0,0). Assigned the script to the main AI spot for crateD. Placed my start point about 300 units away.
Whenever I test it, my health starts to
plummet rather fast. When I move back to around 500 my health starts to
slowly increase 1 point every 2 seconds. When I go back to my start point at around 350 my health will
slowly decrease at around 2 points per second. If I get within 100 units of the crate my health will
quickly plummet.
What is determining the
rate of my health increasing and decreasing and why does the distance affect the rate?
Edit: Oh, I just figured it out, its rather interesting. I'll leave this posted to see what others think.