99
edits
(Update for 200.43 MinEvent Handling, add Custom section) |
m (Reverted edits by Glass zebra (talk) to last revision by Egocarib) Tag: Rollback |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Modding]] | {{Modding Info}}{{Modding Topic Prerequisites | Modding:C Sharp Scripting}}[[Category:Script Modding]] | ||
Events are the basic building block that most of [[{{gamename}}]]'s mechanics are built upon.<br/> | Events are the basic building block that most of [[{{gamename}}]]'s mechanics are built upon.<br/> | ||
Line 7: | Line 7: | ||
=Standard Events= | =Standard Events= | ||
Events are typically listened for in generic Parts or Effects, which is what implements more advanced functionality of an object.<br/> | Events are typically listened for in generic Parts or Effects, which is what implements more advanced functionality of an object.<br/> | ||
[[Mutations]] ([[Modding:Creating_New_Mutations|Creation]]) and [[ | [[Mutations]] ([[Modding:Creating_New_Mutations|Creation]]) and [[Skills]] are both Parts. Effects such as sleep, prone or poison are handled separately from Parts as they are usually temporary. | ||
<!-- Listen? Register? Subscribe? Ah whatever. -Arm --> | <!-- Listen? Register? Subscribe? Ah whatever. -Arm --> | ||
===Listening=== | ===Listening=== | ||
Line 182: | Line 182: | ||
// A static helper method to fire our event on a GameObject. | // A static helper method to fire our event on a GameObject. | ||
// If it's a high-frequency event this should implement event pooling, rather than | // If it's a high-frequency event this should implement event pooling, rather than create a new MyCustomMinEvent each time. | ||
public static void Send(GameObject Object) { | public static void Send(GameObject Object) { | ||
if (Object.WantEvent(MyCustomMinEvent.ID, MinEvent.CascadeLevel)) { | if (Object.WantEvent(MyCustomMinEvent.ID, MinEvent.CascadeLevel)) { |