Author Topic: Chained repeating event alone with explosion effect  (Read 2899 times)

0 Members and 1 Guest are viewing this topic.

Chained repeating event alone with explosion effect
Ok I've got a question.
I've got an event it's chained (5 delay, repeat count 10000000, interval time 30000  [is this milliseconds?])

Code: [Select]
Event Name
    - every-time
          - true
          - explosion-effect

The explosion is going off constanstly, if i switch every-time to when the it does it only once.

How do I correctly have the explosion go off at intervals?

Also is it possible to have it do it randomly, Im guessing something like this:
Code: [Select]
Event Name
    - every-time
          - <
             -rand
                -0
                -100
             -50
          - explosion-effect
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline taylor

  • Super SCP/Linux Guru
  • 212
    • http://www.icculus.org/~taylor
Re: Chained repeating event alone with explosion effect
Repeating, chained, events don't work due to a code issue (Mantis bug #82).  I had that fixed at one point, but before I finally had a chance to commit the changes I realized that the timing of all events had changed and thigns were happening sooner than they were supposed to.  I have yet to figure out why that was happening, or how to get around it.  Needless to say, I never committed the code.

I don't really have a suggestion for you (since I'm not a FREDer), just giving a FYI on why the chained event which repeats doesn't (and won't) work as you need it to.

 
Re: Chained repeating event alone with explosion effect
Ah ok, then it wasn't me then... I'll just have to wait till it gets fixed
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Chained repeating event alone with explosion effect
Actually the big mistake is using every-time.

Every-time repeats every frame and pays no attention to whether it was triggered previously or not. You should be using a repeating when (The delay is seconds not milliseconds so make sure you change that to 30).

As for making it go off randomly if you use when and change to rand-multiple instead of rand that will work. Rand picks a random number the first time the SEXP is used. In all subsequent calls it will use the same number. Rand-multiple on the other hand will pick a random number each time it's called.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Re: Chained repeating event alone with explosion effect
Oh it's in seconds... thats where I was going wrong. Things are looking a lot better now..

Now I've got one more question. get-object-x/y/z  returns the objects x/y/z and I see you can choose a subsystem, now how would one go about having it so it randomly chooses with subsystem to select so that the explosions don't appear to be coming out of one spot... I suppose you could just use the ships x/y/z and use a random value that attempts to match the general dimensions, but I can already see problems with that (explosions going off in empty space).

That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: Chained repeating event alone with explosion effect
Oh it's in seconds... thats where I was going wrong. Things are looking a lot better now..

Now I've got one more question. get-object-x/y/z  returns the objects x/y/z and I see you can choose a subsystem, now how would one go about having it so it randomly chooses with subsystem to select so that the explosions don't appear to be coming out of one spot... I suppose you could just use the ships x/y/z and use a random value that attempts to match the general dimensions, but I can already see problems with that (explosions going off in empty space).

I've rather complicated solution for you (requries 2 variables (1 number variable; 1 string varibale) - and it might not work)... but it would serve the purpose if it does work


1) the explosion*
Code: [Select]
$Formula: ( when
   ( true )
   ( explosion-effect
      ( get-object-x
         "GTC Fenris 1"
         "@subsys[sensors]"
      )
      ( get-object-y
         "GTC Fenris 1"
         "@subsys[sensors]"
      )
      ( get-object-z
         "GTC Fenris 1"
         "@subsys[sensors]"
      )
      10
      10
      100
      10
      100
      0
      0
      7
   )
)
+Name: explosions on gtc fenris 1
+Repeat Count: 1
+Interval: 1
+Team: 0

2) let it dice the subsystem:*
Code: [Select]
$Formula: ( when
   ( true )
   ( modify-variable
      @dice1[0]
      ( rand 1 5 )
   )
)
+Name: dice for subsys
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( when
   ( = @dice1[0] 1 )
   ( modify-variable
      "@subsys[sensors]"
      sensors
   )
)
+Name: dice to 1
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( when
   ( = @dice1[0] 2 )
   ( modify-variable
      "@subsys[sensors]"
      weapons
   )
)
+Name: dice to 2
+Repeat Count: 1
+Interval: 1
+Team: 0

[...]

*this the "editor-output" of the sexps - @xxx(yy) refers to a variable

the great problem No 1. is that FRED complains that the "modify-variable" is not setting the variable to number but to string (Code restriction? Bug?)
great problem No 2. is that the outputing the subsystem via variable might not work...
« Last Edit: December 08, 2006, 07:25:31 am by 0rph3u5 »
"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Chained repeating event alone with explosion effect
The bug you mention is already in mantis. You simply need to open the mission in notepad and add a pair of quote marks around the offending term and then it starts working again.

However while once you've fixed that problem your events would work (once you added a method to make the Dice Event occur every 30 seconds) I think that your solution is much more complicated than it needed to be. The solution is to use arguments rather than variables.



Furthermore this solution has one really big advantage. If you add an

-Invalidate-Argument
--< argument >

to the event you can make each subsystem blow up only one time if you so wish. :)

Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Re: Chained repeating event alone with explosion effect
Thanks karajorma that did the trick! Now've I've got explosions going off all over the ship.  Unforunately now I realize that this was all in vain.  The ship needs to be dead before this kicks in, at which point subsystems no longer exist.  :sigh:

That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Shade

  • 211
Re: Chained repeating event alone with explosion effect
May be able to fudge it. Let the hull reduce normally to 1%, make it invulnerable and tell it to play dead, set off the explosions, then sabotage the hull down below 0 once you're satisfied with the fireworks.
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 
Re: Chained repeating event alone with explosion effect
Thats what I pretty much have setup right now.  The only problem is the explosions should keep going off for a long period of time, probably through out the entire mission.
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Chained repeating event alone with explosion effect
Sounds like a mission design problem at the moment. If you need help with the actual FREDding I'll be more than happy to point something out which would work :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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