OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Dajan on 02 Mar 2010, 19:40:00

Title: mass weapon-removal problems [SOLVED]
Post by: Dajan on 02 Mar 2010, 19:40:00
OK, this is basic, I should know it, I'm an idiot.
However no-one else seems to have had this problem, so I think I've missed/forgotten something..

I'm using a trigger to remove Nod from all units on a map for ambience reasons. From the mission.sqm it looks like this:-

Code: [Select]
class Item4
{
position[]={11029.347,63.896816,11741.276};
a=5000;
b=5000;
activationBy="GUER";
timeoutMin=1.0;
timeoutMid=1.0;
timeoutMax=1.0;
interruptable=1;
type="SWITCH";
age="UNKNOWN";
name="blinding";
expActiv="{_x removeWeapon ""NVGoggles""} foreach units group grp1; {_x removeWeapon ""NVGoggles""} foreach units group gw1; {_x removeWeapon ""NVGoggles""} foreach units group ge1";
class Effects
{
};
};

I am on resistance side, fighting both BLUFOR and OPFOR at dusk. This trigger worked fine in Arma I, but no matter how I adjust it in Arma II I can't get it to run.
Units involved are vanilla USMC and Russian troops against the popular desert mercenary pack by schnapsdrosel in case that helps
TIA
Title: Re: mass weapon-removal problems
Post by: fleepee on 03 Mar 2010, 10:59:33
don't you miss a " at the end of the expactive line?
Title: Re: mass weapon-removal problems
Post by: Dajan on 03 Mar 2010, 14:33:00
Hmm.. I'll have a look, but I copied that stright from the .sqm.

[edit]
It's there in the file - looks like I deleted it when pasting somehow. Any other thoughts?
Title: Re: mass weapon-removal problems
Post by: Wolfrug on 04 Mar 2010, 11:39:31
Well, it looks a little tautological: "foreach units group grp1" -> usually you've already defined a group when it's called "grp1". In that case you'd just go "units grp1". If "grp1" is a unit's name however, then that's something different.

Just make sure all the units/groups referred to are actual units/groups in the game, and you should be golden! Otherwise, check out your Arma.rpt for the exact error message.

Wolfrug out.
Title: Re: mass weapon-removal problems
Post by: Dajan on 04 Mar 2010, 13:47:39
Thanks Wolfrug, I'll get the fine comb out and pitch in

[edit]
Yup you were right - back in ArmaI it didn't mind superfluos code so much, AII, however, seems to prefer you to be as consice as possible. I removed the group part of the line and made sure all the defines were right (that bit didnt require any changes) - the result was a working removal.
Thanks guys

ps: wolfrug - where do I go to find the .rpt?
Title: Re: mass weapon-removal problems [SOLVED]
Post by: Wolfrug on 04 Mar 2010, 19:56:06
I find the rpt in my Documents and Settings -> Your User Name -> Local Settings (it's a hidden folder) -> Application Data (also a hidden folder) -> ArmA 2. Note that there's an Application Data already directly under User name, but that one isn't the right one. It's called arma.rpt and can be opened with e.g. notepad. You can safely delete it to make sure all the errors in it are "current", since it will be automatically created whenever an error occurs. Note that this is on Win XP, I really don't know how to find it in Vista etc (this (http://community.bistudio.com/wiki/arma.rpt) should help).

You can also turn on the error reporting we're used to from OFP/ArmA with a startup shortcut (like the -mod= shortcuts etc):

-showScriptErrors

Hope that helps, and glad you could solve it!

Wolfrug out.