Home   Help Search Login Register  

Author Topic: create  (Read 762 times)

0 Members and 1 Guest are viewing this topic.

Ryu

  • Guest
create
« on: 21 Nov 2002, 04:12:12 »
I am having no luck creating a unit :(
I made a unit gave him group ID "Alpha".
Made a flag as a position for created unit to start at.
Put this in a trigger "Soldier1" createUnit [getMarkerPos "flag",groupAlpha]
The trigger is activated with no error message, but no unit is created. :(
can anyone tell me what I am doing wrong?

Thanks

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:create
« Reply #1 on: 21 Nov 2002, 05:27:53 »
u have 2 put in da init of da unit

groupname = group this

u can use ny groupname

nd wen i wanna create unit in da group u give right

"Soldier1" createUnit [getMarkerPos "flag",groupname]

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Ryu

  • Guest
Re:create
« Reply #2 on: 21 Nov 2002, 06:54:46 »
Thanks for the reply but no luck
I made unit called Alpha1 with Groupname = group Alpha in the init field
then trigger with "Soldier1" createUnit [getMarkerPos "flag",groupnameAlpha]
No error message but no unit is created :(
BTW Is group name different from group ID?

CrashnBurn

  • Guest
Re:create
« Reply #3 on: 21 Nov 2002, 09:11:05 »
LCD just needs some coffee. You have to specify what type of soldier you want. I use gamelogics as spawn points.For example, if you want a West machinegunner soldier you'd put this in your trigger-

soldier1 = "SoldierWMG" createunit [getpos g1, Alpha, "", 1, "PRIVATE"]

g1 is the name I gave the gamelogic. Put your flag name there instead. The group name comes next, then the ini string which you cant use but the double quotes need to be there. The 1 is his skill level, followed by his rank...simple stuff.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:create
« Reply #4 on: 21 Nov 2002, 11:36:14 »
Welcome to the forums, Ryu

For createunit to work, you must spawn the unit into an existing group. So you must have a unit already in that group.

Your line here:
Quote
Groupname = group Alpha

isn't quite right... try:

group = group this

where group is the name of your group (ie. alpha)

Now, you can create a unit using the first line you had:

"SoldierWB" createunit [getpos g1, group ]

Just note the soldier type ("SoldierWB" in this case) must be an actual type. Check the official command reference for the types ;)

Oh, on a side note...

Your line Crashnburn:

Quote
soldier1 = "SoldierWMG" createunit [getpos g1, Alpha, "", 1, "PRIVATE"]

won't have the desired effect. To assign a created unit a name, you need to use a line like this:

"SoldierWMG" createunit [getpos g1, Alpha, "soldier1 = this", 1, "PRIVATE"]

Assigning the whole line equal to the command will work on created vehicles, but not units. To assign units a name you need to include it in the init part of the syntax ;)
« Last Edit: 21 Nov 2002, 11:37:57 by Sui »