I'm a fairly experienced coder whose just recently gotten into MT2TW modding and the first thing I've decided to try and cook up is a Levy Script (sortof a counterpoint to Klink's garrison script. The main roadblock I'm running into is a lack of understanding of how to get at certain info thats necessary for making the script even operate.
I've provided the pseudocode below in the hoped of getting some feedback as to which functions and grammar I'll need to accomplish the following;
;::::Start Test Levy Script;::::
declare_counter muster_isbuilt
set_counter muster_isbuilt 0
;;;;;[[Pseudo Code in question]]
;::::Check if Muster_call [building] is built in a particular settlement [London]
;::::if yes [muster_isbuilt == 1], get the settlement's population [int]
;:::: get settlement's tech level (wall) [int]
;:::: get info on settlement building types [bool + int]
;:::: get info on settlement governor [bool + int]
;:::: ??Get info on neighboring settlements?? [bool + int]
;:::: Spawn units based on this info
;::::Example Usage:
;::::[if Building A exists in London]
;:::: [settlement_pop = Settlement_pop London]
;:::: [if Building B exists in London]
;:::: [B_exists = 1]
;:::: [if Governor Z has trait1]
;:::: [Governor_has_trait1 = 1]
;:::: [if neighboring region [Sherwood] belongs to player1]
;:::: [neighboring_pop = Settlement_pop Sherwood]
;::::[London_muster_score = settlement_pop/1000 + (B_exists * 100) + (Governor_has_trait1 * 100) + (neighboring_pop/2000)
;::::[if London_muster_score > 0 && < 5000]
;:::: [create_unit London, Peasants, num 4, exp 0, arm 0, wep 0]
;::::
;::::
If anyone has any ideas as to which functions I cna use to get even a bit of this done, as well as some syntax examples, I'd be eternally greatful.
Bookmarks