Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: ShadowWolf_IH on October 27, 2011, 06:25:15 pm

Title: help :banghead:
Post by: ShadowWolf_IH on October 27, 2011, 06:25:15 pm
 I am tired of using a half million sexp's for something as inane as % subsystems destroyed.  How would you guys do it?
Title: Re: help :banghead:
Post by: Axem on October 27, 2011, 06:44:13 pm
I can think of a few ways. :)

First, if we just want a real straight forward no variable way of doing it, we can do a when-argument using the number-of operator.

(http://lazymodders.fsmods.net/axemart/FreeSpace/SEXPs/method1.png)

This will activate as soon as 4 selected turrets on the Fenris have been destroyed. You could turn that into a directive if you like.

Another, slightly more complex method to show the player the number of turrets remaining would go something like...
(http://lazymodders.fsmods.net/axemart/FreeSpace/SEXPs/method2a.png)
edit: D'oh, this should also repeat with the trigger set to the number of turrets. I also forgot the invalidate-argument here! There should be an invalidate-argument <argument> at the end!
(http://lazymodders.fsmods.net/axemart/FreeSpace/SEXPs/method2b.png)

Using the directive is variable sexp allows you to put your own number in the directive. So here is would read "Destroy Half Fenris' Turrets [8]". You could also tweak how the variable is calculated to just show how many left to destroy (start the var at 4 and have change that condition to = fenrisTurrets 0).

(More information about conditional arguments can be found here (http://www.hard-light.net/wiki/index.php/Tutorial_-_Conditional_Arguments)!)

Title: Re: help :banghead:
Post by: ShadowWolf_IH on October 27, 2011, 07:03:32 pm
I knew it would be a variable.  OK mark this on your calendar...it took ten years for SW to use a variable in fred.  God Fred is anal.   Flippin Rectal Examination Device.  Thanks Axem.
Title: Re: help :banghead:
Post by: mjn.mixael on October 27, 2011, 08:19:59 pm
Wat? FRED is amazing! (Sometimes finicky.. sure..) FRED frees us from the confines of the same ol' same 'ol!