OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: satexas69 on 22 Mar 2007, 15:42:11

Title: Join In Progress - Issues with completed objectives
Post by: satexas69 on 22 Mar 2007, 15:42:11
I'm having some issues where join-in-progress members don't see the exact same completions of objections when they join.. for example, in my third objective, you must "destroy" a lighthouse.... when a JIP member shows up, the lighthouse is standing although everyone else sees just the the llighthouse podium where it used to sit...

Is there a foolproof way of resolving this to synchronize objectives?

Here's my standard setup:

I use THIS in my ON ACT: line in triggers:

[server, "objective1"] exec "obj.sqs";

And THIS format in my obj.sys file:

Code: [Select]
_scriptcall = _this select 1
; ============================================================================
?(_scriptcall == "objective1"):goto "objective1"
?(_scriptcall == "objective2"):goto "objective2"
?(_scriptcall == "objective3"):goto "objective3"
; These are my main achievement objectives - required to finish the map
#objective1
"1" objstatus "DONE"
hint "Major Woody Rescued"
obj1=true; publicVariable "obj1"
exit
; ============================================================================
#objective2
"2" objStatus "DONE"
"Major_Woody" setmarkercolor "colorgreen"
hint "Major Woody successfully placed in MCU"
obj2=true; publicVariable "obj2";
exit
; ============================================================================
#objective3
"3" objStatus "DONE"
"LightHouse" setmarkercolor "colorgreen"
hint "Lighthouse Destroyed"
obj3=true; publicVariable "obj3";
exit

I know that the init.sqs isn't loaded on player connect... but is there some way to set live variables in some file that can be read and compared when the player joinns that will synchro?

And I know people say the init.sqs isn't read upload a player joining in progress... but I've seen some people do this:

onplayerconnected "Al exec "update.sqs"".... is this for JIP?
Title: Re: Join In Progress - Issues with completed objectives
Post by: sharkattack on 22 Mar 2007, 18:14:29
i think  the upadte sqs  refreshes the variables evey time a player connects
so if objective one is complete  and a new player joins  he has the objective checked
should work also with youre lighthouse.
Title: Re: Join In Progress - Issues with completed objectives
Post by: satexas69 on 23 Mar 2007, 03:45:41
Shark,

But what would I put in the Update.sqs file to synchronize? Do I put the same obj=0 original stuff that I initialize in my init.sqs? And if so, will it update the variables?

If an OBJ is completed, and the players in the game know - how would the update.sqs script know?  ???
Title: Re: Join In Progress - Issues with completed objectives
Post by: sharkattack on 23 Mar 2007, 13:13:10
try with this  in youre init sqs obviously replace the variables with youre own

one= False;
two = False;
three= False;
four = False;
if !(local Server) then {exit}
onPlayerConnected "publicVariable ""one""; publicVariable ""two""; publicVariable ""three""; publicVariable ""four"""
exit

think this does the same without having to use a script to update 
on player connecting variables in there current state (true or false ) are passed to the player