If you include both, the monitor can only be triggered once, then it cannot be used again. This basically determines whether the monitor can be triggered more than once. With some monitors, you will see both terminate_monitor and end_monitor at the end. The difference between terminate_monitor and end_monitor In this case, on the pressing of the end turn button, the code inside the monitor will be run. Monitor_event buttonpressed buttonpressed end_turn TrueConditionĪn event monitor is basically a trigger using certain conditions. As soon as no changes to 1 (after waiting 10) the monitor is triggered and the code inside it is run. In the example above, the monitor is declared, but the counter no is not 1. A monitor can be declared at the beginning of the script and will then be checked continuously. The difference between a Monitor and an If statement is that the conditions for an if statement are checked when the if statement is reached, and not again. Monitor_conditions I_CompareCounter no = 1 It can also be very helpfull if you do not want a script to end before a monitor is triggered. This will pause the script until the player ends the first turn (turn 0) While monitors can be extreemly usefull for pausing the script until something happens. In this example, the script will keep running forever, because the condition is that no is zero, and there is no code to stop this. When the script runs through, everytime it reaches and end_while, it will check the conditions, and if they are still true, it will jump back to the while statement. What this will do is at the stage at which it reaches the If line, it will check counter no, if counter no is 1 then it will run the code, if not it will skip to the end_if.Ī while loop will repeat itself whilst its conditions are true. Like for example if you have a counter called no The monitor event/monitor conditions/if/while commands are very much like the triggers for advice threads.īasically they are for checking conditions. Now we have the script working all the time, however, we have to incorporate the triggers we want to use into the script itself, instead of the export_descr_advice file. Once activated, this script will never terminate as when it reaches the end_while it will loop back to the I_CompareCounter. This is accomplished with the addition of a simple piece of code to the script – a While loop: The fundamental difference between an event script and a background script is that a background script is supposed to keep running and not terminate until the game is quit. It must have all the components of a show_me script as listed in the Beginner Guide, namely trigger, advice thread and script. In truth, every mod with significant scripting features will end up making use of all of the different types of script – background, event and campaign – as they all compliment each other.Īs all show_me scripts, the background script is activated through the advisor. In fact, the very first scripts that Myrddraal released – the Multiple Turns per Year script and the Hot Seat Beta script – were both background scripts. This is why modders use background scripts as the main driver for their scripting features as they require the player only to make a single click each time the game is reloaded to run all their features and it gives them complete flexibility as to when and how their features are implemented. If it occurs outside of the player’s turn then the player will never get the chance to click on the show_me button as the advisor will appear and disappear during the AI turn. The second, more importantly, is that the event script trigger can only ever be something that will happen in the player’s own turn. The first is that it requires the player to click on the show_me button each and every time you want to make a change to the game environment. There are two major limitations to the use of event scripts. It must be activated at the start of the game, and then manually reactivated each time the game is reloaded. This guide takes us a little deeper into the world of the background script – this is a script that is running constantly in the background of the game. These must be manually activated when their trigger event occurs. The Beginner Guide taught us the basics of using the event script – which is a script that runs only for a moment, making a change to the game world. In A Beginner Guide to Scripting () we identified two different types of scripts: campaign scripts and show_me scripts, and went further to divide show_me scripts into event scripts and background scripts.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |