Author Topic: SEXPs: Recurring events  (Read 1665 times)

0 Members and 1 Guest are viewing this topic.

SEXPs: Recurring events

Alright...I need some guidance.  How would one design a recurring event in Fred 2?  Basically, I want my pilot to have to remain within a 500 meter sphere of a damaged communication beacon to be able to hear the transmissions coming through it.  If the pilot moves to 500-1000 meters away, the messages get scrambled.  If he moves 1000+ meters away, no messages at all.  I'm imagining that there's a looping SEXP that allows for "every time" events that could pull this off, I just need an example of how to use one.

  

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: SEXPs: Recurring events
every-time SEXP should do that, or just set it to loop like 9000 times or more.
(´・ω・`)
=============================================================

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXPs: Recurring events
Don't use every-time. Simply specify a very large number of repeats and a repeat delay of 1 (The options are in the events editor by the side of the main box where you make the SEXPs).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: SEXPs: Recurring events
So when do you use every-time? :confused:

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXPs: Recurring events
Most people use every-time when what they really ought to be using is when with a repeat delay of 0. Every-time is a specialist SEXP that you only should need once in a blue moon. Basically certain SEXPs mark themselves as SEXP_KNOWN_TRUE or SEXP_KNOWN_FALSE. When that happens the SEXP will never be evaluated again. The game has basically replaced that SEXP with the true one.

Every-time forces the game to re-evaluate the SEXP. An occasion when you actually do need every-time escapes me at the moment. But I'm sure you'd bump into them if you started using the ship-create SEXP for instance. As many SEXPs will mark themselves FALSE or TRUE the second they think that they are being used for a ship which doesn't exist in the mission file.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: SEXPs: Recurring events
One place I've found every-time to be useful is getting rand-multi and rand-multiple-of to behave like you would expect them to.  Have it constantly evaluating and storing to a variable so when you need to grab the value it won't show any type of pattern.  Even rand-multi by itself isn't all that random and tends to pull the same values when missions are replayed. 
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

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXPs: Recurring events
You're not seeding it by any chance? If you supply the optional argument it WILL give you the same set of numbers every time you play the mission. That's actually the entire point of seeding. :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: SEXPs: Recurring events
Nope.  We had this discussion before and came to the conclusion that it probably doesn't work quite right but random events were the "bane of your existence"  http://www.hard-light.net/forums/index.php/topic,53198.0.html
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

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXPs: Recurring events
I only have the vaguest recollection of that. Any idea why I said I wouldn't touch it? 
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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