Due to a sudden burst in spammer activity, account creation has been temporarily disabled. Sorry for the inconvenience to any new potential contributors.
Anatomy of a Script
From AGEWiki
m (formatting) |
m (bold instead of italics) |
||
Line 3: | Line 3: | ||
The simplest possible event, the equivalent of '''Hello, World!''' in traditional programming, is the following: | The simplest possible event, the equivalent of '''Hello, World!''' in traditional programming, is the following: | ||
- | ''SelectFaction = $CMN'' //select a faction, in this case CMN means all nations | + | '''SelectFaction = $CMN''' //select a faction, in this case CMN means all nations |
- | ''SelectRegion = $Anglia'' //select a region, in this case Anglia (London), center of the world in the Victorian era! | + | '''SelectRegion = $Anglia''' //select a region, in this case Anglia (London), center of the world in the Victorian era! |
- | ''StartEvent = Hello, World!|1|1|NULL|NULL|$Anglia|NULL'' //starts an event called "Hello, World!" | + | '''StartEvent = Hello, World!|1|1|NULL|NULL|$Anglia|NULL''' //starts an event called "Hello, World!" |
- | ''Conditions'' //demands some conditions to be met | + | '''Conditions''' //demands some conditions to be met |
- | ''Actions'' //if the conditions are met (if any) it will do some actions | + | '''Actions''' //if the conditions are met (if any) it will do some actions |
- | ''EndEvent'' //ends the event | + | '''EndEvent''' //ends the event |
Latest revision as of 08:09, 13 June 2013
A scripted event in Pride of Nations has a certain syntax that needs to be respected in order for the engine parser to read and implement it successfully. A working script should give no errors and, ideally, no warnings either. In a scripted event (or simply "script") the engine receives information that it has to select a nation, demands some conditions to be respected, implements the changes if the conditions are met, and writes a report (script log) about its operations.
The simplest possible event, the equivalent of Hello, World! in traditional programming, is the following:
SelectFaction = $CMN //select a faction, in this case CMN means all nations
SelectRegion = $Anglia //select a region, in this case Anglia (London), center of the world in the Victorian era!
StartEvent = Hello, World!|1|1|NULL|NULL|$Anglia|NULL //starts an event called "Hello, World!"
Conditions //demands some conditions to be met
Actions //if the conditions are met (if any) it will do some actions
EndEvent //ends the event