Author Topic: Problem with mission time  (Read 1511 times)

0 Members and 1 Guest are viewing this topic.

Problem with mission time
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]
« Last Edit: April 08, 2009, 05:02:35 pm by killface »

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Problem with mission time
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.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 
Re: Problem with mission time

BAM.  Thank you.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Problem with mission time
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
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

  
Re: Problem with mission time

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..."