Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: killface on April 08, 2009, 04:50:33 pm
-
Alright, I'm trying to implement a bullet-time feature as I've seen in other mods. I want to make it so that when the player presses the down arrow, they enter bullet time (time compression reset, and time compression variable set to = 1), they then exit bullet time by one of three ways:
1. They kill an enemy,
2. They press a designated key (up arrow, time compression variable back to = 0), or
3. 15 seconds elapse since entering bullet time
1. and 2. I can make happen, but 3. is killing me. There's something wrong with the way I'm using the mission-time SEXP but I can't for the life of me figure it out. I posted the relevant events here. Somebody please clue me in!
killface
[attachment deleted by evil Tolwyn]
-
Well since every-time you are adding 15 to mission time it will never reach mission time to turn off. You need to do something to stop that from updating after the first time like set the variable to 2 until it is supposed to be 0 again.
-
BAM. Thank you.
-
First things first.
Or
-A
-Or
--B
--C
is functionally the same as
Or
-A
-B
-C
so you should be using the latter as that is much easier to read.
Similarly if you are using string-equals and a string variable for Time-Compression (and despite what everyone else will tell you, you should) don't then use 0 and 1. Use TRUE and FALSE instead as those are much more readable. If you're going to simulate a boolean, do it properly. :)
As for your actual problem you're not switching the Time-Compression variable back from 1. Which means that every single frame that time-compression event 1 will trigger again and reset the Time-Mark for 15 seconds in the future. So it can never come true in event 2.
EDIT : Took a little too long and FUBAR beat me to it. :D
-
Well, that's alright, you did put me in place over the use of "double or". That's one of those lazy things I do when the "or" choices expand from 2 to 3. "I'll clean that up later..."