Jump to content
Sign in to follow this  
Asgard

problem with createUnit

Recommended Posts

how can i give a name to a unit created with the createunit - command?

if i use: civ1 = "Civilian" createunit [position,group]

then civ1 is NOT the name of the unit.

And how can I create a unit, that is NOT in a existing group, or is its own group?

____________________________________

ASGARD switchmove "effectstandsalute"

Share this post


Link to post
Share on other sites

To create a unit that's not in a group, type null in place of the group name (I think that's how it works).

Share this post


Link to post
Share on other sites

Quote Command reference 1.40:

"Delete any unit or vehicle..... "

WORKS:

test = "Tractor" createvehicle pos

deletevehicle test

DOESNT WORK:

test = "Civilian" createunit [pos, group]

deletevehicle test

confused.gifconfused.gifconfused.gif

Share this post


Link to post
Share on other sites

I was under the assumption that createvehicle and deletevehicle go hand in hand, but Createunit is altogether different. There is no "deleteunit" command for instance.

So if you create a unit enter a new group name - i.e. "newguy" and he will be by himself. Then if you want to get rid of him try just kill him off or send him into the far reaches of the map into water somewhere.

Share this post


Link to post
Share on other sites

Are you sure this works? the above statement I mean. I was under the assumption that there had to be an existing group to assign the new unit to. I have tried creating a man with a different group name to no avail. If there is a way around this please post biggrin.gif

Share this post


Link to post
Share on other sites

I´m also sure that you can only create a unit in an existing group. As a workaround spawn the unit in a dummy group, then use [unitname] Join grpNull and the unit will be alone.

To name the created unit try this as the Init-line parameter of createUnit: "unitname = this"

Sadly, when used in a script, this crashes the game for me. Using it in a trigger works fine.

Once named, it should be deletable with deleteVehicle

Hope this helps,

Spinor

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×