Jump to content
Arma_Fan

Respawn Ticket System?

Recommended Posts

Hello everyone, I'm basically making a "base defense" mission where bluefor is defending, and opfor is attacking. So what I want to know how to do is how to make it so that each team has 100 respawn tickets and that everytime a player respawns, that 100 respawn tickets drops down 1 ticket. If blufor gets down to 0 opfor wins, if opfor gets down to 0, blufor wins. How can I achieve this? I've searched this forum and haven't found anything. I found multiple rough scripts online but I didn't understand what they were talking about and how they put it together. I had some idea and cut pieces out and pasted them in, but lost it and gave up.

May I have some help please?

My friend added a point system to one of my missions (koth) with the add points/score module so that whatever team gets to lets say 100 points, that team wins and ends the game. How can I do that reverse and with respawns?

Thanks for the help and at least looking at this :-/

Share this post


Link to post
Share on other sites

Come on guys, please. I really want to learn how to do this :(

Share this post


Link to post
Share on other sites

look for AAS missions from Arma 2 .. maybe they a also in arma 3 aviable ...

thats what you want :)

Share this post


Link to post
Share on other sites
look for AAS missions from Arma 2 .. maybe they a also in arma 3 aviable ...

thats what you want :)

So look at the "advance and secure" missions? :-/

EDIT: Those misions doesn't seem to have anything regarding spawn tickets :(

Edited by Arma_Fan

Share this post


Link to post
Share on other sites

Try this....

In Init.sqf define your ticket values eg

WestTickets = 100;

EastTickets = 100;

Then by assigning an 'MPEventHandler' to your players you could decrease the score whenever someone is killed. You would also need to 'PublicVariable' the ticket values for MP although this may superceded by A3 functions, anyone?

Finally have a trigger check WestTickets <= 0 and another checking EastTickets <= 0 with relevant ends.

Vague I know, but all from memory as not at home.

Good luck

You could of course make your ticket number adjustable as a MP parameter?

Edited by MrSteve
more thoughts

Share this post


Link to post
Share on other sites

Blitzkrieg has the option to play with respawn tickets.

But the system is fairly complex to learn from/for this rather simple task.

Share this post


Link to post
Share on other sites
Hello everyone, I'm basically making a "base defense" mission where bluefor is defending, and opfor is attacking. So what I want to know how to do is how to make it so that each team has 100 respawn tickets and that everytime a player respawns, that 100 respawn tickets drops down 1 ticket. If blufor gets down to 0 opfor wins, if opfor gets down to 0, blufor wins. How can I achieve this? I've searched this forum and haven't found anything. I found multiple rough scripts online but I didn't understand what they were talking about and how they put it together. I had some idea and cut pieces out and pasted them in, but lost it and gave up.

May I have some help please?

My friend added a point system to one of my missions (koth) with the add points/score module so that whatever team gets to lets say 100 points, that team wins and ends the game. How can I do that reverse and with respawns?

Thanks for the help and at least looking at this :-/

I actually work on a similar mission. Do u finally got a solution?

Share this post


Link to post
Share on other sites

Tickets respawn template is designed specifically for this

Put this to description.ext:

respawnTemplates[] = {"Tickets"};

Now every time player respawns, it will decrease the global tickets value by 1. Since you want to have one value for BLUFOR and one OPFOR, you will have to define them separately

ticketsWest = 100;
ticketsEast = 100;

Now, we need to let player know which value should he use. In the mission folder, create a file initPlayerLocal.sqf - it's called automatically when a player joins - and put the following code inside:

if (side group player == west) then {"ticketsWest"} else {"ticketsEast"};
player setVariable ["BIS_fnc_respawnTickets_var",_var];

In the upcoming days, I'm planning to allow side specific respawn tickets by default, so you won't be required to save any variables to player's object.

EDIT: Disregard what I wrote, I just updated the system to be more user friendly by default. It will be possible to define tickets specifically either for whole mission, for a side, a group or even for an object. The change should make it into the upcoming dev build update.

Edited by Moricky
Splendidizing

Share this post


Link to post
Share on other sites

accidental double post

Edited by eraser1

Share this post


Link to post
Share on other sites

I tried both the methods Moricky suggested (using the respawn template guide and the initPlayerLocal.sqf), but to no avail. In addition, whenever I launched the mission with initPlayerLocal.sqf in the mission, I got a black box error claiming:

'...tVariable ["BIS_fnc_respawnTickets_var",|#|_var];'

