Author Topic: Variables Question  (Read 1221 times)

0 Members and 1 Guest are viewing this topic.

Offline Solatar

  • 211
I'm making a mission in which the player has to escort 5 cruisers through a jump node. In order to pass a certain objective, he must protect at least 4 out of the 5. I created a variable, and I have 5 sexps set so that when each one departs, 1 is added to the variable. The objective becomes true when the variable > 3.

If I succeed, it works great. However, I'm having trouble failing it. Instead of the goal returning failed if more than one cruiser is destroyed, it just fails to return.

Am I missing something?

 

Offline Shade

  • 211
You are. Rather than failing, it's just incomplete as the events system isn't clairvoyant enough to know for certain that nothing else will ever add another +1 to that variable. Adding a check for "NOT percent-ships-destroyed 40" for the 5 cruisers to the condition should do the trick.

However, you could also just drop the variable completely and use "percent-ships-departed 80" as the condition :)
« Last Edit: August 07, 2008, 11:46:13 am by Shade »
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.

  

Offline Solatar

  • 211
And I thought I was being oh-so-clever with my fancy variables. I'll try it with percent-ships-depart instead. Thanks.