Welcome to Open Carnage

A resource for Halo Custom Edition and MCC modding, with unique means of rewarding content creation and support. Have a wander to see why we're worth the time! - EST. 2012


  • Content count

  • Joined

  • Last visited

  • Raffle Tickets

  1. The tags will be accurate, I just meant that the text in the tag path might not match what you expect for the weapon. IIRC modded weapons on custom maps will sometimes overwrite an existing weapon and just change the model and other attributes of it without modifying the tag (Ex: a custom rocket launcher could be tagged as `weapons\pistol\pistol`). You could fix this by keeping track of which map the tag was seen on and manually applying overrides like you're doing for the weapon names (ex: weapon `weapons\pistol\pistol` is `Pistol` except on map `custom1` where it's `Some custom rocket launcher` instead). EDIT: While it's true that most tags are pretty straightforward (ex: `weapon\pistol\bullet` = `pistol`), there's nothing that enforces this. As a counter-example, `weapons\plasma rifle\charged bolt` is a damage tag caused by the plasma pistol, not the plasma rifle. As always, custom weapons tend to be even less consistent. From what I know of your use case, personally I'd recommend tracing the damage tag back to the possible weapon(s) in the script, then sending that list of possible weapons to the webserver backend where it can be handled in some way (join the lot of them with "or"? ) vs. just sending the damage tag and guessing based on the components of it.
  2. Yes, that would work. However, tag paths were meant only as internal identifiers so they might not always be accurate or human-friendly (ex: the needler weapon object would be named `mp_needler`). You might have to hardcode some of them. If a weapon was modded to use another weapon's projectiles, then yeah, you're not going to be able to tell which weapon fired it (just that it was one of them). I don't think there's a way to solve this generally. It reads a dword (4 bytes) from the supplied memory address. Some resources for discovering what addresses contain what data: Eschaton and the entity definitions at https://github.com/ChadSki/SparkysPlugins/tree/master/plugins https://pastebin.com/Sm2Pf7V5 https://pastebin.com/QUWTMuKg
  3. I had to do something like this while developing a "gun game" mode so I have some experience with this problem. You should be able to extract everything you need from this script: https://github.com/pR0Ps/halo-ce-sapp-scripts/blob/master/gungame.lua . Specifically, look at the `get_weapon_tag_data` function. More info: The same damage tags can come from multiple weapons. For example, if you mod a sniper rifle to shoot pistol bullets, there is no way to know which weapon was actually used since all you know is that a pistol bullet caused the damage. Generally this is only a problem with custom maps/weapons but it's something to keep in mind. Different maps can have different weapons and different damage tags. The solution is to dynamically gather the damage tags each weapon can cause when the game starts, store them in a table (indexed by damage tag), and look up the possible weapons using the damage tag supplied by `OnDamageApplication()`. This will allow the script to work with custom maps/weapons without having to hardcode tags for them all. You will have to hardcode weapon names though (or pull them out of the tag path). Finding all damage tags that a weapon can inflict involves recursively following all the linked tags of a weapon and returning all the tags of type `jpt!`. This is because the damage inflicted isn't always directly by the weapon or the projectile the weapon shoots. For example, the rocket launcher shoots a projectile that spawns an explosion that damages the player. The flamethrower does something similar. Custom/modded weapons can do even crazier things.