Error undefined variable in expression: _var

File: ...\MPMissions\MissionName.Stratis\initPlayerLocal.sqf, line 2

I am trying to make it so that when Blufor use up 100 tickets trying to attack a certain area, Opfor wins. I temporarily set it to 3 tickets for testing purposes (cause I'm not gonna spend the time killing 100 Blufor units to test it), but it doesn't work at all. See code below:

My description.ext:

respawn = "3";
respawndelay = "3";
respawnTemplatesWest[] = {"Tickets","EndMission"};

my init.sqf:

ticketsWest = "3";

and my initPlayerLocal.sqf:

if (side group player == west) then {"ticketsWest"};
player setVariable ["BIS_fnc_respawnTickets_var",_var];

P.S.: This is my first "serious" ArmA 3 mission ever, and this is the last bit of the mission that I need in order to complete my mission. Unfortunately, I have virtually no knowledge of coding :confused: and I have made it thus far thanks to the help of Google, Armaholic, and these forums. Any help will be greatly appreciated:pray:, and may be rewarded with an awesome PEANUT BUTTER JELLY TIME dance! :yay:

Edited by eraser1

Share this post


Link to post
Share on other sites
I added some more info about BIS_fnc_respawnTickets, it might help.

I still don't quite understand what I'm supposed to do. I visited that page before, and I still don't completely understand the call action (probably because my lack of scripting knowledge). Is it supposed to set how many tickets each faction gets?

Like:

["West",("100","False")] call BIS_fnc_respawnTickets;

If so, where do I even put it? Desciption.ext or init.sqf? Also, when I tried using it before, it gave me an error along the lines of " instead of ] like it was expecting a bracket instead of a quote.

Of course, I probably completely misunderstand the concept of this call function, and am using it improperly. If you could please look through my above posted code and tell me what's wrong with it, again, I would be in your debt.

Share this post


Link to post
Share on other sites

The Biki is written in secret code for only the ancient ones with wisdom can understand, the knowledge is hidden, the secret yet to be revealed. Deep within the soul you must search, forever seek the light and forever you will have the answer. The ancient one's once shown me great wisdom, and things unknown to mankind. but i still did not have the answer... http://forums.bistudio.com/showthread.php?159925-anyone-know-how-to-use-the-tickets-system

  • Haha 1

Share this post


Link to post
Share on other sites

eraser, you're getting an error because you're not following what Moricky told you.

The syntax shows that you don't need speech marks (indicative of a string), so don't include them. Try:

[west, 5, false] call BIS_fnc_respawnTickets;

Read http://community.bistudio.com/wiki/Arma_3_Respawn on implementation, if description.ext isn't what you need, try init.sqf. The only way you'll figure it out is by trying yourself.

Regards,

Harry

Share this post


Link to post
Share on other sites

Sorry, I forgot to mention that I was getting a syntax error that closed my game with or without putting them in quotation marks. Here is the exact message, with the syntax you suggested:

File C:\Users...\MPMissions\MissionName\description.ext,

line 3: Config: .: 'w' encountered instead of ']'

I then put that code you suggested in the init.sqf, but then I returned to the error with Error undefined variable in expression: _var (see above post). I then took out initPlayerLocal.sqf, but the only difference was the black box error message was gone. I read the wiki page over about 3 times yesterday, and once again just now, but I don't see what I'm doing wrong. I'm going to read through the thread falcon so humorously posted :icon_mrgreen: and see if I can find any ancient Biki wisdom for myself there. :p

EDIT:

I read over the thread, and saw that I need to make a trigger that checks for ticketnum<=0. The issue is, I don't really know how to. My haphazard attempts were shot down by syntax errors, and I ended up making a trigger as follows:

Type: Lose

Activation: Anybody

Condition: ticketnum<=0

Obviously I missed something (I think it's the check part), and/or ticketnum<=0 has to be in the activation field. Any ideas?

Thanks,

=OSF=eraser1

Edited by eraser1
updates

Share this post


Link to post
Share on other sites

where do i have to put this?

[west,5] call BIS_fnc_respawnTickets;

can it be in the description.ext, or do i have to put it into init-file?

what happens, when i choose the ticket respawn-template, but don't define how many tickets available?

Share this post


Link to post
Share on other sites
where do i have to put this?

[west,5] call BIS_fnc_respawnTickets;

can it be in the description.ext, or do i have to put it into init-file?

what happens, when i choose the ticket respawn-template, but don't define how many tickets available?

im pretty sure you want to add it [west,5] call BIS_fnc_respawnTickets; in the init.sqf or a script in which it's only ran once like server

im using this in my description file:

respawnTemplatesWest[] = {"MenuInventory","MenuPosition","Tickets"};

respawnTemplatesGuer[] = {"MenuInventory","MenuPosition","Tickets"};

and i don't have tickets num defined and nothing happens the other 2 that i do use MenuInventory" and "MenuPosition" still work as intended

later i plan on using tickets with it that's why i'm using the code above for the meantime

Share this post


Link to post
Share on other sites

Don't you need the EndMission template for the ticket template to work properly?

EndMission | Automtically fail the mission once all players are dead (for NONE, BIRD, GROUP and SIDE respawn types) or when all respawn tickets are exceeded (for INSTANT and BASE respawn types with Tickets template)

the biki also talks about: onPlayerKilled.sqf and onPlayerRespawn.sqf but i don't understand what they want me to do with it? :confused:

Share this post


Link to post
Share on other sites

yea im pretty sure you have to read the var from in which it was set in this example: [west,5] call BIS_fnc_respawnTickets; the value u need to read is 5

but i have no idea how to read the var and i'm not sure if the end mission happens on it's own or if you need to define it yourself when tickets are out. i'm thinking unfortunately for us we have to do most of it including end mission, but im not sure. always been hoping someone will share info who uses the ticket system. since the wiki is certainly inadequate

respawnTemplatesWest[] = {"EndMission"}; might have to be used with respawn bird type to work i have no idea.....

Edited by falconx1

Share this post


Link to post
Share on other sites

I am confused and can not get the Ticket system to work.

respawnTemplates[] = {"Tickets"};

I have read ArmA_3_Respawn and Description.ext but it must presume a knowledge of something I have yet to discover.

I have tried variations of things previously described, like using tickets = 5; and side specific templates... but either the player fails to respawn or appears to be able to respawn endlessly with no indication of a ticket system at all.

This is the stable 0.76.109065 build

Is this feature working as intended? And if yes, how precisely is it supposed to be setup according to the idea BIS had in mind when it was implemented?

Share this post


Link to post
Share on other sites

I'd like to bump this rather than make a new thread of my own.

How do you activate this template?

What steps are needed to get it working as intended?

Share this post


Link to post
Share on other sites

My take on a large TDM mission

This goes in my description.ext:

OnLoadMission = "2 BLUFOR PLATOONS vs 2 OPFOR PLATOONS.";

OnLoadName = "TDM96 Hedge War";

disabledAI = true;

disableChannels[] = {0,2,4,5,6};

respawn = 3;

respawnDelay = 10;

respawnDialog = 1;

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

aikills = 0;

joinUnassigned = 1;

Author = "t3quila";

class Header

{

gameType = TDM;

minPlayers = 1;

maxPlayers = 100;

};

This goes in my init.sqf:

[west, 500] call BIS_fnc_respawnTickets;

[east, 500] call BIS_fnc_respawnTickets;

enableSaving [false, false];

this goes in onPlayerRespawn.sqf:

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",_wtickets];};

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

I have not explored any other way to report respawn tickets yet :S. Hope this helps.

Share this post


Link to post
Share on other sites

A few questions as i'm still really new at scripting.

Does the above script end the mission once the tickets for say blufor side run out?

Is there a way to add more tickets when you say take over a sector?

Share this post


Link to post
Share on other sites

Howdy!

After being directed here by a very helpful fellow called kylania, I saw your script, t3quila, and tried to implement it, but have had not luck.

Description.ext:

respawn = 3;

respawnDelay = 5;

respawnDialog = 1;

respawnVehicleDelay = 240;

aikills = 0;

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

Author = "ZiiP Vredesbyrd";

init.sqf:

[west, 2] call BIS_fnc_respawnTickets;

[east, 2] call BIS_fnc_respawnTickets;

enableSaving [false, false];

onPlayerRespawn:

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",_wtickets];};

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

Here's my original thread incase it gives any extra context.

Share this post


Link to post
Share on other sites

The respawn tickets are working ok for me but I have noticed something. When I use

[blufor,3] call BIS_fnc_respawnTickets;

in init.sqf, it is ran for every MP client and the tickets multiply. So if three people begin the mission, blufor ends up with 9 tickets. If I put the command in an (isServer) block, we have unlimited tickets (as if the line was never ran).

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

×