Jump to content
Sign in to follow this  
Doolittle

"killed" event

Recommended Posts

Well what you can do is wait until the trigger sets a vaiable like triggerReady to true, but I found slight problems with this. What I do is I poll the triggers list in a script:

@count (list triggername) > 0

At least I think that's what I do. What happens is you may go off and run your script, and there won't be anything in the list for some time. smile.gif

Share this post


Link to post
Share on other sites

bn880, thanks for the complement! smile.gif  The "Network Services" sounds neat.  I was thinking of trying to make up a way to send something from one person to another & not just ALL people.....but then I found a fix to my problem so I didn't have to become that extreme.  That stuff is also hard to test too!!  It takes a while for me to...turn on another computer...set up the dedicated server, copy and paste my mission to that computer..log in..switch missions, try it & redo the mission on my computer...copy it over again, etc.  Too bad everything is local to the client when you are playing multiplayer by yourself.

Also for my map I am scripting every player, as they respawn, to give them weapons...so I just am attaching a "Killed" event to each of them when they respawn.  Seems to work for now.

Doolittle

Share this post


Link to post
Share on other sites

Jacobaby, I used that script to build on and modified it a wee bit (cos I dont need respawn) but the detecting driver of vehicle thing doesnt work- it detects whoover was hit by the vehicle as the driver (don't ask me how)

Could you check yours and make sure it does detect the driver of the vehicle?

(also maybe the gunner.....?)

Share this post


Link to post
Share on other sites

Hi, besides openning a 2 year old thread  yay.gif I just wanted to ask, since it STILL isn't clear to me:

I have server.  I have client.  Server createvehicle a building.  Server publicvariable the created bldg to client.  Client takes object and attaches a "killed" event to it.  Now, when building is killed .... NO ONE WILL SEE IT???  The Script Comm Ref. says "for any object that is local"...buildings are only local to server (right?).  So the client won't get the killed msg.  Hard for me to test... maybe someone knows off top of head if the client will or will not get killed event run on their machine?

Doolittle

P.S. AND ANOTHER THING pistols.gif I still don't get this:

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.

Does this mean if server creates vehicle, publicvar the vehicle to the clients. And only one client adds a "getin" event....then I would assume just the client that added the event in the first place will see the getin event, RIGHT? Ok....so if another client adds a getin too.... but they aren't the one to get in the vehicle (because vehicle will only be local to the client that got in)...they will still get the event fired because it wasn't a "hit" or "killed" event ??

Share this post


Link to post
Share on other sites
I have server. I have client. Server createvehicle a building. Server publicvariable the created bldg to client. Client takes object and attaches a "killed" event to it. Now, when building is killed .... NO ONE WILL SEE IT???
Correct.
Quote[/b] ] The Script Comm Ref. says "for any object that is local"...buildings are only local to server (right?). So the client won't get the killed msg. Hard for me to test... maybe someone knows off top of head if the client will or will not get killed event run on their machine?
To rephrase something that's been said in this thread over and over again: the killed event is only generated on the machine where the killed entity (vehicle/unit) is local. The killed event is not broadcast to any other machines. Therefore, the client will not recieve the killed event for the example situation you presented.
Quote[/b] ]P.S. AND ANOTHER THING pistols.gif I still don't get this:
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.

Does this mean if server creates vehicle, publicvar the vehicle to the clients. And only one client adds a "getin" event....then I would assume just the client that added the event in the first place will see the getin event, RIGHT?

Yes. Note however, that all machines will actually be informed of the "getin" event, but it's just one machine that has a handler attached to the vehicle in question.
Quote[/b] ] Ok....so if another client adds a getin too.... but they aren't the one to get in the vehicle (because vehicle will only be local to the client that got in)...they will still get the event fired because it wasn't a "hit" or "killed" event ??
Yes.

Share this post


Link to post
Share on other sites

A good example is also the dammaged EH. Even though it is public in MP, if only the server had the EH on a unit, then nobody else would get the info. Each client has to put the EH on the unit you wish to monitor. Then when the monitored unit is dammaged, every client with the EH would get the msg.

Killed and Hit, even if placed by all clients on the monitored units will still only return the results of the EH to the affected parties, so only the shooter and shot will get the info from the EH.

I have a safezone script which uses Hit to monitor if someone is firing into a safezone, or out of a safezone. It shows a message if someone violates the safezone, but only the shooter and the shot will get the msg. This can be fixed if you create a script that runs on each client to monitor for some vars which you publicVar from the script exec'd by the Hit or Killed EH's, however.

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  

×