Hi, actually i'm at work, so i can't be that great help,
but be sure i'll be back home soon
Meanwhile i'm gonna try to help you from here;
;Here I want to have each man in the group that is left to set a satchel in a hut created by map.
;There are 7 different huts that are potential targets. I want to use objectID to define targets in no
;particular order. Do I make an array of targets ["object12345","object12346","object12347"] or the target
;locations' array [(getpos object12345 select 0),(getpos object12345 ;select1),(getpos ;object12345 select2)]?
;This is where I am lost. Any and all help appreciated here.
Well, it's up to you if you want to let them move to coordinates,
or if you want to let them move to an object. Both should work
fine.
Just one thing:
If you use
Object ID you need to take care on that
space between Object and ID. Also you're making a string
out of it by using hiqh qualifiers ("").
Your array should look like:
blow_up_array = [object 12345,object 12346,object 12347]
or:
blow_up_array = [(getpos object 12345),(getpos object 12346),(getpos object 12347)]
Also you will need to create an inner loop inside your demolition
loop, to count through your blow_up_array. Gonna show you that at the end.
_max = WEST countside units _group
This line is for counting the actual number of living men in
the group.
So if your script is running already that long, that it's possible
having lost some men, just do another count before starting
your satchel placing loop.
Or: you may use just a condition at the top of each loop's
round:
;not sure if this is needed
_demoman setbehaviour "COMBAT"
This line you only need, if you want to change the unit's behaviour to COMBAT
?(_i == _max):goto "Exit"
You don't need this line, as if _i is not smaller than _max
it can only be equal or greater - also the next line of your
script would be EXIT, therefore you don't need to use the
goto statement.
;I was going to use the scripted waypoint method and have my units go a short distance away and then
;detonate the satchels. If not using scripted waypoint, then use the next WP to move away prior to detonation. ;Completely lost now. HELP!
Up to you:
exit the script so they will start moving to their next waypoint
and in the next waypoint's onActivation field you could let
them blow the satchels
or use:
_group domove wherever
~15
bigbada-booooooooooooooooooom
exit
And here's an example of how your script could look like:
blow_up_array = [(getpos object 12345),(getpos object 12346),(getpos object 12347)]
;define array for targets to be blown up
_man_left = WEST countside units _group
;count number of men in group
_2bdestroyed = count blow_up_array
;count number of targets to be satchele'd
_i = 0
_ii = 0
;define selector for loop (men) and for loop (targets)
#demoloop
_demoman = units _group select _i
;select individual soldier of the group
?(alive _demoman): goto "do_it"
;if the soldier is alive, go on with his job
goto "skip_it"
;if soldier is alive, this line will have no effect upon the previous
;line - if soldier is dead script goes to "skip_it"
#do_it
_move_pos1 = blow_up_array select _ii
;select target from target array
_demoman commandmove _move_pos1
;move first unit to first hut
~0.5
@UnitReady _demoman
;Wait until unit is in position
_demoman fire ["put","pipebomb"]
;place satchel charge
_ii = _ii + 1
?(_ii == _2bdestroyed): _ii = 0
;increase counter for target loop - if counter has reached
;upper limit of target array, counter will be reset'd to first
;target
#skip_it
;script continues here if actual selected member of group
;is not alive
_i = _i + 1
?(_i < _man_left): goto "demoloop"
;increase counter for loop through the groupmembers
; if counter has reached the limit - script will not return
;to "demoloop"
exit
When i'm at home, i'll go for testing if i've missed or screwed
summit here.
btw - thanx for the nice feeback on my thread
~S~ CD