Home   Help Search Login Register  

Author Topic: Scripting Causing Crash?  (Read 1464 times)

0 Members and 1 Guest are viewing this topic.

Offline Rommel92

  • Members
  • *
Scripting Causing Crash?
« on: 01 Apr 2008, 04:51:29 »
Code: [Select]
{_x action ["dropWeapon",_x,primaryWeapon _x]} forEach units EASTGROUP;

Sometimes this script can cause a crash, and I have a feeling it may have to do with the dropWeapon command, as it only started when I put it in and ended once I removed it, but I'm not entirely sure, any ideas everyone?  :no:
« Last Edit: 01 Apr 2008, 04:53:26 by rommel92 »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Scripting Causing Crash?
« Reply #1 on: 02 Apr 2008, 13:43:32 »
Not even remotely sure whether this is advanced or not but I'll let this stay here (at least for now :P)..

In what kind of situation this crash happens?

Is the group dropping the weapons aware of some enemy?
Just asking because back in OFP I had the game CTD when a weapon was removed from an all AI vehicle while it was being aware of an enemy target (thus most likely orienting to target it)..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Scripting Causing Crash?
« Reply #2 on: 02 Apr 2008, 13:55:58 »
Using standard ArmA units?

You might try a bit more "safer" loop and see what happens:
Code: [Select]
{
   _wea = primaryWeapon _x;
   if ((_wea != "") && (alive _x)) then
   {
      _x action ["dropWeapon",_x,primaryWeapon _x];
      Sleep 0.25;
   };
} forEach units EASTGROUP;

Not advanced topic, BTW.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Scripting Causing Crash?
« Reply #3 on: 02 Apr 2008, 14:00:41 »
Quote
Not advanced topic
Agreed.  :yes:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Rommel92

  • Members
  • *
Re: Scripting Causing Crash?
« Reply #4 on: 02 Apr 2008, 14:57:33 »
Yeah tried and tested Mando, still crashes, however alone it does not, it seems to do it when its cooped up with another few scripts, I've just removed it for now, more hassle then its worth.  :whistle:

Oh and h-, check that PM, I've given up posting in advanced :P.

EDIT: Also something I noticed, it would fail to do it at times, units simple would just not drop it, and all the ammo was always stacked up in one pile, so you ended up with up to 9x12 AK mags in one spot, which coincidently was the leader?!?!?
« Last Edit: 02 Apr 2008, 15:01:20 by rommel92 »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Scripting Causing Crash?
« Reply #5 on: 02 Apr 2008, 20:38:18 »
well, second parameter of dropWeapon action is the "depot" of the dropped weapon. You might try objNull or just nothing and see what happens instead of _x.

This might mean soldier _x, drop your weapon and put it in soldier _x.
_x action ["dropWeapon",_x,primaryWeapon _x];