Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: pulsarou on September 13, 2017, 08:13:16 am
-
Hello!
I wish that carriers executes statements in loop. How do It ?
For exemples : for every times,
1) go to waypoint A
2) when arrive at waypoint A, go to waypoint B
3) when arrive at waypoint B, cloak 1, 2, etc objects
4) uncloak 1a, 2a, etc objects
5 loop to 1)
Thanks for help. :confused:
-
Use a state machine.
when
and
=
current_state
0
are-waypoints-done
your_ship
waypoint_A
add-goal
your_ship
ai-waypoints-once
waypoint_B
89
modify-variable
current_state
1
Toggle Count: 9999
When you've handled all the possible values of current_state, set the value to 0 and add a goal to go back to waypoint_A again.
-
I don't think that will work. Doesn't waypoints-done use the mission log and return SEXP_KNOWN_TRUE if it found the waypoint done? Even with every-time that means it still wouldn't work.
Checking the distance from the waypoint should work though.
-
That's a good point; waypoints-done-delay does use the mission log. A distance check is the correct thing to do.
-
Ok !
thanks for help. I' ll try that.