User Tools

Site Tools


dcx:event_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:event_library [2016/01/25 12:51] – vicdcx:event_library [2026/06/22 12:21] (current) – external edit 127.0.0.1
Line 53: Line 53:
  
 Make sure you have the advanced editor enabled. In the main menu click on the 'advanced editor' button and specify a smallest map size as possible. Make sure you have the advanced editor enabled. In the main menu click on the 'advanced editor' button and specify a smallest map size as possible.
 +
 +{{:dcx:evlib7.jpg|}}
 +
 +Then once in the advanced editor go to the settings tab and then to the 'Import and Other settings' tab and set the ruleset to 'VR'
 +
 +This is important as it tells the Simple editor that your event library is compatible with the default VR ruleset.
  
 {{:dcx:evlib1.jpg|}} {{:dcx:evlib1.jpg|}}
  
-Then once in the advanced editor go to the lib tabsheet.+Then go to the lib tabsheet.
  
 {{:dcx:evlib2.jpg|}} {{:dcx:evlib2.jpg|}}
Line 80: Line 86:
 In the event editor you do the following. In the event editor you do the following.
  
-1. Add a new event+1. Add a new event. 
  
 2. Assign the event to your "Command Problems Library". 2. Assign the event to your "Command Problems Library".
Line 91: Line 97:
  
 Then I script the following code: Then I script the following code:
 +<code>
 0)    ' event code is going to come here 0)    ' event code is going to come here
 1)    SETVAR: TempVar1 = CheckTurn 1)    SETVAR: TempVar1 = CheckTurn
Line 106: Line 112:
 12)     LOOPER: TempVar6 FROM 0 TO CheckTotalUnits 12)     LOOPER: TempVar6 FROM 0 TO CheckTotalUnits
 13)       '  13)       ' 
-14)       CHECK: CheckUnitX(TempVar6) > -1+14)       CHECK: CheckUnitHistoricalID(TempVar6) > 0
 15)         CHECK: CheckUnitIsHQ(TempVar6) > 0 15)         CHECK: CheckUnitIsHQ(TempVar6) > 0
-16)           '  +16)           CHECK: CheckUnitOwner(TempVar6) == TempVar1 
-17)           SETVAR: TempVar7 = CheckRandomPercent +17)             '  
-18)           CHECK: TempVar3 > TempVar7 +18)             SETVAR: TempVar7 = CheckRandomPercent 
-19)             ' If random roll 0-100 is below CommandProblemsChance for this HQ a command problem occures +19)             CHECK: TempVar3 > TempVar7 
-20)             '  +20)               ' If random roll 0-100 is below CommandProblemsChance for this HQ a command problem occures 
-21)             SETVAR: TempVar10 = TempVar5 +21)               '  
-22)             SETVAR: TempVar10 * CheckRandomPercent +22)               SETVAR: TempVar10 = TempVar5 
-23)             SETVAR: TempVar10 / 100 +23)               SETVAR: TempVar10 * CheckRandomPercent 
-24)             SETVAR: TempVar10 + TempVar4 +24)               SETVAR: TempVar10 / 100 
-25)             SETVAR: TempVar11 = 0 +25)               SETVAR: TempVar10 + TempVar4 
-26)             SETVAR: TempVar11 - TempVar10 +26)               SETVAR: TempVar11 = 0 
-27)             ' tempvar11 has the AP loss calculcated for units under this HQ (or hq itself) +27)               SETVAR: TempVar11 - TempVar10 
-28)             SETVAR: TempString1 + CheckUnitName(TempVar6) +28)               ' tempvar11 has the AP loss calculcated for units under this HQ (or hq itself) 
-29)             SETVAR: TempString1 + ' has suffered ' +29)               SETVAR: TempString1 + CheckUnitName(TempVar6) 
-30)             SETVAR: TempString1 + TempString11 +30)               SETVAR: TempString1 + ' has suffered ' 
-31)             SETVAR: TempString1 + 'AP due to command problems.' +31)               SETVAR: TempString1 + TempVar11 
-32)             SETVAR: TempString1 + ReturnCRLF +32)               SETVAR: TempString1 + 'AP due to command problems.' 
-33)             '  +33)               SETVAR: TempString1 + ReturnCRLF 
-34)             LOOPER: TempVar8 FROM 0 TO CheckTotalUnits +34)               '  
-35)               '  +35)               LOOPER: TempVar8 FROM 0 TO CheckTotalUnits 
-36)               SETVAR: TempVar9 = 0 +36)                 '  
-37)               CHECK: CheckUnitHQ(TempVar8) == TempVar6 +37)                 SETVAR: TempVar9 = 0 
-38)                 SETVAR: TempVar9 = 1 +38)                 CHECK: CheckUnitHQ(TempVar8) == TempVar6 
-39)               END CHECK +39)                   SETVAR: TempVar9 = 1 
-40)               CHECK: CheckUnitIsHQ(TempVar8) > 0 +40)                 END CHECK 
-41)                 SETVAR: TempVar9 = 0 +41)                 CHECK: CheckUnitIsHQ(TempVar8) > 0 
-42)               END CHECK +42)                   SETVAR: TempVar9 = 0 
-43)               CHECK: TempVar6 == TempVar8 +43)                 END CHECK 
-44)                 SETVAR: TempVar9 = 1 +44)                 CHECK: TempVar6 == TempVar8 
-45)               END CHECK +45)                   SETVAR: TempVar9 = 1 
-46)               '  +46)                 END CHECK 
-47)               CHECK: TempVar9 == 1 +47)                 '  
-48)                 ' This unit is suffering Command Problems +48)                 CHECK: TempVar9 == 1 
-49)                 EXECUTE: ExecUnitApModify(TempVar8, TempVar11, -1, -1) +49)                   ' This unit is suffering Command Problems 
-50)               END CHECK +50)                   EXECUTE: ExecUnitApModify(TempVar8, TempVar11, -1, -1) 
-51)               '  +51)                 END CHECK 
-52)             END LOOPER +52)                 '  
-53)             '  +53)               END LOOPER 
-54)           END CHECK +54)               '  
-55)           '  +55)             END CHECK 
-56)         END CHECK +56)             '  
-57)       END CHECK +57)           END CHECK 
-58)       '  +58)         END CHECK 
-59)     END LOOPER +59)       END CHECK 
-60)     '  +60)       '  
-61)     CHECK: CheckStringLength(TempString1) > 0 +61)     END LOOPER 
-62)       EXECUTE: ExecMessage(TempVar1, -1, -1, -1) +62)     '  
-63)     END CHECK +63)     CHECK: CheckStringLength(TempString1) > 0 
-64)     '  +64)       EXECUTE: ExecMessage(TempVar1, -1, -1, -1) 
-65)   END CHECK+65)     END CHECK 
 +66)     '  
 +67)   END CHECK 
 +</code> 
 + 
 +===Step D: Save the event library=== 
 + 
 +{{:dcx:evlib4.jpg|}} 
 + 
 +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=== 
 + 
 +{{:dcx:evlib6.jpg|}} 
 + 
 +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: 
 + 
 +{{:dcx:evlib8.jpg|}} 
 + 
 +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://www.vrdesigns.nl/privatepatch/CommandProblems.zip|CommandProblems.zip]]
dcx/event_library.1453726318.txt.gz · Last modified: 2026/06/22 12:14 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki