dcx:event_library
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| dcx:event_library [2015/05/06 15:28] – created vic | dcx:event_library [2026/06/22 12:21] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| === Event Libraries === | === Event Libraries === | ||
| - | Usage: create sets of events that can be modularly offered to users of the simple | + | There is no special |
| - | Now: VR creates a number of basic event libraries | + | |
| - | Future: VR adds more libraries, some community modders manage to wrap their head around scripting events (in such a way that they can be used in a modular way) | + | |
| - | ===Technical Details=== | + | It is important when designing this to provide the final user (in the simple editor) the options to configure and customize these event libraries. |
| - | There is no special editor | + | For example don't hardcode an event picture illustration for a message, but let the user specify one through a libvar or a table. |
| - | It is important when designing this to provide the final user (in the simple editor) the options and documentation to configure these event libraries. | ||
| This can be done by adding stringlists (tables) to the library and libvars... these can be given documentation and datatypes and will enable to give the end-user the ease-of-use to tailer the library for his scenario. | This can be done by adding stringlists (tables) to the library and libvars... these can be given documentation and datatypes and will enable to give the end-user the ease-of-use to tailer the library for his scenario. | ||
| + | |||
| + | It is very much recommended to always use the documentation buttons for libraries, libvars and stringlists (aka tables) so the end-user has some information on how to use them. | ||
| + | |||
| + | ===Rules when designing libraries=== | ||
| + | |||
| + | 1. Never store data in regimeslots or gameslots. Always store data in libvars of your own library. This makes sure it can function independently and will not get data mixed up with other libraries not of your writing. Keep in mind you can create these libvars on the fly just by writing to them using the appropriate exec. | ||
| + | |||
| + | 2. Only use the old 9 maparea slots for calculations within an event. Never store data in them, always use hexlibvars of your own library for that purpose. | ||
| + | |||
| + | 3. Where possible do not hardcode core variables. Make them accesible as libvars or stringlists of your own library. The end user will appreciate it. As will you when you re-use your event library for a different scenario. | ||
| + | |||
| + | 4. Never hardcode the action card categories... The designer using your libary needs to be able to determine the category of each card your library uses or generates. This means having a global libvar accesible in which the end user can specify the category number of your cards. (take a look at the basic event library to see this approach in action). This is because there are only limited categories and the person using the Simple Editor determines the category names and which cards goes in which category (because he might be using a lot of libraries). | ||
| + | |||
| + | 5. Never hardcode eventpictures in the messages generated by your events. Allow the user of your library to set them through a libvar. | ||
| + | |||
| + | 6. Make sure if you are looping through actioncards for example in your events and deleting stuff that you only delete stuff from your library and not from others. Remember: the end user might be using your library in conjunction with other libraries. | ||
| == Upon loading in simple editor == | == Upon loading in simple editor == | ||
| Only the event, cards and event pictures info will be read from these libraries | Only the event, cards and event pictures info will be read from these libraries | ||
| + | |||
| + | ====How to script events?==== | ||
| + | This is something I have not documented yet. As it would be a huge topic. There are over 400 execs and checks and understanding their use requires to understand almost all data types in the engine. | ||
| + | |||
| + | If there is a lot of interest in the Community Project I might start on this though. | ||
| + | |||
| + | ====Tutorial to create a very simple event library=== | ||
| + | Lets say we would like to have functionality that simulate some command & control problems for one or both of the sides in a scenario. How would we design an event library that would be capable to provide that functionality? | ||
| + | |||
| + | Before we start lets list what we'll need to do: | ||
| + | |||
| + | * A regime libvar that switches this functionality on/off: CommandProblemsEnabled = yes/no | ||
| + | |||
| + | * A regime libvar that specifies the % a HQ suffers C&C problems: CommandProblemsChance = numeric (0-100) | ||
| + | |||
| + | * A regime libvar that specifies the basic AP its units will lose: CommandProblemsFixedAPLoss = numeric (0-100) | ||
| + | |||
| + | * A regime libvar that specifies a random ammount of AP its units will lose: CommandProblemsRandomAPLoss = numeric (0-100) | ||
| + | |||
| + | * A 'turn event' that when the regime in question has its regimeLibVar CommandProblems set to ' | ||
| + | |||
| + | Thats it. It will do the job. No chrome, but I am keeping it simple in this tutorial. | ||
| + | |||
| + | ===Step A: Creating an event library and libvars=== | ||
| + | |||
| + | Make sure you have the advanced editor enabled. In the main menu click on the ' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Then once in the advanced editor go to the settings tab and then to the ' | ||
| + | |||
| + | This is important as it tells the Simple editor that your event library is compatible with the default VR ruleset. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Then go to the lib tabsheet. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | There we do the following. | ||
| + | |||
| + | 1. Create a new library | ||
| + | |||
| + | 2. Set the name of this library. Remember it has to be a unique name (call it something specific, not just 'my library' | ||
| + | |||
| + | 3. Add 4 libvars | ||
| + | |||
| + | 4. Set each libvar to ' | ||
| + | |||
| + | Optionally you can also give a description field to each libvar and to the library as a whole. This is RECOMMENDED because you'd like other designers to make use of your library as well. Thats the whole philosophy behind the Community Project. | ||
| + | |||
| + | Thats it. We have defined our library and libvars. Now we go to the event editor. | ||
| + | |||
| + | ===Step B: Adding the event scripting=== | ||
| + | |||
| + | {{: | ||
| + | |||
| + | In the event editor you do the following. | ||
| + | |||
| + | 1. Add a new event. | ||
| + | |||
| + | 2. Assign the event to your " | ||
| + | |||
| + | 3. Name the event | ||
| + | |||
| + | 4. Set the execution type for the event to 'late start turn'. ' | ||
| + | |||
| + | ===Step C: Scripting the event=== | ||
| + | |||
| + | Then I script the following code: | ||
| + | < | ||
| + | 0) ' event code is going to come here | ||
| + | 1) SETVAR: TempVar1 = CheckTurn | ||
| + | 2) ' | ||
| + | 3) SETVAR: TempVar2 = CheckLibVarRegime(TempVar1, | ||
| + | 4) SETVAR: TempVar3 = CheckLibVarRegime(TempVar1, | ||
| + | 5) SETVAR: TempVar4 = CheckLibVarRegime(TempVar1, | ||
| + | 6) SETVAR: TempVar5 = CheckLibVarRegime(TempVar1, | ||
| + | 7) ' | ||
| + | 8) SETVAR: TempString1 = '' | ||
| + | 9) ' | ||
| + | 10) | ||
| + | 11) ' | ||
| + | 12) | ||
| + | 13) ' | ||
| + | 14) | ||
| + | 15) | ||
| + | 16) | ||
| + | 17) ' | ||
| + | 18) | ||
| + | 19) | ||
| + | 20) ' | ||
| + | 21) ' | ||
| + | 22) | ||
| + | 23) | ||
| + | 24) | ||
| + | 25) | ||
| + | 26) | ||
| + | 27) | ||
| + | 28) ' | ||
| + | 29) | ||
| + | 30) | ||
| + | 31) | ||
| + | 32) | ||
| + | 33) | ||
| + | 34) ' | ||
| + | 35) | ||
| + | 36) ' | ||
| + | 37) | ||
| + | 38) | ||
| + | 39) | ||
| + | 40) END CHECK | ||
| + | 41) | ||
| + | 42) | ||
| + | 43) END CHECK | ||
| + | 44) | ||
| + | 45) | ||
| + | 46) END CHECK | ||
| + | 47) ' | ||
| + | 48) | ||
| + | 49) ' | ||
| + | 50) | ||
| + | 51) END CHECK | ||
| + | 52) ' | ||
| + | 53) END LOOPER | ||
| + | 54) ' | ||
| + | 55) END CHECK | ||
| + | 56) ' | ||
| + | 57) END CHECK | ||
| + | 58) END CHECK | ||
| + | 59) END CHECK | ||
| + | 60) ' | ||
| + | 61) END LOOPER | ||
| + | 62) ' | ||
| + | 63) | ||
| + | 64) | ||
| + | 65) END CHECK | ||
| + | 66) ' | ||
| + | 67) END CHECK | ||
| + | </ | ||
| + | |||
| + | ===Step D: Save the event library=== | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Save your work with the .dcxevlib extension. | ||
| + | |||
| + | And thats it. | ||
| + | |||
| + | In the final Step E i am just going to show how it looks like to the end-user when he loads your event library. | ||
| + | |||
| + | ===Step E: In the Simple Editor & In-Game=== | ||
| + | |||
| + | {{: | ||
| + | |||
| + | In the Simple Editor you or an end-user can load your event library and configure it (as shown in the example above) for one or more regimes. | ||
| + | |||
| + | Also note that the contents of the library are correctly listed as 4 libvars and 1 event. | ||
| + | |||
| + | Then finally when in-game when in-game the player will get reports like this one: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | It is important to check if your event libraries work properly before distributing them. | ||
| + | |||
| + | Don't forget to use the description fields for the library itself and its libvars and/or stringlists (tables for end-user). | ||
| + | |||
| + | Thats it! A working and tested library ready for use or sharing with other designers. | ||
| + | |||
| + | ===Tutorial library=== | ||
| + | |||
| + | Here you can download the library created in the tutorial above: | ||
| + | |||
| + | [[http:// | ||
dcx/event_library.1430926111.txt.gz · Last modified: 2026/06/22 12:14 (external edit)
