Jump to content
Sign in to follow this  
Frenki

Help with making triggers executing globaly?

Recommended Posts

Hello guys, i am curently making some PvP scenario wich we tested tonight but its not working properly becouse of triggers. Idea of scenario is to have "Object" wich needs to be secured spawning on different location, player of certain faction needs to be in "precondition" trigger around it and activate addAction "Secure Object", after it i will activate second trigger, called "condition" wich should initialize hint wich says "Object is secure, keep it for 30 minutes!" but it only appears for the guy who activated the action. "Condition" trigger is condition for next trigger called "present_x" (i have one for blufor and another for opfor) wich will activate with coundown of 30 minutes and in its init it will call for "end6" call BIS_fnc_endMission; wich in the end again is only executing for the guy whom activated first trigger, and it makes him go to lobby while we dont get any end.

 

Does anyone has idea where i am going wrong and why my triggers not run globaly on my dedicatet server?

Share this post


Link to post
Share on other sites
3 hours ago, Frenki said:

Hello guys, i am curently making some PvP scenario wich we tested tonight but its not working properly becouse of triggers. Idea of scenario is to have "Object" wich needs to be secured spawning on different location, player of certain faction needs to be in "precondition" trigger around it and activate addAction "Secure Object", after it i will activate second trigger, called "condition" wich should initialize hint wich says "Object is secure, keep it for 30 minutes!" but it only appears for the guy who activated the action. "Condition" trigger is condition for next trigger called "present_x" (i have one for blufor and another for opfor) wich will activate with coundown of 30 minutes and in its init it will call for "end6" call BIS_fnc_endMission; wich in the end again is only executing for the guy whom activated first trigger, and it makes him go to lobby while we dont get any end.

 

Does anyone has idea where i am going wrong and why my triggers not run globaly on my dedicatet server?

"end6" remoteExec ["BIS_fnc_endMission", 0, true];

should work. i thought triggers executed globally? or maybe try running it just on the server and see. someone else will have a better reply.

  • Thanks 1
  • Haha 1

Share this post


Link to post
Share on other sites

Triggers are global unless you specify otherwise (scripted trigger). Editor placed are global only (I think, don't use Editor stuff).

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

See makeGlobal param.

There is also no need to remoteExec that function. See:

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

  • Thanks 1

Share this post


Link to post
Share on other sites
9 hours ago, Frenki said:

This one will for sure help! Its a solution how to properly end the mission, but i still dont have solution for hints, i want them globaly for everyone, any clue on that?

whats your trigger condition look like? and is the trigger being placed down by the editor or by script?

  • Thanks 1

Share this post


Link to post
Share on other sites
13 hours ago, Schatten said:

Thanks i will try this one!

 

13 hours ago, gokitty1199 said:

whats your trigger condition look like? and is the trigger being placed down by the editor or by script?

 

Its placed in editor, conditions are that blufor or opfor are present in area and that previous triggers are activated.

Share this post


Link to post
Share on other sites
"Hello?" remoteExec ["hint", [0, -2] select isDedicated, false];
format ["Units in trigger: %1" count thislist] remoteExec ["hintSilent", [0, -2] select isDedicated, false];

Examples ^^

  • Thanks 1

Share this post


Link to post
Share on other sites
11 hours ago, HazJ said:

"Hello?" remoteExec ["hint", [0, -2] select isDedicated, false];

format ["Units in trigger: %1" count thislist] remoteExec ["hintSilent", [0, -2] select isDedicated, false];

Examples ^^

one more example

"Haz can't hit the broad side of a barn from inside the barn in wasteland" remoteExec ["hint", -2, true];

 

  • Haha 2

Share this post


Link to post
Share on other sites
57 minutes ago, gokitty1199 said:

one more example


"Haz can't hit the broad side of a barn from inside the barn in wasteland" remoteExec ["hint", -2, true];

 

I just destroy the whole barn. Boom! Job done. :rofl:

  • Haha 2

Share this post


Link to post
Share on other sites
Just now, HazJ said:

I just destroy the whole barn. Boom! Job done. :rofl:

lol that is true, nobody will be able to match your sweet atv driving skills though

Share this post


Link to post
Share on other sites

@gokitty1199 @HazJ @Schatten

 

Thank you all guys, in the end i needed to use remoteExec for both hints and missionEnd for everything to wokr properly, and everything works just fine!

 

One more question, what those two mean and what do i get from them?

 

On 8.7.2018. at 10:13 AM, HazJ said:

[0, -2] select isDedicated, false];

 

 

20 hours ago, gokitty1199 said:

-2, true];

 

Share this post


Link to post
Share on other sites
2 hours ago, Frenki said:

@gokitty1199 @HazJ @Schatten

 

Thank you all guys, in the end i needed to use remoteExec for both hints and missionEnd for everything to wokr properly, and everything works just fine!

 

One more question, what those two mean and what do i get from them?

 

 

 

 

the true/false is if you want it to run on jip(join in progress) players, and the 0/-2 is what all you want it to run on, the wiki says this

Spoiler

 

targets (Optional): [default: 0 = everyone]

Number - Only 0 and 2 are special. When 0, the function or command will be executed globally, i.e. on the server and every connected client, including the one where remoteExec was originated. When 2, it will be executed only on the server. When 3, 4, 5...etc it will be executed on the client where clientOwner ID matches the given number. When number is negative, the effect is inverted. -2 means execute on every client but not the server. -12, for example, means execute on the server and every client, but not on the client where clientOwner ID is equal to 12.

Object - the function will be executed only where unit is local

String - the function will be executed only where object or group defined by the variable with passed name is local

Side - the function will be executed only on clients where the player is on the specified side

Group - the function will be executed only on clients where the player is in the specified group. In order to execute the function where group is local pass owner of the group as param: 
_myGroup remoteExec ["deleteGroup", groupOwner _myGroup];

Array - array of any of types listed above

 

so if its 0 it will run on every client in the server as well as on the server, -2 would run on every client but not the server, 2 would run only on the server, and any higher number such as 3 and above will run on whoever has the client id of the number you put in, and if you were to put -3 and your client id was 3, then it will run on everybodys client and the server, but not the persons client who has the client id of 3. make sense?

Share this post


Link to post
Share on other sites

@gokitty1199

 

Yeah, pretty simple, and if i put for example -2 and i execute endMission command it will end it for players but aint for server?

Share this post


Link to post
Share on other sites
35 minutes ago, Frenki said:

@gokitty1199

 

Yeah, pretty simple, and if i put for example -2 and i execute endMission command it will end it for players but aint for server?

for the end mission use BIS_fnc_endMissionServer like haz said and dont remoteExec it.

Share this post


Link to post
Share on other sites
41 minutes ago, gokitty1199 said:

for the end mission use BIS_fnc_endMissionServer like haz said and dont remoteExec it.

 

I did, but it didnt worked again, this time for anyone, but when i did remoteExec it worked without problems.

Share this post


Link to post
Share on other sites
11 minutes ago, Frenki said:

 

I did, but it didnt worked again, this time for anyone, but when i did remoteExec it worked without problems.

something seems off with your trigger, like its not working like its suppose to period. try just selecting server only in the trigger to run it on the server

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  

×