Results 1 to 18 of 18

Thread: Certain faction attacks certain settlement controlled by certain faction

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Certain faction attacks certain settlement controlled by certain faction

    Long title, but it's what I'm after.

    Basically (not really), I'm trying to script so that if a certain faction controls a certain settlement which is attacked by a certain different faction, an ally has an army spawned next to the settlement hopefully to fight in the battle.

    I have no problem with the spawning armies part, but I'm not sure about one thing: I'm trying to use these as "if" statements; how can I define the faction and target faction in the "if FactionStanding" part and the "if GeneralAssaultsResidence" part.

    Am I on the right track? At all? I think I'm going to have to start from scratch.

    edit: OK, I can't use the GeneralAssaults as a condition. So I have to somehow declare a variable?
    Last edited by eternalsteelfan; August 09, 2010 at 12:18 PM.

  2. #2
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    You can't use FactionStanding in an if statement. FactionStanding requires a faction and a target faction to be exported by an event. Exports cannot be used in if statements.

    You can use any of the I_WhatEver conditions in an if statement. But if you want to track other things then you'd have to make counters for them and use I_CompareCounter to check them, at least that's the only way I've found to get around the problem.

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    Quote Originally Posted by Taiji View Post
    You can't use FactionStanding in an if statement. FactionStanding requires a faction and a target faction to be exported by an event. Exports cannot be used in if statements.

    You can use any of the I_WhatEver conditions in an if statement. But if you want to track other things then you'd have to make counters for them and use I_CompareCounter to check them, at least that's the only way I've found to get around the problem.

    No other way to include other conditions then the I_WhatEver in an "if" condition.










  4. #4
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    When you need to check for diplomatic stances with if-conditions you can use faction leader traits to store such informations. For example, England being allied to France gives the English FL the hidden trait AlliedToFrance. Now you can check in your monitor:

    if I_FactionLeaderTrait england AlliedToFrance = 1


    But your script wouldn't work as desired for other reasons: When you spawn an allied English army next to a besieged French town you have no way of telling this army to attack the besieging army. And if the French garrison doesn't sally this turn the English army will simply walk away to its next town to reinforce the local garrison.

    That's BTW the problem in 90% of all cases you are spawning armies for AI factions.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  5. #5

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    Makes sense, thanks.

  6. #6

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    That's what I figured, but i was hoping I could figure a way to have the allied army spawn at a time when the attacking army was going to begin the battle.

  7. #7
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    ASFAIK the event PreBattle, what would be the only one suitable, is not working properly; but this is OC something that you can easyly test by setting up to hostile army near by with descr_strat and then try to spawn an additional army with PreBattle.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  8. #8

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    Maybe PreBattle only works for the player going to battle?

    Could the attacking army be labeled, then forced to attack with the ally armies spawning? Or the allied armies being labeled and forced to attack?

  9. #9
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    You can only label characters through descr_strat entries or when spawning.










  10. #10

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    So label_unit only works in battles? Hmm. What about the spawned army attacking the nearest enemy?

  11. #11
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    both armies (characters) need labels










  12. #12

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    Yeah, I was looking at another battle command, wish they were seperate in the docudemon.

    I guess it's down to improving conditions so that the AI wants to attack with the spawned army or the sieging army to assault.

  13. #13

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    Suggest you have a look at Call of Warhammer. They have scripted battles at various points in the campaigns. You get a Y/N event asking if you want to send men to help your ally and accepting the event results in an immediate battle.
    Currently following these promising mods - Imperia Antiquitatis by Splenyi
    Traits, Talents, and Toadies
    by Hellbent
    Real Roman Reforms
    by Aodh Mor
    Unit Icons project
    by Bullgod
    Also recommended:
    City Sack, Liberation and Diplomatic Options
    by Dresden

  14. #14
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    This sounds like the normal "assist ally" feature from M2TW.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  15. #15
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    It sounds more like a scripted battle to me. The standard feature (in RTW too BTW) does not result in an immediate battle, it results in your army moving to the ally+enemy, and once that is done the battle takes place.

    Also where Redxavier says 'at various points in the campaign' suggests that these are set points.

    I hope I'm wrong, I'll check out CoW if I am, but judging from the wording I think I'm probably right.

  16. #16

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    Yes, definitely scripted as they occur the same turn and location during every campaign, regardless of whether you are near the place of battle. The game spawns both the enemy army, your army, and an allied army, usually all close to an allied settlement, and then has the AI attack one of them.

    The vanilla assist ally feature barely works, and given the limitations and side effects of controlling AI movements, this is so far the best approach I've seen to fighting alongside your allies. It also works precisely in the way that the OP wants.
    Currently following these promising mods - Imperia Antiquitatis by Splenyi
    Traits, Talents, and Toadies
    by Hellbent
    Real Roman Reforms
    by Aodh Mor
    Unit Icons project
    by Bullgod
    Also recommended:
    City Sack, Liberation and Diplomatic Options
    by Dresden

  17. #17
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    I think scripted battles are fine in their own right but they're a pretty poor substitute for the assist ally feature.

    It's a shame noone seems to understand how it works, and again I'd love to be wrong

  18. #18

    Default Re: Certain faction attacks certain settlement controlled by certain faction

    I think the problem is that the campaign rarely offers up the opportunity to see it in action, so it's hard to see how it functions. There seem to be all these conditions determining whether it can happen in the first place (military access, allies etc.), and on top of that is just the low probability of you, your ally and the enemy all being in the right place at the right time (especially given the size of some maps) - and the battle actually happening isn't guaranteed either because all the armies need to be the right size as one party (usually the enemy) might withdraw. I saw the feature for the first time ever last week - I just happened to have an army next to an allied city - only, nothing happened.

    It's just a problem with the game on a fundamental level - turn-based gameplay just doesn't allow for the kind of spontaneous military action required for alllies to assist each other in battles except under rare conditions. Factions can only move during their turn and can only join battles fought by other factions if they happen to be on the same tile of the map. To get around this, you'd have to redesign the map entirely to follow the Shogun TW model, with each province being just one tile, to increase the opportunity for interventions. Further, there's no AI mechanism in place to say 'Allied city under attack, send army to relieve' like it has for its own settlements, so the onus is always on the player to intervene even when the instantaneous auto-calculate battles haven't killed any chance of folks getting there.

    It's a big mess basically. If the game was done in real-time, with campaign and battles happening in a sort of quickened real-time (obviously not real hours), armies within a certain distance of the battle could join as they pleased. Once actually joined, the game would slip back into proper real time as per usual. Mount & Blade works on a similar sort of principle, such that you can multiple armies all piling in. Of course, this would impact on recruitement and building times.
    Currently following these promising mods - Imperia Antiquitatis by Splenyi
    Traits, Talents, and Toadies
    by Hellbent
    Real Roman Reforms
    by Aodh Mor
    Unit Icons project
    by Bullgod
    Also recommended:
    City Sack, Liberation and Diplomatic Options
    by Dresden

Posting Permissions

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