Results 1 to 30 of 44

Thread: Some modest results with spawn_army

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    CA CA JeromeGrasdyke's Avatar
    Join Date
    Dec 2002
    Location
    At a new top-secret (non-CA) location, surrounded by lots of steel and glass, high atriums, hordes of lovely marketing ladies, and with a new and spacious desk with plenty of room for body-moving.
    Posts
    257

    Default Re: Some modest results with spawn_army

    Ok, i've had a quick look at spawn_army for you... the syntax you worked out above is essentially correct -- the command expects a sequence of "unit" commands followed by unit id's as phrases ... the following should work:

    spawn_army
    faction romans_julii
    character Foedus Chaerea, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 89, y 80
    unit roman generals guard cavalry, soldiers 20 exp 9 armour 1 weapon_lvl 0
    unit roman legionary first cohort ii, soldiers 40 exp 0 armour 0 weapon_lvl 0
    unit roman legionary cohort ii, soldiers 60 exp 0 armour 0 weapon_lvl 0
    unit roman praetorian cohort i, soldiers 60 exp 0 armour 0 weapon_lvl 0
    end

    The reason why unit and end appeared not to be recognised was because the data after and before (respectively) were incomplete.

    This error is typical; understanding the Rome descr parser could have helped some. Essentially it works by parsing Words, which are letter sequences ended by whitespace, Phrases, which are word sequences ended by comma's, and Lines, which are word and phrase sequences ended by newline characters. In this case, there had to be a phrase terminator (comma) after the unit id, because otherwise the parser couldn't know where the unit id ends as a unit id is a phrase - a sequence of arbitrary words.

    This is why some identifiers in the game use underscores and others not - internally some things are typed as Words and others as Phrases. If you look out for this kind of pattern it may help you spot wrongly-formed scripts... I'll see about getting you guys some docudemon files up-to-date for Barbarian Invasion.
    Last edited by JeromeGrasdyke; 09-20-2005 at 14:56.
    "All our words are but crumbs that fall down from the feast of the mind."
    -- from 'The Prophet' by Kahlil Gibran

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO