Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: FUBAR-BDHR on October 02, 2008, 02:26:52 am

Title: Multiple explosions using when-argument take 2
Post by: FUBAR-BDHR on October 02, 2008, 02:26:52 am
The old topic http://www.hard-light.net/forums/index.php/topic,56469.0.html when off track so I started a new one.

My test mission only contained 3 explosions and worked just fine.  I added in 21 more sets of values.  For some reason I can't quite figure out the first 6 explosions occur where they are supposed to.  The rest look like they just show up at explosion 6's location.  Stripped it back down to a test mission and it does the same thing.  According to the messages the values are getting set but I don't know what to.  Either I'm missing something stupid or I've hit a new problem. 

Basically it's suppose to do 3 lines of 8 explosions each.  It alternates from left to right to center.  The left keeps moving farther left, right moves farther right, and the center gets closer to you. 

I just had an idea what might be happening.  I set the repeat delay for the explosion event to 5 but left the other events at 1.  Even though the conditions aren't met I'm thinking it's incrementing the in-sequence 5 times instead of 1.  I'd try it but this PC is doing it's weekly backup and loading FS2 would take forever. 

[attachment deleted by Tolwyn]
Title: Re: Multiple explosions using when-argument take 2
Post by: Shade on October 02, 2008, 09:06:05 am
That *is* strange. I can't find any obvious fault with your events.
Title: Re: Multiple explosions using when-argument take 2
Post by: FUBAR-BDHR on October 09, 2008, 01:51:39 am
Well I've been messing with this for hours now.  Starting to think it's some kind of bug.  Even just displaying the values of the variables using messages doesn't work.  I should be getting:

1000,0,5000,500
-1000,0,5000,500
0,500,5000,500
2000,0,5000,500
-2000,0,5000,500
0,-500,5000,500
3000,0,5000,500
etc

It's actually returning:
1000,0,5000,500
-1000,0,5000,500
0,0,5000,500
2000,0,5000,500
-2000,0,5000,500
0,0,5000,500
0,0,5000,500
and keeps returning the same 0,0,5000,0 over and over again. 

If I set the repeat to more than 27 (the number in the in-sequence list) it will keep running well after the arguments should have been exhausted.  Starting to think having multiple when-arguments running at the same time is getting confused somewhere.

I updated the link in the first message with the current version of the test mission.
Title: Re: Multiple explosions using when-argument take 2
Post by: karajorma on October 09, 2008, 02:00:02 am
It is possible that the code is getting screwed up as you say. The argument system was basically bolted on top of the evaluate_when system and occasionally it does show signs of that.

This may not be a problem with my code so much as another flaw being exposed by my changes but either way it's something I'll look into. Stick it in Mantis and assign it to me. I've been meaning to do a whole bunch of coding but Diaspora launch stuff kept getting in my way the last few days. :)
Title: Re: Multiple explosions using when-argument take 2
Post by: FUBAR-BDHR on October 09, 2008, 02:16:51 am
It's in there.  I don't know how to assign it to you though.

Tomorrow I think I'm going to try putting it all in one event and see what happens.  This was my workaround for when-argument inside of a when not working.  That and I was trying to get it to work in TBP.  Since you fixed that bug I should be able to do it now. 




Title: Re: Multiple explosions using when-argument take 2
Post by: karajorma on October 09, 2008, 02:44:33 am
Okay, grabbed it. Barring any unforeseen complications, I'll take a look at this one tonight as I really want this one working soon. :)
Title: Re: Multiple explosions using when-argument take 2
Post by: karajorma on October 09, 2008, 03:18:02 pm
Yeah. Found the cause of this one. Should be pretty easy to fix.

Fixored. The problem was actually with invalidate-argument. Invalidate-argument was actually invalidating the first argument on the list it found, regardless of whether or not it had invalidated it previously. If you notice all the elements in your repeating line have come up before on the argument list. :)

There was a special case with the random-of SEXP but that's fixed too now.
Title: Re: Multiple explosions using when-argument take 2
Post by: FUBAR-BDHR on October 13, 2008, 02:27:49 pm
I was testing the fighter beam problem but grabbed the TBP version of that test mission for it.  Really wasn't paying close attention but it looked like it was working.