Home   Help Search Login Register  

Author Topic: help!! needed with createunit  (Read 741 times)

0 Members and 1 Guest are viewing this topic.

Deadman

  • Guest
help!! needed with createunit
« on: 24 Dec 2002, 01:28:50 »
can anyone help me create a ai unit. Like the barracks in rts2 missions

i can create a vehicle with

car1 = "Mondeo" createvehicle getpos g1

but when i replace Mondeo with  OfficerW and createvehicle with createunit i get an error.
error is......
man1 = "OfficerW" createunit getpos g1|#|;`:error type number,expected string

any ideas anyone  ???
« Last Edit: 24 Dec 2002, 15:44:13 by Deadman »

Azraell

  • Guest
Re:help!! needed with createunit
« Reply #1 on: 24 Dec 2002, 18:36:55 »
units need an array....


type createUnit unitInfo
Operand types:
    type: String
    unitInfo: Array
Compatibility:
    Version 1.34 required.
Type of returned value:
    Nothing
Description:
    Create unit of given type . Format of unitInfo is: [pos (Position),group (Group), init (String), skill (Number), rank (String)] Note: init, skill, and rank are optional, default values are "", 0.5, "PRIVATE".

Example:
    "SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha]



and a marker works best i think...in the above example, ull see that only pos and group are defined....and the groupname must already exist!