Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
PiNs_Da_Smoka

CreateUnit Bug/Missing function

Recommended Posts

Ok. I know people have had problems with CreateUnit before. But, i've seen it die down, i think they all pretty much got the point. But there is still one thing wrong with the command. They don't respond to given names. Let me elaborate if you don't know what i'm talking about. This is the syntax i am using:

guy1="SoldierWB" CreateUnit [getpos player, groupalpha]

I mean, the guy creates in my group at my position just fine and dandy. But, they don't respond to there given name. Say i have a script with a whole bunch of dynamic directions, they won't work because the game doesn't realize thier names. This is very frustrating, this command is very important to the MOD i am working on (Enduring Fantasy/RPG - plug plug) I BEG BIS/Codemasters, whichever, to tweak this command a little. I know many other people that are frustrated with this command. As a fellow OFPEC member said, "Don't release half-assed commands and expect us to put them to good use." mad.gif This would be a great improvement to the command if you actually did something about it. Thank you very much. :thumbsup:

                           PiNs_Da_Smoka

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">guy1="SoldierWB" CreateUnit [getpos player, groupalpha]<span id='postcolor'>

If you will check our command reference, you will see createUnit is not returning any value, while createVehicle does return newly created object. This is because createUnit is internally very different and unit "name" is not known by the time it is called, but later.

Possible way how to give unit a name is to use init line "unitName=this" in init field of createUnit argument array like this:

"SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha, "soldier2=this"]

Unfortunatelly this currently does not work due to bug in createUnit implementation, but this bug will certainly be fixed in next patch available, and you will be able to use it.

Share this post


Link to post
Share on other sites

Inq = "SoldierWlaw" createUnit [(getpos a select 0),(getpos a select 1)] setIndentity "InqWiper"

Shouldn´t that give the unit the name "InqWiper" ?

Then I tried "InqWiper setdammage 1" in a trigger and nothing happend.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (InqWiper @ Feb. 11 2002,13:42)</td></tr><tr><td id="QUOTE">Inq = "SoldierWlaw" createUnit [(getpos a select 0),(getpos a select 1)] setIndentity "InqWiper"

Shouldn´t that give the unit the name "InqWiper" ?

Then I tried "InqWiper setdammage 1" in a trigger and nothing happend.<span id='postcolor'>

No, it should not. The statement you write here contains several errors.

Most important is createUnit does not return anything (or more precisely, it returns nothing - i.e. object of type nothing). If you will pass this nothing as left argument to setIndentity, it will be triggered as error and expression evaluation will abort

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  

×