User Tools

Site Tools


dcx:vr_logic_library

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dcx:vr_logic_library [2016/05/18 10:49] – vicdcx:vr_logic_library [2026/06/22 12:21] (current) – external edit 127.0.0.1
Line 9: Line 9:
 * Allow VR Basic Library (v7 and higher) and VR Immersion Library to use the FLAGs using IFs and SETs * Allow VR Basic Library (v7 and higher) and VR Immersion Library to use the FLAGs using IFs and SETs
  
-* Contains the functions to interpret IFs and SETs+* 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 to any libraries global libvars based on an IF statement.+
  
 ===IF & SET statements=== ===IF & SET statements===
Line 29: 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>b@a>c@a>d
  
-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.......  =, *, /, +, - for SET) in the middle.
  
 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 42: Line 42:
  
 [round] => Returns round number. First round returns 1, second returns 2, etc.. [round] => Returns round number. First round returns 1, second returns 2, etc..
 +
 +[hexowner$x,y] => Returns regime slot (0 for first player, 1 for second player) that owns that hex. For example: [hexowner$22,40]
 +
 +[random$min,max] => Returns a random value between or equal to those minimum and maximum numbers. For example: [random$1,6] for a 1d6 roll.
 +
 +Lookup values are case INsensitive.
  
 ==Flags== ==Flags==
Line 48: 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 82: Line 92:
  
 * Officer Pool 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. 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.
Line 87: Line 101:
 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. 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.
  
-Best wishes, +===If you write your own libraries=== 
-Vic+ 
 +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 'debug' of this library to receive a message each turn for each player listing the current values of all flags.
  
dcx/vr_logic_library.1463568554.txt.gz · Last modified: 2026/06/22 12:14 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki