Results 1 to 6 of 6

Thread: Checking the ownership of a Settlement and setting kings purse

Hybrid View

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

    Default Checking the ownership of a Settlement and setting kings purse

    I'm trying to check the ownership of a settlement (London), and if it doesn't belong to the original owner (England), remove the kings purse. Can anyone see why this isn't working?

    Code:
    ;;CHECK TO SEE IF THE PLAYER HAS LOST HIS CAPITAL (LONDON)
    monitor_event SettlementTurnStart SettlementName London
               and FactionIsLocal
    	if I_SettlementOwner London != england
    		set_kings_purse england 0
    	end_if
    end_monitor

    Cheers
    Last edited by AlphaDelta; September 07, 2008 at 03:15 AM.
    "I don't want to sit around Windsor because ermm .. I just generally don't like England that much" - Prince Harry, 3rd in Line for the British Thrown



    For King or Country - The English civil wars.

  2. #2

    Default Re: Checking the ownership of a Settlement and setting kings purse

    Well I found my answer. set_kings_purse is Kingdoms only.

    It's listed in M2TW Ultimate Docudemons 4.0 as being a command for Med2 1.2, I hadn't noticed that at the bottom of the commands section it has a heading "kingdoms commands".

    Cheers
    Last edited by AlphaDelta; September 07, 2008 at 04:20 AM.
    "I don't want to sit around Windsor because ermm .. I just generally don't like England that much" - Prince Harry, 3rd in Line for the British Thrown



    For King or Country - The English civil wars.

  3. #3

    Default Re: Checking the ownership of a Settlement and setting kings purse

    Are you sure it's NOT working?

    When you load up the campaign to test it are you playing as england and letting another faction take London, or are you loading up as say France and taking england...

    whenever i test my scripts i always test as england and add this line to the script I'm testing

    add_money England, 10000

    That way if i receive the money, i know the script fired true. i would suggest adding that line inside the 'if' statement.

    you also have the condition 'FactionIsLocal' which means it will only fire true if London belongs to the player, so you can not play as england to check if it works.

    Try running the script without 'FactionIsLocal' and see if it works (or try 'not FactionIsLocal if you want to play as england and give it away). if it does then you know it will work with FactionIsLocal.

    but add that line that gives England money (or whatever faction your testing with) to every script you test.

    hope that helps, i realize my sentences seem to be all over the place in this post and i have no idea why
    ...longbows, in skilled hands, could reach further than trebuchets...

  4. #4

    Default Re: Checking the ownership of a Settlement and setting kings purse

    Hi,

    This is the new code:
    Code:
    ;;CHECK TO SEE IF THE PLAYER HAS LOST HIS CAPITAL (LONDON)
    monitor_event FactionTurnStart FactionType england
            and FactionIsLocal
    	if I_SettlementOwner London != england
    		console_command add_money england, -2500
    	end_if
    end_monitor
    I'm testing it by letting London go rebel. It's working and is having the basic desired effect, but yes I am sure set_kings_purse doesn't work in MED2, only kingdoms.

    If I change:

    console command add_money england, -2500

    to

    set_kings_purse england 0

    It breaks the script and nothing runs at all. Typing set_kings_purse england 0 in the console returns an error.

    Cheers
    "I don't want to sit around Windsor because ermm .. I just generally don't like England that much" - Prince Harry, 3rd in Line for the British Thrown



    For King or Country - The English civil wars.

  5. #5

    Default Re: Checking the ownership of a Settlement and setting kings purse

    I'm confused: are you using Kingdoms or not?

    If you aren't using Kingdoms, then you are right, you should use an add_money command instead.

    If you are using Kingdoms read this:

    Identifier: set_kings_purse
    Parameters: faction, amount
    Description: Changes the money granted by the king's purse.
    Sample use: set_kings_purse England 40000
    Class: SET_KINGS_PURSE
    Implemented: Yes
    Author: Mark
    I don't know if this is causing the error, but noticed how they captialized "England" while in your script England is in lowercase.

    BTW, set_kings_purse isn't a console command, so it wont work in the console.
    Last edited by Azim; September 07, 2008 at 08:14 AM.

    Dominion of the Sword, a Medieval II: Total War Supermod
    Under the patronage of Archaon. Proud member of the House of Siblesz
    My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!

  6. #6
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Checking the ownership of a Settlement and setting kings purse

    You are correct, that is a Kingdoms only command.

    You should also note that when you check the status of London, you are not checking the status of his Capital, only the status of London because a faction can change its capital.

    There is no condition to check the capital, but there is an event that checks when they change capitals. You cannot directly detect which settlement is the capital, but you can do it in a round about way. I never found it worthwhile, but I did figure out how to do it a while back.

    You have to have a monitor for each region, and a character has to be close.

    Assign a number to each settlement, I used the RegionID that you can get from using show_cursorstat.

    monitor_event CharacterTurnEndedInSettlement SettlementName xxx
    and DistanceCapital == 0
    and FactionType england
    set_event_counter england_capital xx (RegionID)


    Then build a monitor for each settlement to do stuff with it.

    monitor_event SettlementTurnEnd SettlementName xxx
    and FactionType england
    and I_EventCounter england_capital xx

    do some stuff.

Posting Permissions

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