Jump to content
Sign in to follow this  
Pierrot

Event handlers

Recommended Posts

Hi there! smile_o.gif

In the latest patch (ver1.96), you can add many event handlers against addons. "Fired", "killed", "Dammaged" etc. These feature enables you to add more flexible response to addons.

By the way, how does this event handler work in multiplay. Sometimes in multiplay, synchronism is very important. Do you know which computer controls event handlers in multiplay mode, client machine or server machine? wink_o.gif

If server machine controls event handlers which are driven by client machine, there may be some lag because client and server is connected with some time difference. Consequently client side would have bad response in event handlers.

If client machine cotrols event handlers which are driven by client machine, client side will have as good respons in multiplay as in singleplay in event handlers. But in this case, server machine cannot grasp precise time association.

Which does OFP adopt?

Share this post


Link to post
Share on other sites

From the official comref:

Quote[/b] ]....MP notes: "Killed" and "Hit" event handlers are executed where given unit is local. All other event handlers are executed on all computers. Events added by addEventHandler may be different on each computer.

So "Killed" and "Hit" are only executed on the client that was killed/hit, where everything else is exec'd on both the server and client

Share this post


Link to post
Share on other sites

Don't trust that CMD ref on event handlers in MP, do some searching of this forum.

Share this post


Link to post
Share on other sites
So "Killed" and "Hit" are only executed on the client that was killed/hit, where everything else is exec'd on both the server and client

What I am concerned with is a time lag in multiplay. Usually in singleplay, these event handlers are driven as soon as each event happens. For example if you fire your rifle addon in which "Fired" event handler is set, then "Fired" event handler is driven without any delay. Let's think about a smoke effect which makes powder smoke from your rifle addon. If this smoke effect is related with the "Fired" event handler, this effect will be played at the same time. You will see your rifle fired and powder smoke generated at the same time.

Then how about in multiplay? Can you ensure that the effect , which is related with "Fired" event handler, and the rifle shot are played simultaneously also in multiplay? If not, it would be an ugly effect; You would see smoke effect long after you'd fire your rifle. wink_o.gif

Share this post


Link to post
Share on other sites

Well I guess you wont have to worry too much about it, as long as each client knows that the eventhandler is on the unit, then immediately once he fires the smoke will appear, however if there is massive desync between the players from something else the client may not know that the unit has fired, so he wont get the same effect

Share this post


Link to post
Share on other sites

Thans Korax smile_o.gif .

Now I have one more question. I have talked about case that every addon in each client has the same event handler. But what will happen if some of the addons do not have the event handler. A mismatch of addon version may introduce this problem.

Now you are a client which has an addon the event handler is planted. When you fire your rifle addon, then you will see the event handler effect without any delay. Whether other client machines' addons have the event handler or not has no effect upon what you see. But what will happen if another client fires his rifle addon in which no event handler is planted. Can you see the effect on his rifle? And there is no delay between his rifle's fire event and the effect? wink_o.gif

Share this post


Link to post
Share on other sites

I suppose so, yes... It should work that way, if the eventhandler is added just by one client, then he would probably see the effect (ECP does this I'm sure, with AT backblast and such, while some people can have it on and others not, only those who do have it on still see the effect even if its on someone elses tank or plane)

And it should all happen with little or no delay biggrin_o.gif

Share this post


Link to post
Share on other sites

I see. smile_o.gif

All problems are solved. Thanks a lot, Karox! biggrin_o.gif

Share this post


Link to post
Share on other sites
Thanks a lot, Karox! biggrin_o.gif

Lol, No problem wink_o.gif

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  

×