Jump to content
Sign in to follow this  
Psilocybe

Spawning units if building not destroyed

Recommended Posts

Hi guys.

In my first mission I am creating the players have to destroy the radar tower as well as the barracks near by.

I am trying to work out how I can set a variable in which a group of soldiers will spawn at the barracks and move up towards the radar unless the Barracks is first destroyed.

I was creating a trigger with:

!alive (getPos glBuilding nearestObject 121095); groupName = CreateGroup RED; groupName = [getMarkerPos "spawn1", RED, 10] call BIS_fnc_spawnGroup;

But i believe that is merely asking if the building is alive, but has nothing to do with the following line where I am trying to spawn the soldiers. The bits of code above I have just ripped from youtube tutorials, and i obviously need a little bit more tailored help from the wizards we have here..

Thanks guys!

Share this post


Link to post
Share on other sites

Condition = !alive x

On Act: razorsharpstuff = [getmarkerpos "spawn1", EAST, 10] call BIS_fnc_Spawngroup;

razorsharpstuff is the variable you do not need to create a group for it to work. If you do not have opfor units spawned use createCenter instead.

Share this post


Link to post
Share on other sites

Okay, i think I need to clarify.

The objective is to destroy the Radar and the barracks is a secondary, but it is wiser to do the barracks first because if you don't, the soldiers 'wake up' and move towards the Radar to investigate, so I need the trigger to check if the barracks is still standing once you blow the radar up, and if it is still standing, it spawns the soldiers, if it isn't, well, theyre all dead.

Thankyou for the time you took to reply to begin with Tryteyker!

Share this post


Link to post
Share on other sites

Okay, I think I may have found what I am looking for, in my Radar destroying trigger, i would add:

if (!alive (getPos glBuilding nearestObject 121095) && then

{

groupName = CreateGroup EAST; groupName = [getMarkerPos "spawn1", EAST, 10] call BIS_fnc_spawnGroup;;

...

};

Am I on the right track?

Share this post


Link to post
Share on other sites

Well if you'd want to see if the barracks is still alive BUT the radar is destroyed then you'd use the following:

if (alive BARRACKS && !alive RADAR) then {
_cnt = createCenter EAST;
groupName = [getmarkerpos "spawn1", EAST, 10] call bis_fnc_spawngroup;
};

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  

×