Home   Help Search Login Register  

Author Topic: GEN. Scripting Help??  (Read 2214 times)

0 Members and 1 Guest are viewing this topic.

Offline Speeder

  • Members
  • *
    • OFP.nu
Re:GEN. Scripting Help??
« Reply #15 on: 19 Aug 2005, 21:18:04 »
Quote
Take care with this.  If the elements of an array are themselves arrays then you cannot remove them in this way.  For example:

_posA = getPos a
_posB = getPos b
_posC = getPos c

_positions = [_posA,_posB,_posC]

Then the line:
_positions = _positions - [_posA]

will do nothing.

So I would have to go about it as so:



_posA = getPos a
_posB = getPos b
_posC = getPos c

_positions = [_posA,_posB,_posC]

_myvar = _positions select 0

_positions = _positions - _myvar   -->>    _positions = [_posB,_posC]   ???
« Last Edit: 19 Aug 2005, 21:27:00 by Speeder »
There are 10 kinds of people in this world. Those who get it, and those who don't.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:GEN. Scripting Help??
« Reply #16 on: 19 Aug 2005, 23:36:48 »
No.  It still would not work.  You cannot remove an element from an array if that element is an array itself in that way.

Try it and see.
« Last Edit: 19 Aug 2005, 23:37:03 by THobson »