Home   Help Search Login Register  

Author Topic: from units to arrays in scripting~hidebodies easier?  (Read 581 times)

0 Members and 3 Guests are viewing this topic.

borrowed soap

  • Guest
i want two arrays to utilize snYpir's isbodyhidden script, not just two units.

arrays make scripting easier: if i have array1 = [unit1,unit2,unit3,unit4]

@unitReady _unit1
@unitReady _unit2
@unitReady _unit3
@unitReady _unit4

becomes:

@ "unitReady _x" count array1 == count array1

much much simpler of course so if i add another array and have both arrays:

array1 = [unit1,unit2,unit3,unit4]
array2 = [unitA,unitB,unitC,unitD]

MY QUESTION is then how do i apply the new syntax for my arrays to the following

line taken from snYpir's killer "isbodyhidden.sqs" snippet:

? NOT(alive _corpse) AND (_corpse Distance _searcher) < 35 AND (GetPos _corpse

select 2) > -0.5 : goto "Alarm"

i want to adapt this snYpir snippet to accommodate two arrays, otherwise the calls

and the amount of scripting (even with cut and paste) becomes unworldly. i started

by trying to break down the component parts of the statement, but i dont have any

vocabulary for what i need to do to translate and simplify. i want two arrays to

utilize snYpir's isbodyhidden script, not just two units.

? NOT(alive _unit1)                  //thru _unit4, 4 times instead of once//
? (_unit1 distance _searcher) <= 5   //for each query//
? (GetPos _a select 2) > -0.5

what, if anything, is next to do? or am i waaaay off, wouldnt b the first time

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:from units to arrays in scripting~hidebodies easier?
« Reply #1 on: 04 Jul 2003, 23:53:33 »
hi soup

i sugest u c dat script - its beter ;D

u can exec 2 scripts ;D like dat

script 1

Code: [Select]
"[_X] exec {script2.sqs}" foreach _this
exit

exec it

[arrayofdetectors] exec "script1.sqs"

script 2

Code: [Select]
_man = _this select 0

"[_man,_X] exec {isbodyhidden.sqs}" foreach arrayofbodies

;D

im not sure but it shud work - nd  u dont need 2 edit snYpirs (or my) scripts

LCD OUT
« Last Edit: 04 Jul 2003, 23:54:17 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

borrowed soap

  • Guest
Re:from units to arrays in scripting~hidebodies easier?
« Reply #2 on: 05 Jul 2003, 00:31:47 »
u r still da man   8)
im gonna dig into that tonight