Results 1 to 19 of 19

Thread: Scripts

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Scripts

    At the moment I'm working on a set of scripts to fix an old problem with the loyalty system. Now when a parent faction is destroyed, and the rebel faction takes over, all the city garrisons disappear. I'm writing scripts to spawn new garrisons when that happens.

    What i was thinking about doing next is a general garrison script that would spawn militia forces when the player lays seige to a city. One of the problems with the RTW AI is that the AI tends to leave its cities poorly defended, and this would go some way to alleviating that problem.

  2. #2
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: Scripts

    I figure there should be a way to make the Slave faction to bolster up it's settlements, instead of leaving them unguarded.
    I also increased the rebel city garrissons 4x to slow down AI and player Expansion. Works quite well so far, AI doesn't like to expand into far far away anymore and instead concentrates on the weaker rival faction settlements.

    Militia force spawning sounds like a great idea, but should depend on the city size, for example: village 1 militia, town 2 militia, minor city 4 militia, large city 7 and huge gets 10.

    The new Ekdromoi seems quite balanced, it's fast and agile, troop size is 26/51/101/201 and they live up to their job by barely eliminating a thracian peltast, though sometimes they rout and heavy peltasts can cause problems for them.
    Here are some preview screens (used the shields from Alex):
    Ambush
    Rabble 1
    Rabble 2

    If anyone's wondering about the unit size, I lowered it after making the shots and also lowered their stats, now they'll(101 men) come out of a fight with thracian peltasts (80 men) with 28-38 survivors.
    They also have swords as secondary, which they only use when fighting on walls.

    I'm also working on the new Thureophoroi and Militias, should have screens soon.
    Last edited by RedFox; January 21, 2007 at 01:32 PM.

  3. #3
    Cymera's Avatar Roma Invictus
    Join Date
    Sep 2006
    Location
    Toronto, Ontario, Canada.
    Posts
    1,380

    Default Re: Scripts

    could the script have an "if" clause such as, if city has below # units defending, spawn # militia? because i siege some cities that have a full stack as the garrison, and it becomes a pitch battle, if that city got an extra 1000-1500 troops, then that would be a little unfair, wouldn't it?


    Under the Patronage of the Wise Kara Kolyo in the Hallowed House of Wilpuri
    Proud Patron of the Charming
    Balikedes, an Insightful and Tactful Warrior.

    Extended Greek Mod (XGM) Lover ..... A mod by DimeBagHo

    "
    The wise are instructed by reason, average minds by
    experience, the stupid by necessity and the brute by instinct
    "


    - Marcus Tullius Cicero






  4. #4
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: Scripts

    Cities would never wind up with more than a full stack of defenders. There is (unfortunately) no way for a script to find out how many units are in a city, but (fortunately) spawn unit commands do nothing once you have a full stack.

    I think for huge cities with 24,000+ populations I will probably spawn up to 20 good quality units (maybe not elite, but good) because I think that cities of that size should always be a tough fight. It's really a major weakness of the game that you can often capture cities of that size, and make a sack load of money, without much of a fight.

  5. #5

    Default Re: Scripts

    Great idea with the garrison script. Nothing worse than laying siege to a huge city with a population of over 24,000 with a garrison of 400 Thureophoroi or faction equivalent. Perhaps a script like this could slow down the siege..replenish troops..siege..replenish troops player.

    Pardon for being off topic for a moment...but it's great to see DBH has returned and is perhaps working on future versions for some of us to lose
    sleep over. Thank you for your work DBH.

  6. #6
    Cymera's Avatar Roma Invictus
    Join Date
    Sep 2006
    Location
    Toronto, Ontario, Canada.
    Posts
    1,380

    Default Re: Scripts

    Quote Originally Posted by Lysander13 View Post
    Great idea with the garrison script. Nothing worse than laying siege to a huge city with a population of over 24,000 with a garrison of 400 Thureophoroi or faction equivalent. Perhaps a script like this could slow down the siege..replenish troops..siege..replenish troops player.

    Pardon for being off topic for a moment...but it's great to see DBH has returned and is perhaps working on future versions for some of us to lose
    sleep over. Thank you for your work DBH.
    Seconded, maybe this is an opportunity to take a good idea from M2TW? they have (as many of you know) two tiers of units, professional soldiers from castles, and militia from cities. I propose that the only units spawned should be militia, since a city should not be able to produce sooo many professional soldiers in such a short time. They could be militia of increasing strength and numbers proportional to the level of the city. This would make it harder for the attacker, but not insurmountable.

    because playing on VH/VH you cannot often spare a full stack to assault a city, so if it has 5-7 units defending and you have about 12, it would be impossible to win if the city just spawned 20 hypapists right? if it spawned 12-15 militia troops, then it would be a great fight, but not impossible.


    Under the Patronage of the Wise Kara Kolyo in the Hallowed House of Wilpuri
    Proud Patron of the Charming
    Balikedes, an Insightful and Tactful Warrior.

    Extended Greek Mod (XGM) Lover ..... A mod by DimeBagHo

    "
    The wise are instructed by reason, average minds by
    experience, the stupid by necessity and the brute by instinct
    "


    - Marcus Tullius Cicero






  7. #7
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: Scripts

    One more thing about Militias, they are being under siege so they have no place to get resources, so logically they need to demolish buildings/furniture, whatever to get the materials to forge the equipment (not all families have soldier's equipment), so the buildings in the settlement should be damaged after the militias have been added.
    Also, the militias should be separate units with 0 upkeep, it would be a bit sad if you got sieged in so many places and then find out that your treasury is -13000.... (unless this is only for AI factions...)
    Last edited by RedFox; January 21, 2007 at 10:21 PM.

  8. #8
    Cymera's Avatar Roma Invictus
    Join Date
    Sep 2006
    Location
    Toronto, Ontario, Canada.
    Posts
    1,380

    Default Re: Scripts

    Perhaps the city should just lose 50% income when the militia units are spawned? this could reflect the barracks and smithies working overtime.


    Under the Patronage of the Wise Kara Kolyo in the Hallowed House of Wilpuri
    Proud Patron of the Charming
    Balikedes, an Insightful and Tactful Warrior.

    Extended Greek Mod (XGM) Lover ..... A mod by DimeBagHo

    "
    The wise are instructed by reason, average minds by
    experience, the stupid by necessity and the brute by instinct
    "


    - Marcus Tullius Cicero






  9. #9
    Zarax's Avatar Triple Chaosmaster
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    8,382

    Default Re: Scripts

    DBH does this mean that XGM is going to have an EB like script? I still feel strongly against the idea...
    The Best Is Yet To Come:

  10. #10
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: Scripts

    Not quite, EB's script was of massive scale, this one shouldn't add all those traits/bonuses/money - destroy buildings, add pop.. etc.
    Only reason I dislike EB though is the long loading times, I can load up xgm several times to playtest it instead of waiting ages for it to load once.
    It would just be nice if a besieged city had local culture militia units spawned to make it more fun to conquer...

  11. #11

    Default Re: Scripts

    Sorry if I am being dense here, but (as Redfox asked) is this spawning additional garrisons just for the AI, or for the player as well?

    Sounds a handy boost for AI factions, but don't think it would slow down expansion over the rebels, as their smaller cities would spawn ony token garrisons?

    Regardless - good to see the team has their juices flowing again and that new releases will be along in due course.

  12. #12
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: Scripts

    Quote Originally Posted by Zarax
    DBH does this mean that XGM is going to have an EB like script? I still feel strongly against the idea...
    I agree, I still don't like background scripts. Doing it without a background script does impose some severe limitations on what I can do however.
    Quote Originally Posted by Hippias
    Sorry if I am being dense here, but (as Redfox asked) is this spawning additional garrisons just for the AI, or for the player as well?
    It will only be for sieges where the player is attacking the AI. Without a background script it is not feasible to spawn garrisons for every siege. I am starting to think that it would be better to limit it to a relatively small number of cases - perhaps when the player attacks large or huge settlements, or when the player attacks certain cities like Rome, Carthage, Sparta, and so on.
    Quote Originally Posted by RedFox
    One more thing about Militias, they are being under siege so they have no place to get resources, so logically they need to demolish buildings/furniture, whatever to get the materials to forge the equipment (not all families have soldier's equipment), so the buildings in the settlement should be damaged after the militias have been added.
    Taking away money and population from the settlement that gets the garrison may be possible, but I'm not wild about damaging or destroying buildings. The problem is that the AI doesn't know how to repair buildings, and I don't like to do anything that makes an AI weakness even worse.

  13. #13
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: Scripts

    The problem is that the AI doesn't know how to repair buildings
    As far as I know it can repair sabotaged buildings... so naturally the AI should be able to repair just damaged buildings too. Though lowering the income would probably do the thing.

  14. #14
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: Scripts

    I've seen buildings standing unrepaired for a long time - I suppose it could be just that the AI puts a low priority on it though.

  15. #15

    Default Re: Scripts

    Just to satisfy my curiosity...and my pardons if this is a noobish type of question. What would the pros and cons be of having EB like scripts in XGM? Perhaps not on the scale of EB but just some...Let's say for example
    something similar to the Olympic type script they use. Just curious as to what the positives and negatives are of using scripts in mods is all...
    Thanks in advance to whoever answers my question.

  16. #16
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: Scripts

    Well, first of all would be increase in memory leaks and therefore slowdown of the strat map fps. Secondly it would require a huge amount of work and searching for errors in the code could take days if not weeks (in EB code style that is...).

  17. #17
    DimeBagHo's Avatar Praeses
    Moderator Emeritus

    Join Date
    Mar 2005
    Location
    Auckland
    Posts
    7,943

    Default Re: Scripts

    The downside to using a background script is that the player has to start it up again each time they reload the game, it can cause slow-downs once it gets sufficiently complicated, and of course bug-fixing can become a problem.

    That's why I have, so far, stuck to using one-off scripts that perform particular functions and then terminate. You don't get slow downs, isolating bugs is a lot easier, and the player gets more control over the scripted features they want to use.

  18. #18

    Default Re: Scripts

    Quote Originally Posted by DimeBagHo View Post
    The downside to using a background script is that the player has to start it up again each time they reload the game, it can cause slow-downs once it gets sufficiently complicated, and of course bug-fixing can become a problem.

    That's why I have, so far, stuck to using one-off scripts that perform particular functions and then terminate. You don't get slow downs, isolating bugs is a lot easier, and the player gets more control over the scripted features they want to use.

    XGM: Fanatically devoted to the KISS principle.

  19. #19
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: Scripts

    Dime: I have fixed all the custom battles, the desert error has been removed and it looks like normal mediterranean terrain again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •