Event System
From Trinity Reign Wiki
WIP Underthemoon's Wishlist Event System
This Event (quest) Editing system should be directly integrated into the real time Trinity Reign map editor.
The key aspect of this system is the ability to either monitor all game messages or query the DB in real time. It then uses this data as input for event triggers or constraints, as well as command. The power of the system is that it can use any form of data as a trigger or constraint or command in ANY combination, from a player walking into zone A, to having pink hair, to giving a player walking in zone A pink hair. A 'node' mindmap type GUI with dropdown for all your options will make this system very easy to use.
Trigger: If this condition is met, start step/script Constraint: Do not start step/script if condition is met. Action: If step is triggered, do this.
The following is the list of data types for a wishlist of triggers and constraints, and simple examples of their use.
Location
- Anywhere
- Here (If used on its own, where the player is)
- Not Here
- Region
- City
- Path
- Distance
- meters
- km?
- Zone
- Defined by area around a point picked in the map editor.
- Defined by area between points using a draw box.
- Proximity (defined by distance and orientation, such as Within 5 meters of X, or 50 meters behind X)
- NPC (any type)
- Player
- Item
- Random (picks a random location. Anywhere by default)
- Defined by Region/City/Street/etc
- Inventory
- Equipped
- Sub-menu holds the exact slot.
- Direction
- North/South/East/West (system would have to keep vague track of where the actor has been.}
Any of these can be used as triggers OR constraints for other locations. The follow is how it would be done in a Here/Not Here format.
HERE: For example, you could have an Event trigger if an NPC Bloosycame within 5 meters of point A. Note that a PLAYER does not have to trigger the Event step. This can be used to override NPC's AI at will. As a constraint, you can have an even set up so it will not trigger until your defined HERE is devoid of selected actors. Example: An NPC will only come out of his house if there are no Characters Here, as defined by the street outside his house. This could also be done with Not Here, making it a trigger rather than a constraint.
NOT HERE This is the opposite of here, and can be used to limit or enact a trigger. Two examples: A criminal is supposed to stay in jail, as defined by the Jail area. It he leaves, he is Not Here, and an alarm will be sounded. Example 2: This uses the Anywhere location. Not Here Anywhere means something is not in the game Anywhere. So say you wanted something to reappear whenever it was destroyed, you would tell the system to Create Item whenever it is Not Here Anywhere. A final example is a constraint.
Number
- All
- More than.
- Less then.
- Equals
- Multipliers (more than 10 times x).
- etc
Numbers will be used in almost all Event triggers, as seen in the Location example above. Number is a powerful trigger and constraint. It can be used to count, create, or destroy. An event writer could set up the script to create (Action) 100 monsters at Random location within 100 meters of Here (being the player) if the player steps into Zone A. This would make 100 beasts pop out of nowhere automatically.
Actor
- Any
- Item
- Player
- Any
- Self
- Race
- Dropdown for selecting races
- NPC
- Sex
- Male
- Female
Obviously, these are the physical objects in the game. As triggers, they are used with location or number.
Time
- Before
- After
- Timespan (between)
- Elapsed
- While
- Until
- Seconds
- Minutes
- Hours
- Days
- Weeks
- Months
- Years
This is to set triggers to a certain time, be it before 6:00, after 6:00, between 6 and 7, or one of the previous combined with Elapse (Before/After/while/Until) 6 minutes pass.
While and Until are special modifiers for Actions, triggers, and constraints. You can make it rain Until an Item is Not Here Anywhere or While an Item is Anywhere (both would work). All you have to do it create Item in some remote place filled with monsters. Thus, with a few simple clicks, you have created an epic quest that will occupy players for hours, if not days or weeks. With a few extra clicks and nodes, you can make monsters appear around the item automatically.
Action
- Create
- Enter/Exit
- Do
- Modify
- Set
- Place
- Math (add, subtract, multiply by, Divide by, etc)
- Move
- Attack
- Emote
- Talk
- Die
- Mark (text)
- Script
- Map Editor Commands
- And many more.
Actions are the fun things that happen to the game when events are triggered. They can also be used as triggers and constraints themselves. We can set up an event that triggers if a Player Attacks a Female Human in Zone A. Mark is a special action used to mark that players or NPCs have done another event.
Stats
- Age
- Weigh
- STR
- born in
- wanted (triggers a certain AI script)
- etc... we are all familiar with stats and what they are.
As with all the other data typos, stats can be used as a trigger, constraint, or in an action. People who are too tall (more than + height) might trigger an NPC to offer them a job. Or that same NPC could not offer a job to anyone over a certain height. As an action, you could make a character taller, either permanently, or for a time limit with Until Time Elapsed, or even Until Item is in Location Equiped Left hand.
Special Conditions
- Weather
- Raining
- Snowing
- Sunny
- etc
- Temperature
- Degrees (used with Numbers
Links
- Or
- And
- With
- Coming From
- others
These are used to connect nodes together. 'IF' is the default for all nodes, so it is not shown in the node, but it is shown in the text sentence the quest chain makes. A finished quest chain might look like this: IF More Than 5 Human Marked [Joined Evil Dudes] With Black Hoods Enter Vaern Between 12:00AM and 1:00AM, Set All Human In Vaern Marked [Joined Evil Dudes] Wanted. That is just the visual text to show the writer what is going to happen. There would also be a window for looking at the actual code being created by the editor for more tech-savvy people, or to edit the script directly with something the node menus can't do.
It would be easy to mess that up somewhere, so the editor has a GUI that uses snap-together nodes with dropdown menus with all of the above (and more) data types. Creating a quest would be as simple as creating a node, selecting a trigger from a dropdown menu, add conditions with the same dropdown menu, then create another node and do the same.
I will create a visual picture of what I have in mind for the GUI later.
I am sure there are other data types people with think of. Each data type would add more power to the system.
