Jump to content
Sign in to follow this  
simonwa1

Special respawn rules depending on who

Recommended Posts

Hi!

Have a question about respawn. I have a MP mission where it should be possible to respawn. So far no problem. The problem is that i have two units who are special, if both of them dies the mission ends. But if just one dies i want the person to respawn like a regular soldier, like rifleman or something and to get rid of the name i gave the unit from start?

Extra question:

How to make markers only visible for either west or east?

//Thanks

Share this post


Link to post
Share on other sites

Depends how you want to do it really

I (in my limited knowledge) would name both your "special" units as spec1 and spec2 then add an eventhandler to both the units

this addEventHandler ["killed",{_this exec "playerKilled.sqs"}]

then in playerKilled.sqs have something like

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#check1

;if unit is alive it goes to exit (because the units not dead)

? alive spec1 : exit

#check2

; again if unit is alive it goes to exit (because the units not dead)

? alive spec2 : exit

;if the script reaches here both dudes are dead

dudesaredead = true

exit

Now somewhere on the map have a 0x0 trigger setup with the condition as dudesaredead=true and the action set as End#1

now ive not got arma on the pc im using at the moment so i cant guarantee that is without errors

Im pretty sure thats how you would check though :S

/// Or a simpler way thats just come to me ///

Have an end#1 trigger group the two special guys together, name them both spec1 and spec2

not(alive spec1) and not(alive spec2) in the condition

and synchronize them to the trigger it should work

Share this post


Link to post
Share on other sites
How to make markers only visible for either west or east?

One way is to check for the side of a player and then hide/show (which way it is easier for you) the markers you want with local commands.

setMarkerTypeLocal

Most marker commands have local counterparts.

Share this post


Link to post
Share on other sites

Thx for the answers. But my problem is not to get known of who's dead. My problem is when these spec1 & spec2 dies I want them to respawn as Rifleman and not Officers. But the others, who are not special will just respawn with same gear before the died!?

Share this post


Link to post
Share on other sites

I havent tried this at all, but just an idea for you to test out. wink_o.gif

- Create an extra unplayable rifleman.

- With eventhandler/trigger detect when the officer dies

- Make the officer unplayable and the rifleman playable with setPlayable

I have a feeling it wont work, but please test it so we all know. smile_o.gif

Share this post


Link to post
Share on other sites
I havent tried this at all, but just an idea for you to test out. wink_o.gif

- Create an extra unplayable rifleman.

- With eventhandler/trigger detect when the officer dies

- Make the officer unplayable and the rifleman playable with setPlayable

I have a feeling it wont work, but please test it so we all know. smile_o.gif

One thing to consider is that there's no way to remove a playable status from units. You'd also have to force the player into that role, and that'd depend on wether or not selectPlayer works in MP. If you are able to run this code on the player in question and are successfuly able to move the player to the new unit you could probably delete the old one as it's no longer a player.

Share this post


Link to post
Share on other sites

Hi again, thx for answers. Okay, if i cant make them respawn as rifleman in a simple way i can live with that they respawn as officers. Though, i need to remove the name the officers, like spec1 & spec2 never have exited. Is it possible?

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  

×