The full scripting API is generated and updated each release, and is available here. Serpent cannot serialize a lot of Lua objects, such as functions, metatables and coroutines.Serpent is relatively slow and inefficient.If found, the game will then load that script, and any other scripts required in the control script.įactorio uses Serpent for serialization - This comes with some big drawbacks: The game looks for a file called 'a', in the mod directory or the scenario directory. When you load a game, scenario and mod scripts are loaded. To be more specific, we call these runtime scripts 'control scripts', as they assert direct control on the game as it runs. This guide only covers usages of runtime scripts. There are 2 usages of scripts, loading of prototype data, and runtime scripting of the game and its entities. Within the context of Factorio, a script refers to a Lua script, packaged with a mod or scenario. country_event or state_event) is set with a delay, then the trigger must be true when the event is intended to be fired.In general, you can learn the definition of a script here. If the effect used to fire an event (e.g. For example, if BHR doesn't exist when BHR = : the conditions within must still be fulfilled for either of these to be possible to fire an event. This effectively puts any events with a time delay onto a backlog of the country, put on hold until it gets released. However, if there's a time delay set in the effect that fires it, the timers in each delayed_event will not decrease. This does not happen if the event gets fired using an on action's random_events block: the same scoping rules as in the regular on action apply.Ī country that doesn't exist may still get events if fired via an effect, but any other method doesn't work. Importantly, it's what the FROM block of the effect block that fired it is, which depends on where it's fired exactly. an additional scope within on actions or the target of a decision. Although this does not always apply, as FROM.FROM can be something else entirely, e.g. Due to this, FROM is commonly called the 'sender' of the event in jargon, making FROM.FROM the sender to the sender. The previous effect block's FROM scopes get shifted one level down, with the effect block's FROM becoming FROM.FROM, previous FROM.FROM becoming, and et cetera. When fired using an effect, the game ports over the regular event targets existing in the previous effect block to the event, as well as the ROOT scope of the block, which becomes FROM within the event. If the player country gets an event and doesn't pick a choice, the first option will get assumed by default. There is nearly no difference between event types, with the exception of appearance, default scopes, and the fact that news event can have their pop-up disabled (However, the country will still get them). add_manpower being both a state- and country-scoped effect), the country is preferred.ĭue to this confusion, it is recommended to avoid state events as they appear identical to country events ( Event targets can be used within country events aimed to a specific state instead), however unit leader and operative leader events can be unavoidable due to their distinct appearance. In case of overlap between something being possible for the country or the other scope (e.g. In state events, operative leader events, and unit leader events, the assumed scope is both the country and the event-specific scope type, accepting effects for either scope, sorting them at will. In each event type, the ROOT scope refers to the country getting the event, however, the default assumed scope, also known as THIS, is not always purely the country. The list of event types includes country_event, news_event, state_event, unit_leader_event, and operative_leader_event. There are several types of events, changing the appearance or the target of the events. If you spot a mistake, please help with fixing it.Įvents are defined in the /Hearts of Iron IV/events/ folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |