OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Pr0ph3t on 26 Mar 2005, 05:35:26
-
Hai everybady! 8)
I want a trigger that will setcombatmode "red" for every western unit. How do I do this?
-
Make a trigger wich covers the whole mission area, and be sure to put activation "West". Then give a name for the trigger ex. xxx. You can set the condition to empty. When you want the side to be affected, write somewhere: {_x setCombatMode "Red"} forEach list xxx
-
Nice! thanks man
-
lol whats red?
-
::)
setCombatMode (http://www.ofpec.com/editors/comref.php?letter=S#setCombatMode)
-
OHHHH IN YOUR FACE!!! hihi
-
wait I don't get it what's xxx?
-
ex. xxx = for example xxx. It's just the name you give to the trigger. The name can be anything!
(some letters aren't allowed)
-
Ok.. Just wasn't sure if it was the group name or trigger name. Thanks buds. I'm gonna test this in a couple of hours.. I'll post if it worked.
-
Okay just a couple more problems and I think this thread is solved..
First of all, for anyone else using my lowly version, the only way the above command will work in the trigger activation field is by using "" not {}
ex: "_x setcombatmode red" foreach list xxx
now the problem is, you can't put red under quotations ("red") because you'll get a syntax error. So I need to find another command that can alter a unit's behaviour without quotations.
I tried doing "_x setdammage 1" foreach list xx and everyone western died. So it works. Now the only thing is to find a command without quotations.. Anyone got a clue or a work around?
-
Try double quotes:
""Red""
In other words;
"_x setcombatmode ""red""" foreach list xxx
Planck
-
Nope double quotes don't work either :(
-
I admit it was a long shot.
In some instances it works, in others it doesn't.
This must have been a case of the latter.
Try all sorts of variants are you really really sure curly braces don't work.
Planck
-
I did.. I tried everything.. Isn't there any other commands I can use ?
-
Ok prophet,
I just tried this in a trigger......set to 500 X 500.
Activated by West.....Once
On Activation........."_x setcombatmode ""red""" foreach list min
min was the trigger name
I was within the trigger range with my West squad.
And........it worked just fine, my men were ordered 'All, Engage At Will'
Planck
-
strange.. This really doesn't make sense I'm going to try again
-
I get an unknown operator error msg.. It detects " and halts the command :( I think its my ver hee hee
-
You know you really are crippling yourself sticking with version 1.0
Why don't you download the FREE patches to take you to version 1.46?
There are a lot of extra commands and official vehicles added in the updates that you can't use.
In the long run it makes sense to update.
Planck
-
I know its free. I know there's lots of goodies.
And I will get all the bells and whistles for the sequel. But for now its 1.0 all the way. I've been working on this campaign for about a year. Now near the end suddenly I'm gonna overhaul? Forget it it's going to add another 6 months to production time. Now, if this meant I was going to distribute something of quality of something not then yes I would upgrade. But I've put a lot of quality in this campaign, and I only need the odd command that is not avaliable. 9/10 times there's a work around and when there isn't usually its not necessary or I find a better way around it.
-
Let me see now, you have been using the command allowFleeing.......correct?
EDIT: I got the command wrong, but you know what I mean....I meant allowDammage.
When you release your campaign, if you do that is, everone who does not have version 1.0 will not be able to use that command because it has been removed in later versions.
I don't know about any other older commands that you have used that might have a similar effect.
I'll try to 'think' of a way around it.
Planck
-
Oh don't worry about that.. Its only 1 or 2 missions out of 50 that use it.. And besides.. Why don't I just remove the original campaign and just leave the raw game with my campaign and distribute it that way ...
Look I know it sounds piratish, but everyone here has OFP and besides.. I don't really see pushing OFP 1.0 with the original campaign deleted as piracy compared to the distance OFP has come. Anyway, I'm sure this is going to raise all type of controversy but understand. I just like to create, and I like to pass on to other people. So don't see it as a warez statement, rather as just an error free way of distributing my campaign
-
You could try making the trigger as usual, but put:
[] exec "nameofscript.sqs"
in the On Activation field.
Then make the script with the contents:
"_x setcombatmode ""red""" foreach list XXX
exit
Don't forget to name the trigger and replace the XXX with the name you use.
Put this script in your mission folder.
Planck
-
Yah.. Sounds good I'm gonna try it in 30mins. Thanks for all the quick responses btw!
So a command that isn't recognized inside the editor may sometimes be recognized if read from a sqs file?
-
Sometimes ;D
Planck
-
You mean {} don't work with YOUR version?
Why not setting a variable: VariableName="red" (type somewhere) then after that "_x setCombatMode VariableName" forEach list xxx
(VariableName="red"; "_x setCombatMode VariableName" forEach list xxx)
-
YOU BASTARD!
That's great! I can do the same with the inflame for the unlit campfire detection. I can't believe I didn't think of that. Great thinking bud.. I'm gonna test it soon and let you guys know 8)
-
bleh. A great though my friend but it simply doesn't work.
I don't understand why setcombatmode "red" can't affect every unit on the map. and when I do it the variablename way the command passes.. But the soldiers don't react.
-
euh...is your trigger activated by a side?
-
of course d00d
-
Maybe not putting them in a same trigger? I hope you know that the setCombatMode affects wether the unit will fire or not. It doesn't make him put his gun on his back or his hand.
Maybe trying a script. (I'm sure you know how to do it but I write it anyway)
_i=0
_array = list trigger
_count = count _array
#Loop
(_array select _i) setCombatMode "red"
_i = _i + 1
?_i < _count: goto "Loop"
exit