Jump to content
Sign in to follow this  
adrian858

VIP mission - Officer Respawn

Recommended Posts

Hi,

I'm currently working on a mission where you need to capture and extract a VIP, among other objectives, and I'm trying to figure out how I can get the officer to respawn where he started if he dies, and only him.

Any help would be greatly appreciated.

Thanks.

Share this post


Link to post
Share on other sites

Why not just use this allowDamage false or a handleDamage eventHandler to make sure he doesn't die in the first place? :)

Share this post


Link to post
Share on other sites

The problem is, if I put him in a chopper, and it crashes, he will still die. Plus I'd like a repercussion for the officer dying, such as having to go back to pick him up should he die.

If there is a way to keep him alive through crashes, etc, that will work too, I'm hoping to leave that as a last resort though.

Share this post


Link to post
Share on other sites

You could use a repeating trigger with !(alive officer) or a killed EH and make a new one (a.i. doesnt respawn).

Create and place him.

http://community.bistudio.com/wiki/createUnit_array

Give him his old name back.

http://community.bistudio.com/wiki/setVehicleVarName

And if you had anything in his init line..

http://community.bistudio.com/wiki/setVehicleInit

The classname for the officer should be on the sticky in the top of the section.

Share this post


Link to post
Share on other sites

Would you be able to explain that a little more thoroughly, give me some examples?

Share this post


Link to post
Share on other sites

Adrian I think they are suggesting you could do what I'm doing with civilians, only you could attach the code to your Officer:

http://forums.bistudio.com/showthread.php?t=104689

You could use that method to generate a new officer at a marker on the map. You could put whatever you like in the "killed" script really, so you could set up all kinds of repercussions. In my script I am creating enemies when a civilian is killed for a different reason--I want to model people getting angry and joining the insurgency when civilians die. But you could create as many enemy, friendly, or neutral units of as many different types for any purpose in a killed script attached to your officer, including creating a new officer, reinforcing his guards, etc.

You'll have to make sure that your win/lose conditions are capable of detecting ANY officer since technically it'd be a different unit. Assuming getting ANY officer out the door is a win then you should be good with that.

Now since I'm new at this maybe take my advice with a grain of salt...

Edited by Polar Bear

Share this post


Link to post
Share on other sites
I'm currently working on a mission where you need to capture and extract a VIP

I'm working on my first mission and this is the primary objective in mine aswell. However I have no idea how to do this, so as where you get the option to capture him and then put him on a chopper that extracts him. Do I use the surrender module or can it be done with scripting?

I have no clue and have searched quite a bit. This is the only post on topic that shows up.

Any advice is appreciated, thx.

Share this post


Link to post
Share on other sites
I'm working on my first mission and this is the primary objective in mine aswell. However I have no idea how to do this, so as where you get the option to capture him and then put him on a chopper that extracts him. Do I use the surrender module or can it be done with scripting?

I have no clue and have searched quite a bit. This is the only post on topic that shows up.

Any advice is appreciated, thx.

You can rescue/capture/recruit people via trigger or addAction easily.

Share this post


Link to post
Share on other sites

Thx a lot, Kylania!

And a terrific site to learn from too, very nice, thank you!

Edited by Antigoon

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  

×