Jump to content
Sign in to follow this  
Tikas

A few questions

Recommended Posts

Greetings everyone!

 

I have recently released my first mission on steam, which was a fun little scripting adventure, learning all the basics etc. I have done some scripting in the past so it was not hard to understand, but a few questions remain:

 

1. Creating a function and loading it into the init, calling it through remote exec: I sync everything with eveything, but I read sometimes that if you want to run missions on dedicated servers, you have to put down if (isDedicated) exitWith {}. I also see examples of using isServer.

 

Now my question is, what is good to filter out of the servers/dedicated script, or to put it in better words, what should a server never run? For instance, I have a function that I include in the init.sqf, then call it through remoteExec from a trigger. Is this gonna have problems on a server or a dedicated server?

TIK_fnc_endMission =
{
    titleCut ["", "BLACK OUT", 2];

    sleep 3;
    
    if (vehicle P1 != P1) then {moveOut P1};
    P1 moveInCargo transportBoat1;
    if (vehicle P2 != P2) then {moveOut P2};
    P2 moveInCargo transportBoat1;
    
if (!isNil "P3") then {
    if (alive P3) then {
        if (vehicle P3 != P3) then {moveOut P3};
        P3 moveInCargo transportBoat1;
        };
    };

if (!isNil "P4") then {
    if (alive P4) then {
        if (vehicle P4 != P4) then {moveOut P4};
        P4 moveInCargo transportBoat1;
        };
    };
    
    taskNR = 15;
    publicVariable "taskNR";
    sleep 2;
    titleCut ["", "BLACK IN", 2];
//blablablabla 
    transportBoat1D sideChat "We packed enough explosives inside this boat to take down a building.";
    
    plane1 enableSimulation true;
//more blablabla with cursing
    sleep 4;
    P2 groupChat "Why is there a plain above our head?";
    sleep 10;
    null = "Bo_Mk82" createVehicle getmarkerPos "bomb_1";
    sleep 0.8;
    null = "Bo_Mk82" createVehicle getmarkerPos "bomb_2";
    sleep 0.2;
    null = "Bo_Mk82" createVehicle getmarkerPos "bomb_3";

    sleep 0.4;
    null = "Bo_Mk82" createVehicle getmarkerPos "bomb_4";
//blabla curse
    sleep 7;
    ["End1",true] call BIS_fnc_endMission;
};

2. Is a trigger synchronised? I suspect it is but I want to make sure. Say a group leader is linked to a trigger, presence for any group member, I asume this will execute the trigger on all clients when one of the group members enters the trigger?

 

3. Why does the "sound[] = {"\music\filename.ogg", db+0, 1.0};" volume value in the cfgSounds have no influence over the actual loudness (I have seen it in 1.0 form and in db+1, tried all kinds of values, feels unresponsive and weird), and why does the say3D distance value not respond to changes?

 

4. And last but not least, a question about a trigger that acts weird: Made a trigger, trigger owner to the group leader, set to WHOLE GROUP present. If I launch the scenario in the editor it works fine, the trigger fires when the whole group enters. But when I export the scenario and play it through SP > Scenarios, the trigger fires when the group leader enters, and is unresponsive to the rest of the team members. Does anyone know why?

 

Help would be much appreciated!

 

Greets,

Tikas




			
		

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  

×