OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Pr0ph3t on 26 Mar 2005, 05:35:26

Title: Affect whole side
Post 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?
Title: Re:Affect whole side
Post by: Peter_Bullet on 26 Mar 2005, 05:42:02
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
Title: Re:Affect whole side
Post by: Pr0ph3t on 26 Mar 2005, 16:44:34
Nice! thanks man
Title: Re:Affect whole side
Post by: supershooter on 26 Mar 2005, 17:08:23
lol whats red?
Title: Re:Affect whole side
Post by: macguba on 26 Mar 2005, 19:36:12
 ::)

setCombatMode (http://www.ofpec.com/editors/comref.php?letter=S#setCombatMode)
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 03:50:50
OHHHH IN YOUR FACE!!! hihi
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 03:53:29
wait I don't get it what's xxx?
Title: Re:Affect whole side
Post by: Peter_Bullet on 27 Mar 2005, 06:59:35
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)
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 16:17:57
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.
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 19:05:57
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?
Title: Re:Affect whole side
Post by: Planck on 27 Mar 2005, 19:13:03
Try double quotes:

""Red""

In other words;

"_x setcombatmode ""red""" foreach list xxx


Planck
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 19:46:54
Nope double quotes don't work either :(
Title: Re:Affect whole side
Post by: Planck on 27 Mar 2005, 19:57:18
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
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 19:59:58
I did.. I tried everything.. Isn't there any other commands I can use ?
Title: Re:Affect whole side
Post by: Planck on 27 Mar 2005, 21:00:41
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
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 21:03:26
strange.. This really doesn't make sense I'm going to try again
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 21:06:13
I get an unknown operator error msg.. It detects " and halts the command :( I think its my ver hee hee
Title: Re:Affect whole side
Post by: Planck on 27 Mar 2005, 21:15:13
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
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 21:20:42
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.
Title: Re:Affect whole side
Post by: Planck on 27 Mar 2005, 21:28:35
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
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 21:32:13
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
Title: Re:Affect whole side
Post by: Planck on 27 Mar 2005, 21:46:27
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
Title: Re:Affect whole side
Post by: Pr0ph3t on 27 Mar 2005, 21:58:40
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?

Title: Re:Affect whole side
Post by: Planck on 27 Mar 2005, 22:00:58
Sometimes   ;D


Planck
Title: Re:Affect whole side
Post by: Peter_Bullet on 28 Mar 2005, 08:30:20
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)
Title: Re:Affect whole side
Post by: Pr0ph3t on 28 Mar 2005, 14:54:34
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)
Title: Re:Affect whole side
Post by: Pr0ph3t on 29 Mar 2005, 01:56:36
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.
Title: Re:Affect whole side
Post by: Blanco on 29 Mar 2005, 02:49:34
euh...is your trigger activated by a side?

Title: Re:Affect whole side
Post by: Pr0ph3t on 29 Mar 2005, 20:36:45
of course d00d
Title: Re:Affect whole side
Post by: Peter_Bullet on 31 Mar 2005, 14:55:13
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