PDA

View Full Version : locality issues with triggers and variables?



helling3r
Oct 13 2011, 06:01
Hello,
in my mission CO18Frontline/Chernarus (http://forums.bistudio.com/showthread.php?t=125889) i have some errors that do not appear in singleplayer, so i guess they are caused by some locality issues i do not get.

In the mission i try to separate things by triggers, to be able to debug them separately.

When the mission starts, some units are behind a sandbag line and their init tells them to sty kneeled. The leader is set to "enableAttack=false" so he does not issue engage-commands so the team members stay in place.
I want them to be freed once a certain condition is met, so the player as squad leader can use high command to move the teams around.

This is implemented by a trigger. The condition field has "variable1==true".
variable1 is set by another trigger once a town area is secured by BLUFOR which also sets a task to succeeded.

However, in multiplayer the trigger for freeing the teams does not fire, however the trigger for the town fires (task is set to completed).

What is the problem here? I thought that both is true:
- Editor placed units are local to the server unless a human player is in the team
- Triggers are present at all machines and fire independently there
-> leads me to the conclusion that variable1 should be local to each machine without the need to broadcast.

How can this be fixed?

.kju [PvPscene]
Oct 13 2011, 06:31
Aside for your specific questions/issues, this page will help you understand MP coding:
http://community.bistudio.com/wiki?title=6thSense.eu:EG

helling3r
Oct 13 2011, 12:14
Thanks for the tip, i already know that site. Unfortunately i cant derive the information needed to solve my problem.
As stated above, since triggers should be executed on any machine including the server, i would suppose that the variable declaration should work too. Since the trigger checks the variable, it should fire on any client. That the "unfreeze" will only work where the units are local should not be an issue because somewehre they should be local (the server since its ai)...

.kju [PvPscene]
Oct 13 2011, 12:38
Why not let your code speak? Aka post it here / in pastebin?

helling3r
Oct 13 2011, 13:36
The PBO is linked above. The triggers in question are located near the south of Nadezdino, northwest of the southern teams there.

.kju [PvPscene]
Oct 13 2011, 14:03
Just as an advice out of experience:
People will not dig into your scripts. It is up to you to present the relevant code.

My advice:
# Debug the MP with diag_log to see whats going on
# Initialize your global variables in the init.sqf
# Use the editor only for unit/object placement and script all the rest - only that way you have full control and understand what's going in.

To use triggers, unit inits, and even waypoints from the editor can cause serious
headaches in MP when you run into issues and have trouble to find the very specific issue.