Home   Help Search Login Register  

Author Topic: Setting dowatch height for randomly chosen thislist unit  (Read 480 times)

0 Members and 1 Guest are viewing this topic.

Azraell

  • Guest
Hey! :D


Code: [Select]
@commence


#start1h

_salvo=6

_rounds=0

;"targethere" setmarkerpos [(getpos intrig select 0)+(random 65)+(random -65)),(getpos intrig select 0) select 1)+(random 65)+(random -65)),0]


h1 setbehaviour "combat"
;h2 setbehaviour "combat"
;h3 setbehaviour "combat"


~.5

#start2h


?(_rounds > _salvo): Goto "stopnow"

~1
"h1 dowatch getpos _x" foreach intrig
;"h2 dowatch getpos _x" foreach intrig
;"h3 dowatch getpos _x" foreach intrig



watchh=true

@watchh

~.01

#fireit

~4

h1 fire ["gun125","heat125"]
~.4
;h2 fire ["gun125","heat125"]
;~.3
;h3 fire ["gun125","heat125"]


;--------------------------Monitor shell distance from origin

#trackingh
?(roundh1 distance h1)>=600:goto "detonateh"

~.001

goto "trackingh"


;-----------------------------------------------shell connects
#detonateh


~1.5

shellha= "shell120" camcreate [((getmarkerpos "targethere" select 0)+(random 25)+(random -25)),((getmarkerpos "targethere" select 1)+(random 25)+(random -25)),200]

shellha setVelocity [0,0,-500]
deletevehicle roundh1





This is a sample of a tank artillery script ive been working on...This is from the part the enemy AI uses. Its actived with a large radius trig..

?west present

onactv:intrig=thislist;commence=true ;  exec "blah blah .sqs"


It goes through 1-3 loops and then the game crashes  :'(

list1=[t1,t2,t3] is array of west tanks that might be in the trigger at same time,different locations.


How can i randomly choose 1 west unit of the many that are in the trigger area?


And when that 1 unit is picked, how can i set the height of h1's dowatch command?

i know of count and countside and counttype commands. do they randomly choose 1 unit?

Negitive results on 2 days of searching for something related:'(  

Many thanks for any help you can give me. :)

netta1234

  • Guest
Re:Setting dowatch height for randomly chosen thislist unit
« Reply #1 on: 09 Jan 2004, 11:53:52 »
have you downloaded ofp`?

Azraell

  • Guest
Re:Setting dowatch height for randomly chosen thislist unit
« Reply #2 on: 09 Jan 2004, 13:12:29 »
?