Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: FUBAR-BDHR on January 08, 2009, 02:35:39 am
-
I'd try it myself but my weekly backup just started and running FS2 enough times would take forever right now.
Anyway I have a self-destruct event based on a variable that is set in a when-argument loop. Basically it's like this
when
-->(whatever)
-->when-argument
---->in-sequence
------><list>
---->(whatever>
---->when
------>string-equals
--------><argument>
--------><last item in list>
------>modify-variable
-------->phase2(0) +1
---->invalidate-argument
That whole sequence works with the possible exception of the string-equals. Any known problems with using it to compare <argument>?
Next event
when
--> =
---->phase2(0)
---->1
-->self-destruct
----><list of 3 ships>
They don't blow up. Now they do have a guardian threshold. Does that override self-destruct? They were blowing up before though but that was several 3.6.10 versions ago.
Oh and this is multiplayer.
-
Your invalidate argument is in the wrong place. What you have is
For X=0 to last ship
-When X = last ship
--Do stuff
--Increment X
X will never be incremented as you'll never enter the inner loop. It will just keep working on the first ship in the list. The Invalidate argument needs to be on the same level as the inner When. That way the list will invalidate the first valid ship on the list and move onto the next one each time it is called.
I've got no idea why this would work earlier. It never should have worked. Unless you made it just after I fixed inner loops. There was a bug in the way I did it back then which caused it to read the list incorrectly. That bug was fixed months ago though.
-
Yes I did make it after the inner loop fix and I believe I have the invalidate-argument in the right place in the mission I just put it in the wrong one in the message. Fixing it.
-
Hmmmm. In that case I'm a little mystified. Have you tried outputting the variable in a message to see if it is being incremented at all?
Self destruct shouldn't be affected by ship-guardian IIRC but I'll take a look and see if it is if you're sure that it's being incremented.
-
That was my next step but I couldn't try it last night due to the backup. I'll be trying that later on.
-
Huston we have a bug!!!!!!!!
<argument> apparently doesn't get along with string-equals. I did the message thing, nothing, put the message in then when-argument loop and correct values. Stored the <argument> to a variable and used that in the string-equals and it works.
Reported. http://scp.indiegames.us/mantis/view.php?id=1867
-
That's rather odd. I'll look into it.
-
Might be a more widespread problem. I just had another event not working with a when under a when-argument under a when. This one looked like this:
when
-->(whatever)
---->when-argument
------->random-multiple-of
----------><list>
------->(whatever)
------->when
--------->and
----------->has-arrived-delay
------------->0
-------------><argument>
----------->not
------------->is-destroyed-delay
--------------->0
---------------><argument>
--------->self-destruct
-----------><argument>
------->invalidate-argument
---------><argument>
----->(some variable stuff)
Didn't do anything at all. I just put the self destruct where the when was and it worked. Guess self-destruct doesn't care if the ships aren't in the mission at the time.
-
I'm likely to be very busy the next few days with Diaspora but this is now my top priority bug. :)