Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Guest

Retail
The Object Death Event Trigger

1 post in this topic

I'm sure you all know about the other triggers such as on init, local, host migration, pregame, incident, etc. But there's one useful trigger not many people know about: the Object Death event. This trigger is executed whenever an object is destroyed. (By the way, I never checked if an object despawning will execute the trigger).

 

Now, Matt, why would I want to use this trigger? Well, my friend, this trigger allows you to get the exact cause of an object's demise including who or what destroyed the object, if any. Incidents are alright for many things but this trigger gives you significantly more control of what's going on in the game.

 

You know how certain triggers offer data types such as Iterator.Player? The Object Death Event has something special for you too. Not just one but three special data types!

 

 

ExplicitObjectType ObjectDeathEvent.KillerObject

References the object responsible for the demise of another object.

ExplicitObjectType ObjectDeathEvent.DeadObject

References the object which was destroyed.

Custom ObjectDeathEvent.DamageType

Provides an integer value specifying the damage type (list below).

Fantastic! How do I use this in my gametype? You will need to create an ObjectDeathEvent trigger and add it to the EntryPoints table.

      <!-- Add this to the Triggers element -->      <Trigger trigType="ObjectDeathEvent" name="ObjectDeathEventTrigger">        <Elements>          <!-- actions and conditions go here -->        </Elements>      </Trigger>     <!-- Add this to the EntryPoints element -->      <ObjectDeathEvent>ObjectDeathEventTrigger</ObjectDeathEvent>
That's all folks! Alright, alright... I'll be practical here. Here's a bunch of example actions using the aforementioned data types:

          <!-- Store the damage type to temporary integer variable 0 -->          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Custom" varRefType="Scratch">NumericScratch0</Param>            <Param type="VarReference" varRefKind="Custom" varRefType="ObjectDeathEvent.DamageType" />            <Param type="OperationType">Set</Param>          </E>           <!-- Store the destroyed object to temporary object variable 0 -->          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />            <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="ObjectDeathEvent.DeadObject" />            <Param type="OperationType">Set</Param>          </E>           <!-- Store the destroyed object to temporary object variable 1 -->          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="ObjectScratch1" />            <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="ObjectDeathEvent.KillerObject" />            <Param type="OperationType">Set</Param>          </E>
The damage type is a number referencing the position of the damage type in the damage reporting type list which is as follows. Although I've renamed many internal codenames, you'll have to figure out which weapon is which if it's not explicitly stated in the list, sorry.

 

0   Unknown1   Guardians2   Scripting (includes Megalo)3   AI Suicide4   Burst Gun5   Spread Gun6   Homing Rifle7   Attach Beam8   Bishop Beam9   Stasis Gun10  Hard Light Grenade11  Incineration Cannon12  Magnum13  Assault Rifle14  DMR15  Shotgun16  Battle Rifle17  Sniper Rifle18  Rocket Launcher19  Spartan Laser20  Frag Grenade21  Sticky Detonator22  SAW23  Railgun24  Plasma Pistol25  Needler26  Gravity Hammer27  Energy Sword28  Plasma Grenade29  Covenant Carbine30  Beam Rifle31  Storm Rifle32  Concussion Rifle33  Fuel Rod Cannon34  Ghost35  Revenant Driver36  Revenant Gunner37  Wraith38  Wraith Anti-Infantry39  Banshee40  Banshee Bomb41  Seraph42  Revenant Deux Driver43  Revenant Deux Gunner44  Lich Driver45  Lich Gunner46  Mongoose47  Warthog Driver48  Warthog Gunner (Chaingun)49  Warthog Gunner (Gauss)50  Warthog Gunner (Rocket)51  Scorpion52  Scorpion Anti-Infantry53  Falcon Driver54  Falcon Gunner55  Wasp Driver56  Wasp Gunner57  Wasp Gunner (Heavy)58  Mantis Melee59  Mantis Chaingun60  Mantis Cannon61  Mantis Rocket62  Broadsword63  Broadsword Missiles64  Tortoise Driver65  Tortoise Gunner66  MAC Cannon67  Target Designator68  Ordnance Drop Pod69  Orbital Cruise Missile70  Hardlight Shield71  Autoturret72  Thruster Pack73  Fall Damage74  Generic Collision Damage75  Generic Melee Damage76  Generic Explosion77  Unknown78  Birthday Party Explosion79  Frag Melee80  Bomb Melee81  Bomb Explosion82  Ball Melee83  Telefragged84  Damage Transfer85  Armor Lock Crush86  Human Turret87  Plasma Cannon88  Plasma Mortar89  Plasma Turret90  Shade Turret91  Unknown92  Tank93  Chopper94  Hornet95  Mantis96  Flagnum97  Flood Talons

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0