Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: ReeNoiP on May 09, 2011, 10:52:47 am
-
Can you do this?
A simple version of what I'm trying to do is this:
I have a variable score (default 0)
Player destroys a ship->message "Kill score +1"->message "Score is now 1"
Player destroys another ship->message "Kill score +1"->message "Score is now 2"
Player destroys 2 ships within a certain time->message "double kill score +5"->Message "score is now 5"
Say I have a number of ships in a wing: Ship1, ship2...
How would I set up a sexp which repeatedly checks each time a ship is destroyed and sends the correct message? And tjecks the two kill thing.
My guess was something like this:
Two variables: score(0) combo(0)
event1
when-argument
any-of
ship1,ship2....
is destroyed
modify variable score=score+1
modify variable combo=combo+1
training message "Kill! score+1)
Training message "Score is now {score}<-the variable
event2
when
is-event-true-delay
"some time"
event1
modify variable combo=0
event 3
when
combo>2
modify variable score=score+3
training message "Double kill score+5)
This way I would only need a few messages to make it work with any number of ships.
-
You can use a var in a message by typing $[yourvarname] in the message text (without the brackets).
-
You can use a var in a message by typing $[yourvarname] in the message text (without the brackets).
Excellent.
-
Unfortunately there is no way to reference vars in a debriefing without creating additional DB branches.
-
Eh?
-
Eh?
Debriefs are totally static, yes? No colored text, no $varname. Correct?
-
You can display variables in a debriefing.
(http://i1082.photobucket.com/albums/j367/TopAceHLP/Varindebrief.jpg)
-
That's what i thought. :nervous: Fred academy at next HLP London right? :yes:
-
Awesome.
-
Last I recall, colored text is still not available in debriefings though.