Jump to content
Sign in to follow this  
clydefrog

Naming a unit when you spawn it through a trigger

Recommended Posts

I want to be able to spawn a unit through a trigger and then name them, so that I can then run a script on them to make them move into and patrol a building. I did know how to do it but I lost the page it was on and can't find anything after searching again. Anybody know how? Thanks

EDIT: OK I found out how to do that but I have a problem. I am trying to spawn the unit in a trigger and I've tried it multiple ways (blufor present, a unit being dead etc.) but the unit is not created. Here is the code I am using in the triggers onAct:

"USMC_Soldier" createUnit [getMarkerPos "spawnmarker", groupAlpha,"housepatrolguy = this", 0.6, "corporal"]

What's wrong with this? The faction is present on the map and the group exists, so those aren't the issues, I can't figure it out at all.

Edited by clydefrog

Share this post


Link to post
Share on other sites

I placed a marker, a trigger and a unit with this in his init.. groupalpha = group this; and used that line in the trigger and everything worked fine. Check everything again... it's something simple.

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  

×