Jump to content
Sign in to follow this  
Joe Miller

NEED HELP WITH CREATEUNIT

Recommended Posts

Hello , ive got a problem with create unit command:

I want to create a unit with createunit which has in the init field a call to a script. Example of the init i need:

[this] exec "findhim.sqs"

But ive got a big problem. I've followed the instructions of command reference, but it still doesnt work.

theese are the instructions:

Create unit of given type. Format of unitInfo is: [pos,group,init,skill,rank]

The example:

'SoldierWB' createUnit [getmarkerPos 'barracks',groupAlpha]

Notes:

init,skill, and rank are optional, default values are "",0.5,'PRIVATE'

Try and do what i did, putting this init in the init field

[this] exec "findhim.sqs"

What i typed is:

"SoldierESaboteurBizon" createUnit [getmarkerPos "mafiabase",mafia,"[this] exec "findhim.sqs"",1,"Private"];

But it still doesnt work! Help me please!!

Share this post


Link to post
Share on other sites
Quote[/b] ]

_unit = "SoldierESaboteurBizon" createUnit [getmarkerPos "mafiabase",mafia,"",1,"Private"]

~1

[_unit] exec "findhim.sqs"

Share this post


Link to post
Share on other sites

createUnit gives back nothing.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierESaboteurBizon" createUnit [getmarkerPos "mafiabase",mafia,"[this] exec {findhim.sqs}",1,"Private"];

Share this post


Link to post
Share on other sites

Thank you , now it works. I have another question: how can i put the condition: Unit killed by someone? For example the trigger wich activate only if a unit is killed by the player?

Share this post


Link to post
Share on other sites

You need an eventhandler.

Take a look here for a good tutorial.

Klavan

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  

×