Bridge Commander Central
BC Forums => BC Scripting => Topic started by: USS Frontier on March 12, 2009, 10:15:28 PM
-
When a ship is destroyed, is it possible to acquire which ship destroyed her?
I didn't had time today to play around with the OBJECT_DESTROYED event to see if that's possible by the event. And the other idea I had to check that would require lot of event handling and data meaning performance wise it probably won't be good...
I just need to check which ship killed the other when this last one is destroyed, for hmmm... statistical purposes :D
-
I imagine so. AFIK this is a feature in multiplayer because they have a menu of kill counts. :-) See if there is anything in the scripts?
Hehe I can only imagine what evil things your are planning by keeping statistics on ships. :-p
-
Just took a litle stroll through app.py, and I found SetDestroyBrokenSystems and IsDestroyBrokenSystems, could also be interesting to poke at one of these days. Aside from that detour, there is also DestroySystem, and yet again aside from that, not much on "destroy".
I suppose the problem sets in when you use a script to launch torpedoes, you don't neccesairly need to have "ship" attached to it.
-
Yeah I remember MP has that count. But I didn't remember seeing anything about it in the scripts so I just came here, tho the last time I looked in the MP scripts was sooome months ago... :P
It's not for evil things. It's more like kinda-a-bit-more-serious-easter-eggs :lol:
I'm keeping other statistics as well but this "kill count" is the one I didn't know how to implement.
Hmmm... But what if there is anything on other names, like "kill" or something like that? I'll take a look at App.py searching for it later...
Yeah... But at least there isn't many scripts that launch torpedoes with the intent of damaging other ships, and many of these set the torp's parent ID, which could give us who shot the ship down.
But then again there are other scripts which can kill ships and are not torp related...
-
But for the other ways we can't really influence them. Except setting the condition to 0. :mrgreen:
In the Game object there are a couple of statistics, GetKills, GetTorpsFired, GetTorpsHit
-
ET_OBJECT_EXPLODING
pEvent.GetFiringPlayerID()
-
That's from the WeaponHitEvent class.
But what happens when a ship is destroyed from collision? Or won't that count as a kill?
-
But what happens when a ship is destroyed from collision?
You still get the ID of the ship.