Jump to content
Sign in to follow this  
vredesbyrd

Victory conditions help - Respawns

Recommended Posts

I do appologise if I am bypassing standard etiquette on the form, I've just had a poke around this sub-sub-section and missed anything relating to "Don't do X noob" - Please correct me.

My problem. I am new. So very new. I have experience implementing existing scripts for DayZ on a server I helped run over on the community I am part of (ZiiP) so I'm not completely green, but in terms of 'original' content, I am.

So, the mission I am building is called 'Defense of Syrta' and it is an 8v8 Opfor Vs Blufor defense mission in which Blufor must hold out against an Opfor attack.

Both sides have advantages and disadvantages with some equipment sprinkled in, but the victory condition is what I'm having issues with, and I'm more than a bit suspicious its because I don't yet understand how things work.

So, victory condition: I want the mission to end for all players (Failed for losers, Accomplished for winners) when one member of either team has died a set number of times.

I've figured out how to do the basics like adding units, etc and how to sort out the respawn:

respawn = "base";

respawnDelay = 5;

respawnVehicleDelay = 240;

And I've dug around and found a script which ends the mission for a single player when they have died so many times:

myRespawns = 0;

while {true} do {

waitUntil {!alive player};

if (myRespawns >= 9) then {endMission "END1"};

waitUntil {alive player};

myRespawns = myRespawns + 1;

};

But I can't seem to find (probably don't know the terminology to be able to find) how I need to change this so that the mission ends for all.

I tried searching for 'myspawns' with the hope I'd find a reference page containing an alternate like 'teamspawns' but have had no luck.

Any help would be very much appreciated!

Oh, and Hi! I'm Vred, I'm new.

Edited by vredesbyrd
Typos

Share this post


Link to post
Share on other sites

Ah! - Thank you!

I hadn't thought to search anything to do with Tickets for some reason, just didn't think that ARMA would handle things like that.

Thanks again, I'll post up with how I go!

---------- Post added at 20:44 ---------- Previous post was at 19:34 ----------

I think I may have figured it out thanks to a very helpful fellow named t3quila in the thread you linked.

I used his template for TDM which at first didn't appear to do anything other than lock me out after 2 deaths, but then I did a bit more reading on the thread you linked and realised that I had to use the "EndMission" Respawntemplate which will end the mission when all players on one side have died after tickets have expired - Which didn't work because I was using AI which haven't been pathed and as such, couldn't find each other.

For reference for anyone else, here's what I did:

I placed the following code in the Description.ext (which you need to create in the mission folder (for the other newbies)):

respawn = 3;

respawnDelay = 5;

respawnDialog = 1;

respawnVehicleDelay = 240;

aikills = 0;

disabledAI = true;

respawnTemplates[] = {"Tickets", "EndMission"};

Author = "ZiiP Vredesbyrd";

I placed the following code in the init.sqf (which you need to create in the mission folder (for the other newbies)) - (Set to 2 tickets for testing purposes):

[west, 2] call BIS_fnc_respawnTickets;

[east, 2] call BIS_fnc_respawnTickets;

enableSaving [false, false];

I placed the following code in a new file called onPlayerRespawn.sqf (which you need to create in the mission folder (for the other newbies)):

private["_wtickets","_etickets"];

_wtickets = [west] call BIS_fnc_respawnTickets;

_etickets = [east] call BIS_fnc_respawnTickets;

if (side player == west) then {hint format ["NATO has %1 ticket(s) left",_wtickets];};

if (side player == east) then {hint format ["CSAT has %1 ticket(s) left",_etickets];};

I'll update this post and the thread if it turns out this doesn't work in any way for whatever reason when I've had a chance to test it with the other ZiiP guys.

Share this post


Link to post
Share on other sites

Having a bit of an issue.

The mission doesn't end when tickets have expired AND all remaining players for that team have died.

Any one any ideas?

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  

×