Author Topic: Random appaearance  (Read 1701 times)

0 Members and 1 Guest are viewing this topic.

Hi,

I can create a warp-effect to suggest an unstable jumpnode.

I need to have it appear at random times (within a recurring 5-20second window) throughout the mission.

Attached is my current SEXPs:

The game checks mission time every [random] seconds then modifes the jumpnode variable by a random number.
It then checks that same variable - if divisible by 5 then the Warp-effect appears, runs for 5 seconds then fades out.

Or it should.
Instead I either get the damn effect ALL the time, or not at all.

Ive been tweaking this, messing with modify-variable, mod, if-then-else, when-argument, every-time, etc etc.

This is driving me bananas......

HELP ME, OH HLP. YOU'RE MY ONLY HOPE.



[attachment deleted by an evil time traveler]

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Eesh, the longer I take to release my missions, the greater the chance that people are going to think of the thoughts I've already thought up. :p

You're using too many layers here.  What I would do is make a single sexp with a large repeat or trigger count.  The sexp should trigger when mission-time is larger than a variable value.  When it does, it should display the warp-effect, then set that variable to mission-time plus a random number of seconds in the future.

Initially, set your variable to an absurdly high number (more seconds than you could possibly play, like 99999).  To begin the warp flickering, set the variable to 0, and it will immediately trigger.  To suspend the warp flickering, set the variable back to the absurdly high number.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Since I believe that an explanation of what went wrong is almost as important as an explanation of how to do it correctly....


The problem is the way you've set things up. NODE TIME CHECK uses every-time which means that it is checked once a frame rather than once a second. As a result on a reasonably fast PC you're going to be checking if the mission time is divisible by one of those numbers somewhere around 60 times a second or more. Unless the mission time is a prime number, there is a very good chance that one of the numbers will be suitable.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  
Many thanks!

OK, I think I get the basic idea, but my event syntax is definately off somewhere.

Warp effect does not show.

Where am I going wrong?....

[Once locked off (if ever) FRED2_open  really needs a cheat sheet showing which SEXPS can work together.]

BH

[attachment deleted by an evil time traveler]

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
The coordinates (0, 0, -13000) are pretty far away.  Is that actually where the scene is taking place?

Read Axem's help about the warp-effect sexp here.
« Last Edit: December 07, 2013, 04:09:28 pm by Goober5000 »

 
Yep,  that's part of the mission scene - a science installation near an unstable,  appearing /disappearing node.

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Oh, I see what happened.  Alpha 1 never "arrives"; he is present at mission start.  Change the cue to has-time-elapsed instead.

 
Perfect!

THANK YOU!
This is a critical part of my mission, fundamental to its gameplay.

As a 'thank-you' I have attached the current file to my Operation Dynamic thread, http://www.hard-light.net/forums/index.php?topic=86150.
It is in initial stages, but the basic set-up is there.

Best,
BH
« Last Edit: December 07, 2013, 09:54:14 pm by Bullhorn »

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
You're welcome. :)