Results 1 to 16 of 16

Thread: PSF Garrison

Hybrid View

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

    Default PSF Garrison

    Hi,

    Here's what I am trying to do and what I can determine:

    If the army captures a PSF I can determine which PSF (= coordinates) and what faction did that. Now I would like to spawn or move in the PSF some new units = new garrison. Of course I do not know the name of the character who captured the PSF and that is afaik impossible to determine so he cannot be moved out or the units created on him directly. Neither of the commands I tried (move, move_character, reposition_character by script or console) seem to do the trick. I heard about this 'boat trick' but I don't know what that is and if it could be used if I don't know both names. I did the thorough search and it seems to be quite an (unresolved?) issue to merge armies like this. Is there any way? What is this boat trick?

    Thanks in advance!

    Mod Leader, Mapper & Bohemian Researcher

  2. #2

  3. #3

    Default Re: PSF Garrison

    Quote Originally Posted by killersmurf View Post
    console_command create_unit wherever "unit"?
    Unfortunately create_unit requires character/settlement/label as parameter so unless I can label the character who conquered the PSF this cannot be used. I have read that labeling does not work on the fly, only for newly spawned characters, so even if it was possible it would probably not work. Or can create_unit command be used differently via console?

    Mod Leader, Mapper & Bohemian Researcher

  4. #4
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: PSF Garrison

    But a PSF is a settlement or don't I understand you?

  5. #5

    Default Re: PSF Garrison

    Quote Originally Posted by killersmurf View Post
    But a PSF is a settlement or don't I understand you?
    PSF = Permanent Stone Fort so it's a fort and not a settlement so it can't be specified in that command in any way I am aware of.

    Mod Leader, Mapper & Bohemian Researcher

  6. #6

  7. #7

    Default Re: PSF Garrison

    you could just spawn an army at that location. Look in the docudemons for the spawn army command. All you need is an X/Y coord. Do not need a settlement or character.
    ...longbows, in skilled hands, could reach further than trebuchets...

  8. #8
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: PSF Garrison

    Then it doesn't enter the fort but spawns above the fort IIRC

  9. #9
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: PSF Garrison

    yes, but you label it, spawn it behind the fort and then move it in the fort. You can lock in the general by removing its movement point by a trait, so the fort will be always garrisoned by at least
    the spawned general. But this would not apply to the units. Of course, if your goal is to keep a fort garrisoned so you need at least 2 turns to take it, this would do the work.
    P.S. what does IIRC mean?

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  10. #10

    Default Re: PSF Garrison

    Quote Originally Posted by Kiliç Alì View Post
    yes, but you label it, spawn it behind the fort and then move it in the fort. You can lock in the general by removing its movement point by a trait, so the fort will be always garrisoned by at least
    the spawned general. But this would not apply to the units. Of course, if your goal is to keep a fort garrisoned so you need at least 2 turns to take it, this would do the work.
    P.S. what does IIRC mean?
    IIRC = If I remember correctly

    The problem with this is that the move command be it scripted or console variant place the character atop of the PSF/settlement/whatever and not inside it. If I spawn the guy on the coordinates of the PSF he will actually spawn next to it. Only reposition_character command behaves differently in that it moves the character to the closest valid tile near the PSF but still not inside it. Since I cannot know the name of the one who took it in the first place (nor can I label him as he may be born/adopted/recruited) I cannot manipulate the one already inside.

    The removal of movement points is next logical step although it's better done via traits than scripted since it would have to be repeated every turn when scripted. It can be achieved for instance by placing the resource underneath the PSF (the same tile) and employing the trigger (or script but trigger is cleaner and less burdening the CS) with condition OnResource to give the trait to anyone who fulfils the requirement = GeneralCaptureResidence or ending the turn there, PostBattle etc. But this poses obvious problems like what if the PSF was not taken by the general at all or if the general is FL or FM who you don't want to be stuck in there...

    Anyway I start to think the immobilizing traits are the only option as the search revealed some similar issues people were trying to figure in the past and none seems to have been solved.

    Mod Leader, Mapper & Bohemian Researcher

  11. #11
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: PSF Garrison

    what about this?

    monitor_event CharacterSelected TrueCondition
    and IsFactionAIControlled
    and not IsLeader
    and not IsHeir
    and ... conditions for having won PSF
    console_command give_trait this Locked
    end_monitor

    Problem is, I don't know if characterSelected works with AI, neither if the MP limitation apllies for that turn or the following one.

    EDIT: another idea, but very bloody and troublesome
    when that faction gains the PSF, after one turn you spawn a rebel army nearby the fort.
    then, you spawn another army for the "fort owners" outside the PSF; the armies engage battle and the rebels auto_win.
    then you can spawn a character in the empty fort and it should be garrisoned.
    Last edited by Kiliç Alì; November 19, 2011 at 05:19 PM.

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  12. #12
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: PSF Garrison

    I think I found a solution, try this:
    Code:
    spawn_army 
    	faction whatever faction
    	character	whatever name, named character, age 32, x wherever, y wherever, label psfgarrison ;you have to spawn him one tile from the PSF
    	        unit	bodyguard unit		exp 0 armour 0 weapon_lvl 0
    		unit   garrison you want             exp 0 armour 0 weapon_lvl 0
    	end	
    move psfgarrison, x wherever, y wherever;this time move him in the PSF
    kill_character psfgarrison
    I'm not sure if a label works with the move command, otherwise you should use this method http://www.twcenter.net/forums/showthread.php?t=485535

  13. #13
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: PSF Garrison

    Labels do work with "move".

    Killersmurf's script should do the trick, although you might get a warning in the log if the label doesn't contain a number. e.g. Use psfgarrison1.

    However, it will only work the first time. The second time you'll get a "label already exists!" error and the army won't spawn. Either you'll need to use a new label each time or use a character name instead of a label (but then there are duplicate-name issues which this solves but might be overkill).

    EDIT: hold on a minute...
    If you use a general instead of a named character then label-reuse isn't a problem and there is no need to kill him afterward.

    Code:
    spawn_army
      faction {faction}
      character random_name, general, age 32, x {x1}, y {y1}, label psfgarrison1
      unit {garrison unit}	exp 0 armour 0 weapon_lvl 0
      unit {garrison unit}	exp 0 armour 0 weapon_lvl 0
      ... however many you want...
    end
    
    move psfgarrison1, {x2}, {y2}
    where x1,y1 = outside of the fort and x2,y2 is the fort
    Last edited by Withwnar; November 21, 2011 at 02:05 AM.

  14. #14

    Default Re: PSF Garrison

    Oh my god!

    Withwnar, you did it. It actually worked! The guy simply went into the PSF instead of being teleported ontop of it. You have no idea how thankful I am! :-)

    Also of course huge thanks for the killersmurf for the original idea!
    Last edited by Resurrection; November 21, 2011 at 07:45 AM.

    Mod Leader, Mapper & Bohemian Researcher

  15. #15
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: PSF Garrison

    I got the idea with the move command from Withwnar's bodyguard switcher for Third Age total war. I was thinking how he managed to get the character back in the settlement and the move command was the trick. Great it works for you now!

  16. #16
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: PSF Garrison

    No worries Resurrection , though I only tweaked killersmurf's for multi-use. People have been doing the spawn-outside-and-then-move-in thing long before me.

Posting Permissions

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