Randomised 3D Decoration Rotation: Difference between revisions

From Unofficial EFPSE wiki Extended
Jump to navigation Jump to search
(Created page with "right|frameless '''<u>Credit to [https://dedreek.itch.io/ Grim Dev] for this great little FSM</u>''' In this FSM the 3D decoration road block has been set with a random variable of 1 to 8, what ever number it lands on it then jumps to that state for example if the random number generated is 3 it will use this JUMPIFEQUALS command > '''frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 3 STOP3''' making it move to '''state STOP3 NONE 0''' '''frame 3 0.0...")
 
m (Clarified that the 3D decoration required that a model be in md3 format. I got confused when I first started in another member in the discord also kind of got confused so I just wanted to emphasize that it needed to be a 3D model)
 
Line 2: Line 2:
'''<u>Credit to [https://dedreek.itch.io/ Grim Dev] for this great little FSM</u>'''
'''<u>Credit to [https://dedreek.itch.io/ Grim Dev] for this great little FSM</u>'''


In this FSM the 3D decoration road block has been set with a random variable of 1 to 8, what ever number it lands on it then jumps to that state for example if the random number generated is 3 it will use this JUMPIFEQUALS command > '''frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 3 STOP3''' making it move to  
In this FSM the 3D decoration (a model in .MD3 format) road block has been set with a random variable of 1 to 8, what ever number it lands on it then jumps to that state for example if the random number generated is 3 it will use this JUMPIFEQUALS command > '''frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 3 STOP3''' making it move to  


'''state STOP3 NONE 0'''
'''state STOP3 NONE 0'''

Latest revision as of 14:34, 29 May 2024

Credit to Grim Dev for this great little FSM

In this FSM the 3D decoration (a model in .MD3 format) road block has been set with a random variable of 1 to 8, what ever number it lands on it then jumps to that state for example if the random number generated is 3 it will use this JUMPIFEQUALS command > frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 3 STOP3 making it move to

state STOP3 NONE 0

frame 3 0.001 0 0 0 NONE

frame 3 0.001 0 0 0 NONE

setting it to the rotation of that state

This is particularly useful for things like rocks, trees bushes or in this case road blocks to add a new element to the level and a sense that it is not all the same asset even though it is.

image roadblock 0 8

state IDLE NONE 0
frame 1 0.001 0 0 0 NONE
frame 1 0.001 0 0 0 SETVAR ROTVAR RANDOM(1,8)
frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 1 STOP1
frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 2 STOP2
frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 3 STOP3
frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 4 STOP4
frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 5 STOP5
frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 6 STOP6
frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 7 STOP7
frame 1 0.001 0 0 0 JUMPIFEQUALS ROTVAR 8 STOP8

state STOP1 NONE 0
frame 1 0.001 0 0 0 NONE
frame 1 0.001 0 0 0 NONE

state STOP2 NONE 0
frame 2 0.001 0 0 0 NONE
frame 2 0.001 0 0 0 NONE

state STOP3 NONE 0
frame 3 0.001 0 0 0 NONE
frame 3 0.001 0 0 0 NONE

state STOP4 NONE 0
frame 4 0.001 0 0 0 NONE
frame 4 0.001 0 0 0 NONE

state STOP5 NONE 0
frame 5 0.001 0 0 0 NONE
frame 5 0.001 0 0 0 NONE

state STOP6 NONE 0
frame 6 0.001 0 0 0 NONE
frame 6 0.001 0 0 0 NONE

state STOP7 NONE 0
frame 7 0.001 0 0 0 NONE
frame 7 0.001 0 0 0 NONE

state STOP8 NONE 0
frame 8 0.001 0 0 0 NONE
frame 8 0.001 0 0 0 NONE