Results 1 to 30 of 44

Thread: Some modest results with spawn_army

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member Member Dromikaites's Avatar
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    151

    CA Some modest results with spawn_army

    Unfortunately it's not good news yet but I've managed to figure out some of the correct syntax. Maybe somebody else would pick up from here, maybe Jerome Grasdyke form CA would give us a hint ;) or maybe I'll find out more in the future.

    So here is what I've done and the results I've got so far:

    I started with the recommended syntax:

    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
    I knew already that unit was not recognized, so my first test was with this structure:
    spawn_army
    faction romans_julii
    character Foedus Chaerea, general, command 0, influence 0, management 0, subterfuge 0, age 20, , x 89, y 80
    end
    The game started but Foedus wasn't anywhere to be seen (the coordinates should have made him show up at the crossroad west of Arretium). I closed the game to see the error message and it said that faction is an unrecognized token. Which means the "official" syntax is incorrect also about faction, not only about unit. Even knowing what doesn't work is a step forward ;)

    At that moment I realised that the first goal should be to identify what tokens/keywords does that command accept. I removed faction from the structure of the command making it:
    spawn_army
    romans_julii
    character Foedus Chaerea, general, command 0, influence 0, management 0, subterfuge 0, age 20, , x 89, y 80
    end
    The game loaded again with no Foedus on the map. The error message after closing the program was telling me that end is also an unrecognized token.
    However romans_julii and character Foedus Chaerea, general, command 0, influence 0, management 0, were parsed and accepted as valid.

    Next logical step was to remove end and see what happens. I expected of course problems because there was no way the computer would know what units should go into Foedus' stack.

    The game progressed as far as the end of the loading bar but then crashed to desktop without of an error message. Now this was actually good news, because crashing at the end of the loading bar without an error message means the computer had actually tried to put Foedus on the map. So I turned to the descr_strat.txt to take a closer look at the syntax used there for putting troops on the map.

    Here is a sample for Julii:

    character Flavius Julius, named character, leader, command 0, influence 0, management 0, subterfuge 0, age 47, , x 89, y 82
    traits GoodCommander 2, NaturalMilitarySkill 1, GoodDefender 1, PoliticsSkill 3, GoodAdministrator 2, Austere 1
    ancillaries aged_retainer
    army
    unit roman generals guard cavalry early exp 1 armour 0 weapon_lvl 0
    unit roman hastati exp 1 armour 0 weapon_lvl 0
    unit roman hastati exp 1 armour 0 weapon_lvl 0
    unit roman triarii exp 1 armour 0 weapon_lvl 0
    unit roman archer exp 1 armour 0 weapon_lvl 0
    and here is one for the rebles:

    character, sub_faction carthage, Gelon, general, command 0, influence 0, management 0, subterfuge 0, age 20, , x 96, y 19
    army
    unit carthaginian city militia exp 1 armour 0 weapon_lvl 0
    unit carthaginian city militia exp 1 armour 0 weapon_lvl 0
    I notticed that in both cases the parser that handles descr_strat doesn't need the keyword "end" at the end of the army list. It probably uses the keywords character, character_record or a blank line in order to decide when the army list ends. Also I've noticed the army keyword at the begining of the army list.

    My new test was with this structure:

    script

    spawn_army
    romans_julii
    character character Foedus Chaerea, general, command 0, influence 0, management 0, subterfuge 0, age 20, , x 89, y 80
    army
    unit roman generals guard cavalry early exp 1 armour 0 weapon_lvl 0
    unit roman hastati exp 1 armour 0 weapon_lvl 0
    unit roman hastati exp 1 armour 0 weapon_lvl 0
    unit roman triarii exp 1 armour 0 weapon_lvl 0
    unit roman archer exp 1 armour 0 weapon_lvl 0

    end_script
    Of course I was expecting unit to return error, but the purpose was to see if army is accepted or not. The game loaded, Foedus was nowhere and after closing RTW the error message said that unit was not recognized. Which means that army is an accepted keyword for the spawn_army command.

    I think this discovery is important for two reasons:
    1) It's an undocumented feature, unknown to the modding comunity till now (as far as I can tell);
    2) The fact the undocumented token is accepted makes me think that probably the command is operational but we don't know the right syntax for it.

    The next structure tried was:
    script

    spawn_army
    romans_julii
    character character Foedus Chaerea, general, command 0, influence 0, management 0, subterfuge 0, age 20, , x 89, y 80
    army
    roman generals guard cavalry early exp 1 armour 0 weapon_lvl 0
    roman hastati exp 1 armour 0 weapon_lvl 0
    roman hastati exp 1 armour 0 weapon_lvl 0
    roman triarii exp 1 armour 0 weapon_lvl 0
    roman archer exp 1 armour 0 weapon_lvl 0

    end_script
    which allowed the game to load but upon exit showed that roman is an unrecognized token. It was kind of what I was expecting because the units are either refered to like unit roman generals guard cavalry early (keyword unit in front, descr_strat.txt style) or "roman generals guard cavalry early" (with quotes, like in console_command create_unit "Gaius Julius" "roman generals guard cavalry early") and I haven't used any of those forms.

    Putting in quotes the units' names also didn't help. Then I thought that maybe the command would look up the units in some table based on their rank, so i replaced the whole unit lines with numbers. The numbers themselves were considered unrecognized tokens.

    To summarize, we know now that:
    1) faction names are accepted;
    2) army is accepted;
    3) end and unit are not accepted;
    4) unit names are not accepted neither with nor without quotes;
    5) numbers instead of unit names seem not to work either
    6) the game does try to put the army on the map if the command contains only accepted tokens/keywords but crashes because so far we don't know how to add units. So what we need to research now is the accepted encoding for units for this command.

    I'll keep trying various formats for coding the units. Maybe Jerome Grasdyke would be kind enough to point us in the right direction.

    Edit:
    After some more testing I discovered that traits is accepted but ancillaries not
    Last edited by Dromikaites; 09-16-2005 at 09:59. Reason: Adding new info

  2. #2
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Some modest results with spawn_army

    Good research Drom!


    Can spawn_army be used outside of a "show me" script?
    "One of the most sophisticated Total War mods ever developed..."

  3. #3
    Member Member Dromikaites's Avatar
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    151

    Default Re: Some modest results with spawn_army

    Quote Originally Posted by Dol Guldur
    Good research Drom!


    Can spawn_army be used outside of a "show me" script?
    I'm testing it as a campaign script: the last lines of descr_strat.txt point to the file containing the the script. This way it saves testing time: if something is wrong, the game CTDs quicker than in case of a show-me script.
    Last edited by Dromikaites; 09-16-2005 at 14:02.

  4. #4
    Simulation Monkey Member The_Mark's Avatar
    Join Date
    Dec 2004
    Location
    Helsinki, Finland
    Posts
    2,613

    Default Re: Some modest results with spawn_army

    Beautiful job, Drom!

    We too have played with the spawn_army command, but with no considerable results. If the syntax of the command could be cracked it'd make us all very happy modders.

    Jerome, any interest in throwing us a bone here? Please? Pretty please?

  5. #5
    Member Member Dromikaites's Avatar
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    151

    Default Re: Some modest results with spawn_army

    Quote Originally Posted by The_Mark
    Beautiful job, Drom!

    We too have played with the spawn_army command, but with no considerable results. If the syntax of the command could be cracked it'd make us all very happy modders.

    Jerome, any interest in throwing us a bone here? Please? Pretty please?
    The fact it does parsing and that recognisez "undocumented" tokens like army makes me think it is there and operational. It also accepts arguments being passed to it by the script files (at least the faction name, the character name, the traits). So it means it has to accept other arguments, as long as they are in the right format.

    The worst case scenario is it has been transformed in "do nothing" by some other piece of code. In which case it would accept the right arguments, report no error and...do nothing. Like the "bribery" trait (I'm sure you guys at EB have already discovered it's useless even if given to diplomats).

    However, if I know enough about programmers' behavior, "spawn_army" is a very useful function for making bandits pop up so I doubt they wrote 2 distinct pieces of code, one this we are trying to activate and another one that spawns the rebels. It would be possible but not likely.

    I've also noticed something else some months ago but at that time I wasn't interested in modding. Yet now I realized it might also point in the direction of a functioning "spawn_army" command.

    The thing I've discovered then was that a rejected candiate to the hand of one of the daughters was sometimes showing up full of rage, at the head of a stack of rebels. That has happened too often to be just a coincidence that the names were randomly generated twice: once for the suitor and once for the rebel named character.

    To me it looks like there might be a function that generates a list of suitors. If one guy is rejected, his name becomes eligible for "spawn_army". As we can see from the descr_rebel_factions.txt, those armies are ready-made, just waiting for a general to lead 'em. Not all the rebel armies are led by a named character in-game (family member), even though they field general's bodyguard units. So the function which spawns bandits probably takes the standard rebel army and places it under the named character.

    Another thing about the rebel armies: they are listed in reverse order (general bodyguards last in the list) compared to the descr_strat.txt. This makes me think that maybe the order of the params coding the units is also important.
    Last edited by Dromikaites; 09-16-2005 at 18:00.

  6. #6
    Member Member Stuie's Avatar
    Join Date
    Aug 2001
    Location
    Upper Gwynedd, PA
    Posts
    406

    Default Re: Some modest results with spawn_army

    Wow - this is an excellent start at cracking the spawn_army code. I have a couple ideas I can try out this weekend... will report back with any decent findings.

  7. #7
    Member Member Argiod's Avatar
    Join Date
    Sep 2005
    Location
    I live in the beautiful Flathead Valley in NW Montana, just 30 miles from Glacier National Park.
    Posts
    1

    Default Re: Some modest results with spawn_army

    A suitor scorned becomes a rebel... sounds about right to me. I tend to get fighting mad when I can't get the lady I'm after, too... LOL

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