dcx:vr_logic_library
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dcx:vr_logic_library [2016/05/18 06:41] – vic | dcx:vr_logic_library [2026/06/22 12:21] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| First added to Community Project v0.90 | First added to Community Project v0.90 | ||
| - | |||
| In a nutshell: | In a nutshell: | ||
| - | * Allow VR Basic Library and VR Immersion Library to use the FLAGs using IFs and SETs | + | * Allow VR Basic Library |
| - | * Contains the functions | + | * Allows you to make entries to a Logic Table and Change Global Libvar Table. |
| - | * Contains table and event to run a logic table | + | The Logic Library is not meant to replace scripting your own events. Its meant to do some simple switches. If you want to make some complicated functionality your advised to create your own event library. |
| - | + | ||
| - | * Contains table and event to execute change | + | |
| ===IF & SET statements=== | ===IF & SET statements=== | ||
| Line 30: | Line 27: | ||
| etc.. | etc.. | ||
| - | They can be combined using an @ symbol that acts as a logical AND. | + | They can be combined using an @ symbol that acts as a logical AND. For example a> |
| - | And IF or SET statement always has to have 3 parts. A value to the left, to the right and an operator ( <, >, = for IF and =, *, /, +, - for SET) in the middle. | + | And IF or SET statement always has to have 3 parts. A value to the left, to the right and an operator ( <, >, = for IF ....and....... |
| The value to the left or the right can be a number, a LookUp value or a Flag. | The value to the left or the right can be a number, a LookUp value or a Flag. | ||
| + | |||
| + | When using a SET statement you can also push a string into a Flag. Like for example yourcapitol=Moscow | ||
| ==Lookup values== | ==Lookup values== | ||
| Line 40: | Line 39: | ||
| Valid lookup codes at the moment are: | Valid lookup codes at the moment are: | ||
| - | [turn] | + | [turn] |
| - | [round] | + | [round] |
| + | |||
| + | [hexowner$x, | ||
| + | |||
| + | [random$min, | ||
| + | |||
| + | Lookup values are case INsensitive. | ||
| ==Flags== | ==Flags== | ||
| Line 49: | Line 54: | ||
| To err on the side of caution only use regular letters and numbers in your flag names. And never ever use [, | To err on the side of caution only use regular letters and numbers in your flag names. And never ever use [, | ||
| + | |||
| + | Flag names are case INsensitive. | ||
| + | |||
| + | When a Flag is first used without being set its value will be 0. | ||
| ===Logic Table=== | ===Logic Table=== | ||
| Line 54: | Line 63: | ||
| Has just two columns. IF and SET. If IF statement is true then the SET statement will be executed. | Has just two columns. IF and SET. If IF statement is true then the SET statement will be executed. | ||
| - | Checked at the early start of every turn. | + | Checked at the early start of every turn. |
| + | |||
| + | It runs before any of the VR Basic Library events are run. So you can for example set flagA = 1 here in the same turn as having it cause 10 PP extra to arrive through the VR Basic Event Libs PP rewards table that has IF Logic flagA>0. | ||
| === Global Libvar Table=== | === Global Libvar Table=== | ||
| Line 60: | Line 71: | ||
| Has four columns. First one of course the IF statement. If the IF statement is true the global lib var (name in 3rd column) of library name (name in 2nd column) will be set to the value in the 4th column. | Has four columns. First one of course the IF statement. If the IF statement is true the global lib var (name in 3rd column) of library name (name in 2nd column) will be set to the value in the 4th column. | ||
| + | It also runs before any of the VR Basic Library events are run. | ||
| + | |||
| + | === Interoperability with the VR Basic Events Library === | ||
| + | |||
| + | From the VR Basic Events Lib version 7 and higher. | ||
| + | |||
| + | The following tables in the VR Basic Events tables have an extra column for IF logic: | ||
| + | |||
| + | * Supply Table | ||
| + | |||
| + | * Reinforcement Unit Table | ||
| + | |||
| + | * Replacement Troops Table | ||
| + | |||
| + | * Fuel Table | ||
| + | |||
| + | * PP Rewards Table | ||
| + | |||
| + | * Replacement Cards Table | ||
| + | |||
| + | * Officer Pool Table | ||
| + | |||
| + | * Reduce AP Table | ||
| + | |||
| + | * Change VP Table | ||
| + | |||
| + | If any IF logic is added to any of the rows to these tables these rows will only be executed if the IF logic returns true. | ||
| + | |||
| + | This allows you for example to give a special PP reward when a certain FLAG is present, or let specific unit arrive upon a certain FLAG value. | ||
| + | |||
| + | ===If you write your own libraries=== | ||
| + | |||
| + | This would requires the Keys of Potential Doom. | ||
| + | |||
| + | You could easily make your library tie in with the Logic Library as well and execute very specific things on an IF trigger. | ||
| + | |||
| + | Let me know if you need exact code on how to do this. | ||
| + | |||
| + | ===Debug=== | ||
| + | You can enable the global libvar ' | ||
dcx/vr_logic_library.1463553688.txt.gz · Last modified: 2026/06/22 12:14 (external edit)
