Home   Help Search Login Register  

Author Topic: Create unit loop  (Read 515 times)

0 Members and 2 Guests are viewing this topic.

Judge856

  • Guest
Create unit loop
« on: 18 Apr 2003, 05:56:44 »
Anyone have any idea how I can create units, the scripts I've saw on the boards make no sense to me  ::).

I'm looking for something like

If 2 units is squad A are killed
Create squad X move to waypoint X

and loop this for 3 times

Also, how on earth do I get normal units to start inside a chopper, let the chopper follo waypoints until waypoint X, get the units to parachute out while chopper still moving at safe altitude. Then have the units to follow waypoints? The whole Unloadtransport and Load in the waypoints seem to do nothing  :-[

Many thanks, all help is appreciated!!

MadFred

  • Guest
Re:Create unit loop
« Reply #1 on: 18 Apr 2003, 07:23:06 »
dont know about the create units loop stuff but I CAN help you with the helo question

First make a helicopter, lets call it "helo" and put this in the init field:

helo flyinheight 100

where 100= 100 meters (safe altitude for parachuting but anything from 60 up should be ok)

then make an infantrysquad, NOT linked to the helo. lets call them group1

Put this in the group leaders init field:

group1=group this; "_x moveincargo helo" foreach units group1

the first part designates them as a group and the second part (after the ; which indicates new command following) puts them inside at the start.

Now give the helo an unload transport waypoint (could also be move when parachuting) and some more waypoints where it should go after drop off

then give the group a waypoint to where they should go when on the ground.

now put this in the "on activation" box of the helo's unload transport waypoint:

ejt="eject"; "unassignvehicle _x" foreach units group1; "_x action [ejt,helo]" foreach units group1

that should do it

or you could just look at and use the example I have put in

MadFred

p.s. when the guys all jump out of the helo at the same time it looks kinda weird and they get a bit entangled with their chutes. I'll try a little script to delay the jumps a bit. I cant say I am very good at these things but I'll give it a go and post it when I get it right.

« Last Edit: 18 Apr 2003, 07:30:59 by MadFred »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Create unit loop
« Reply #2 on: 18 Apr 2003, 09:58:02 »
grrr I've just posted a long reply and the server dropped it ..... well, here goes the summary

'chute scripts in Ed Depot

condition line in trigger:   count units grp1 <= 6

createUnit

check Official and Unofficial Command refs

snYpir's Friendly Introduction to Code Snippets
Johan Gustafsson's Scripting Guide

_counter=0
#loop1
blah blah
_counter=_counter+1
? _counter==3:exit
~0.5
goto"loop1"

loon1 doMove getPos loon2
grp1 Move getMarkerPos "marker1"


Question:   when you create a new unit can you create a new group as well?   If so, can that group have waypoints?
Plenty of reviewed ArmA missions for you to play

deaddog

  • Guest
Re:Create unit loop
« Reply #3 on: 18 Apr 2003, 20:17:45 »
I've tried to specify a new group when using the createunit command.  It doesn't seem to work for me.  I have to place a one man group from the editor.

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Create unit loop
« Reply #4 on: 18 Apr 2003, 21:36:12 »
Answer to macguba : I think deaddog is right, when you use ""string" CreateUnit [getpos blabla, groupblabla]" , there has to be a unit on the map belonging to that groupblabla group already.
Or else the unit doesn't appear (well that's what I've experienced). The cool thing is that you can give that unit waypoints which you can lock until the group pops up.