OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: rfountain on 09 Sep 2002, 10:00:27
-
Hi All,
I have looked through the forums several times looking for a posting regarding the use of the forEach command
It detailed an issue of using status commands that contain ""s, like "Safe" or "Green". It mentioned assigning a variable to these commands and using the variable in the forEach command.
If anyone could point me in the direction of the posting or let me know if this is even possible, that would be great.
Thanks
Robert
-
like this
behav = "safe";"_x setBehaviour behav" foreach units this
-
the forEach command is easy enough to use, once you have defined a group:
thegroup = group this
and then you put in "speech marks" the command, except using _x instead of a unit, like this:
"_x setdammage 1.0"
then, after that, you put forEach units thegroup, or you could have vehicles i think, or anything, it just means:
foreach: for every one of:
units: any units
in thegroup
so, you would end up with:
"_x setdammage 1.0" forEach units thegroup
hope you understand....
-
You dont have to assign a variable for the behavior, you just have to remember that when using quotes inside of quotes, the quotes inside the quotes must be double quotes.
LOL!!!
For example:
"_x setbehaviour ""safe""" foreach units group1
Notice that "safe" has double quotes around it.
This applies to alot of OFP commands, for example If you wanted quotes to appear on the screen you would have to do the double-quote thing, like this:
titletext["""Hello!""","plain"]
This would make "Hello!" appear in (with the quotes) on the screen.
-
Cool
I will try that
ThX!!!! :D