Jump to content
Sign in to follow this  
stonie01333

New to scripting

Recommended Posts

Hi

Im new to scripting and need some info or help setting up a score/ticket system for a TvTvT Sector control mission ive been working on..Ive looked around but to be honest am a little confused at this point. :( Any help would be much appreciated

Share this post


Link to post
Share on other sites

Im not 100% sure on this, but as i have heard the scoreboard depends which diff. you set on the server. However not sure if this is actually true.

I think i saw a ticket module in arma3 after zeus update, so i guess you just need to throw down that module and set how many tickets you want for each side (you do that in the module)

Can't help you more at the moment but good luck mate.

Share this post


Link to post
Share on other sites

You would be right, there is a ticket module now..now i need to figure out how to add a ticket count number

Share this post


Link to post
Share on other sites

Not having any joy with adding a ticket count..i can see the teams emblems on screen but they are set to 0..anybody else used the new ticket module?

---------- Post added at 19:18 ---------- Previous post was at 17:28 ----------

seems to be adding points when taking over area

Share this post


Link to post
Share on other sites

for the default BIS ticket system:

https://community.bistudio.com/wiki/Arma_3_Respawn#Respawn_Templates

add this to your description.ext (applies to all sides)

respawnTemplates[] = {"Tickets"};

If side specific templates are defined it will use those instead

respawnTemplatesGuer[] = {"Tickets"};

In your init.sqf add:

[west,5] call BIS_fnc_respawnTickets;

This will add 5 tickets to the West side... so you can define your starting tickets here

[west,50] call BIS_fnc_respawnTickets;
[east,50] call BIS_fnc_respawnTickets;
[resistance,50] call BIS_fnc_respawnTickets;

I believe you can also add more tickets mid-mission by using the same line but have not tested that

Edited by SavageCDN
fixed stupid SIDES!!!

Share this post


Link to post
Share on other sites

Thanks thats done the trick..i just needed to change [guerilla,50] call BIS_fnc_respawnTickets; to [resistance,50] call BIS_fnc_respawnTickets; Many thanks again guys :)

Share this post


Link to post
Share on other sites

Now i seem to have a problem when the mission is run on a server..the ticket total doesnt match the init lines...grrrr :(

Share this post


Link to post
Share on other sites

what are the totals if you use 50 tickets for each side? perhaps the game auto-adds some tickets by default?

Share this post


Link to post
Share on other sites

Got it set to 500 tickets..ingame 500 preview 500 on server 1000..lol..not a game breaker..will see later on, if its just doubling what i put in init

Edited by stonie01333

Share this post


Link to post
Share on other sites

i maybe wrong but your init.sqf is run by client and server so when ever someone joins the init is run so wat u need to do is make sure the line with all you ticket stuff is only run by the server and not all jip clients

so in your init put this at the top

waitUntil { isServer || local player }; 

at the bottom put this

if (local player) then { 

call compile preprocessFileLineNumbers "initclient.sqf";	
}; 
if (isServer) then { 

call compile preprocessFileLineNumbers "initserver.sqf"; 
}; 

then make the to sqfs

"initserver.sqf"

"initclient.sqf"

and put the code u need for your ticket counter in the server.sqf see if that works

Share this post


Link to post
Share on other sites

^ didn't even think of that silly me I assumed the BIS function to add respawn tickets would only work on the server :p

You could also wrap those ticket lines in an

if (isServer) then {code};

in your init.sqf

Share this post


Link to post
Share on other sites

Sorry guys i need more info, as im trying to follow what your saying but it doesn't seem to be working..It probably my fault :(

Share this post


Link to post
Share on other sites

Try this in your init.sqf:

if (isServer) then {
 [west,50] call BIS_fnc_respawnTickets;
 [east,50] call BIS_fnc_respawnTickets;
 [resistance,50] call BIS_fnc_respawnTickets;
};

As Androkiller mentioned both the clients and server run the init.sqf file so this should force only the server to run that section of code that adds the tickets (instead of all the clients).

Share this post


Link to post
Share on other sites

OK heres one for you..how do i set win/loose scenario? that matches the ticket count

Share this post


Link to post
Share on other sites

Never done that before but check these:

https://community.bistudio.com/wiki/BIS_fnc_respawnTickets

http://www.armaholic.com/forums.php?m=posts&q=24433

The 1st link shows a function that returns the number of tickets left so you'd have to have something that checks and when count = 0 ends the mission.

2nd link seems to go into more detail and sounds like what you are looking for.

Share this post


Link to post
Share on other sites

This seems to be the best thread to do my first post, otherwise I guess I won't be able to create a thread;)

Share this post


Link to post
Share on other sites

If anybody can have a look at my pbo that would be great. to try and get the win loose scenario set up as my limited knowledge on the scripting is holding the finishing of this mission back..Pm and i will arrange..cheers

Share this post


Link to post
Share on other sites

It might be best to find a similar mission that uses tickets, etc on Armaholic and de-pbo the files to check them out.

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  

×