Jump to content
Sign in to follow this  
Impavido

Online probs with triggers help plz!

Recommended Posts

confused.gif I have a constant prob with playing OFP online. Sometimes triggers and scripts will be activated and work normally for some ppl, but some ppls PC's dont even register the trigger or its effects. For example, a trigger detects when one team scores and gives the appropriate team a point. But some players get NO message that anybody scored, and when the Radio Code that dispays the Score is activated, the score looks like 1-0, but for the ones who got no message about the score, their PC displayes a score of 0-0. I've struggled with this problem since my first OFP map. I avoided it by simplifying the triggers to a bare minimum. Now that my map making has gotten more complex, its unavoidable and very frustrating. WHY DO I HAVE THIS PROB??!?!? All my maps work perfect offline, Is it my server? Is it lag? Is it a prob with OFP net-code that i should hope is fixed with 1.81? PLZ HELP ME!!!!! sad.gif

Share this post


Link to post
Share on other sites

This is nothing new, what u need is to properly synchronize the events on your map. Synchronizing is achieved using PublicVariable "variableName" accompanied by a properly designed script (usually).

I suggest you search around, look at this http://www.flashpoint1985.com/cgi-bin....t=16868

and there are more.

See if some of those threads help you if not PM some people that have found the answer. confused.gif

here? http://www.flashpoint1985.com/cgi-bin....t=17021

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">WHY DO I HAVE THIS PROB??!?!? All my maps work perfect offline, Is it my server? Is it lag? Is it a prob with OFP net-code that i should hope is fixed with 1.81? PLZ HELP ME!!!!! [sad.gif] <span id='postcolor'>

Because triggers are local on every client, what ever is closest to a player gets updated more often, players are always in different positions resulting in different trigger results on different clients at times.

Also do not forget, "_variable" and "variable" are also local to each client, that is why u need to use PublicVariable to send out the same information to all clients+server.

Share this post


Link to post
Share on other sites

I've looked at the Public Variable on the Com Ref and i dont quite understand it. How exactly does it work? Plz give me a syntax example.

Share this post


Link to post
Share on other sites

hi,

variable=something; PublicVariable "variable"

DoThat=true; PublicVariable "DoThat"

and that for each update.

Share this post


Link to post
Share on other sites

Hmmm...

I remember someone else having this same problem a few weeks ago...I dont remember his name... tounge.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (InqWiper @ Aug. 21 2002,05:57)</td></tr><tr><td id="QUOTE">Hmmm...

I remember someone else having this same problem a few weeks ago...I dont remember his name... tounge.gif<span id='postcolor'>

I do tounge.gif

Yep, PublicVariable is used on a global variable that 'should' exist on all machines, whenever u want to update it everywhere (sync).

So like was said, variable = 10; PublicVariable "variable";

will put the value 10 into the variable on all machines...

Share this post


Link to post
Share on other sites

I must be doing something wrong...what is it? My code simply will NOT work properly. Please look at my script and comment. Thank you.

Legend:

InsertionChopper - the name of a West Chopper placed with the editor.

server - a gamelogic placed with the editor.

Script Below:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

enableRadio false

titleText["Petrovice....", "Black In", 7]

;CREATE THE CAMERA

playMusic "7thIAmGonaFly"

_camera = "camera" CamCreate [4092.81,5112.39,13.34]

_camera CameraEffect ["Internal","Back"]

_camera camCommit 0

@camCommitted _camera

HostStartsIntro = false

PublicVariable "HostStartsIntro"

usedPlayers = (crew InsertionChopper); PublicVariable "usedPlayers";

?!(local server) : goto "WaitForHost"

?(local server) : titleText["Welcome Host. Map by Kenji.", "plain", 1]

_unusedPlayers = (crew InsertionChopper)

"_x MoveInCargo InsertionChopper" forEach [a1,a2,a3,a4,a5,a6,a7,a8]

usedPlayers = (crew InsertionChopper) - _unusedPlayers; PublicVariable "usedPlayers"

_LeadGuy = (usedPlayers select 0)

usedPlayers Join _leadGuy; publicVariable "usedPlayers"

HostStartsIntro=true; publicVariable "HostStartsIntro";

#WaitForHost

?!(local server) : titleText["Welcome client. Map by Kenji", "plain", 1]

@HostStartsIntro

#IntroStart

_ct = _ct + 1

...Skipped a Crap Load of camera shots

; Tell The Insertion Chopper to Move to the landing Zone

InsertionChopper flyinheight 100

InsertionChopper setPos [(getPos InsertionChopper select 0), (getPos InsertionChopper select 1), 100]

InsertionChopper doMove [(getPos lzInsertion select 0), (getPos lzInsertion select 1)]

InsertionChopper SetSpeedMode "NORMAL"

....Skipped Another Crap load of camera shots. No references to my player or Ai objects were made just cam scripting. All my cam commands ends with @camCommit _camera. I did them with Camera.sqs.

; EJECT EACH PLAYER ONE BY ONE

enableRadio false

HostFinishedEject=false; publicVariable "HostFinishedEject"

?!(local server) : goto "WaitForHostFinishedEject"

_i=0

_j = count usedPlayers

_LeadGuy = (usedPlayers select 0)

#EjectLoop

_ThisUnit = (usedPlayers select _i)

unassignVehicle _ThisUnit

_ThisUnit Action ["eject", vehicle InsertionChopper]

_i=_i+1

@(_ThisUnit distance InsertionChopper) > 40

?_j > _i : goto "EjectLoop"

            HostFinishedEject=true; publicVariable "HostFinishedEject"

#WaitForHostFinishedEject

@HostFinishedEject

enableRadio true

; Destroy the camera

_camera cameraEffect ["terminate", "back"]

camDestroy _camera

; Start the timer

[] Exec "TimeLimit.sqs"

; SEND THE CHOPPER TO THE WAITING POINT

InsertionChopper doMove getPos ChopperWaitingPosition

Exit

<span id='postcolor'>

It gets to the part where it's supposed to eject the guys, but it doesn't. I had a titleText that displayed the count of the usedPlayers array, but my clients always saw either 0 or scalar. I don't know what I'm doing wrong. Give me a shout if you can. Thank you.

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  

×