Home   Help Search Login Register  

Author Topic: zero divisor...  (Read 565 times)

0 Members and 1 Guest are viewing this topic.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
zero divisor...
« on: 12 Jun 2005, 16:48:55 »
m'kay, i have put together a paradrop script. here it is...

Code: [Select]
_grplead = _this select 0
_chopper = _this select 1
_grp = group _grplead
_grpnum = count units _grp
_i = 0

#loop

_who = units _grp select _i
_who action ["eject",_chopper]
~1

_i = _i + 1
?_i>_grpnum:goto "all_out"

goto "loop"

#all_out

{unassignvehicle _x} foreach units _grp

exit

sometimes, (and only sometimes) the following error appears -

Quote
_who = units _grp select _i - error zero divisor

i have 4 other choppers which call this script, but as all the variables are local, that shouldn't be the problem, should it?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:zero divisor...
« Reply #1 on: 12 Jun 2005, 17:01:48 »
Correct, using this script multiple times will not cause a problem.

It looks like _grp is empty.  Could there be a case where
_this select 0 is not valid.  That  might happen if you have mistyped the name of the unit when the script is called.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:zero divisor...
« Reply #2 on: 12 Jun 2005, 17:13:21 »
hmmm... sometimes the lead loon is killed on exiting the chopper... i shall investigate further...

cheers

edit - yep, that's the problem - the new question is why the lead loon gets killed...
« Last Edit: 12 Jun 2005, 17:15:42 by bedges »