Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: LAM3O on August 12, 2003, 07:24:32 pm

Title: A FRED question
Post by: LAM3O on August 12, 2003, 07:24:32 pm
How do i make it so a capital ship jumps out when it reaches 40% hull integrity?  I've been messing with percent-destroyed-delay in the departure cue window, and i can't seem to make it work.

Thanks for your help.
Title: A FRED question
Post by: Black Wolf on August 12, 2003, 08:22:46 pm

 - when

 -  - >
 
 -  -  - 40
 
-  -  - hitpoints-left

 -  -  -  - Ship in question

 -  - add-goal
 
 -  -  - Ship in Question

 - -  -  - ai-warp-out

Or so - that's the basic sexp anyway.
Title: A FRED question
Post by: ShadowWolf_IH on August 12, 2003, 08:28:25 pm
Edit blackwolf's post.......> should read <.  Less than 40, not greater than 40.

don't you hate typos?:D
Title: A FRED question
Post by: Black Wolf on August 12, 2003, 08:44:45 pm
Are you sure?

>

Greater than (Boolean operator)
   True if first argument is greater than the second argument.

If the ships hull hits 39, then 40 will be greater than 39, and the ship will warp out... I think. These things do screw me up at times...
Title: A FRED question
Post by: Taristin on August 12, 2003, 08:55:20 pm
No. If you do it with greater than, it will warp out at 100 hull, because 100 is more than 40.
Title: A FRED question
Post by: ShadowWolf_IH on August 12, 2003, 08:57:20 pm
Yeah, i am sure.  I use it all the time for distance between.  Basically you are telling it to jump when the hull drops below 40%.  so when hits left are < 40, warp.
Title: A FRED question
Post by: TopAce on August 13, 2003, 05:11:03 am

< this mark is the right
so

<
hits-left

40
add-goal

ai-warp-out
89

Title: A FRED question
Post by: Black Wolf on August 13, 2003, 05:44:58 am
Quote
Originally posted by TopAce

< this mark is the right
so

<
hits-left

40
add-goal

ai-warp-out
89



You do realize that that is exactly what I said don't you? You swapped the sign yes, but you also swapped the informations positions. The two swaps cancel each other out. Using that sign with that combination of entries is the exact equivalent of the sign I used and the combination of entries I used.
Title: A FRED question
Post by: karajorma on August 13, 2003, 06:40:36 am
BW has got it right.

when
->
--40
--Hits-left

is the same as

when
-<
--hits-left
--40

What may have confused people is that BW is the only person I've ever seen who does his events that way around. Most of us use the less than modifier if we are trying to have an event triggered by a ships hull going below a certain percentage.
 I certainly think it's easier to follow that way round but BW's event is nonetheless still correct.

LAM3O : The Percentage destroyed SEXP is for a completely different use. Suppose you wanted to automatically bring in another wing of fighters when most of Alpha, Beta and Gamma wings were destroyed. You would use something like

when
-Percentage-destroyed
--Alpha
--Beta
--Gamma
--80
-do-nothing

That event will trigger when 80% of the ships in those 3 wings are destroyed. Then set the reinforcements to come in when this event became true.
Title: A FRED question
Post by: TopAce on August 13, 2003, 07:32:05 am
Quote
Originally posted by Black Wolf

You do realize that that is exactly what I said don't you? You swapped the sign yes, but you also swapped the informations positions. The two swaps cancel each other out. Using that sign with that combination of entries is the exact equivalent of the sign I used and the combination of entries I used.


I know