Results 1 to 11 of 11

Thread: Giving money and settlements to other factions

  1. #1
    aka AggonyAdherbal Member Lord Adherbal's Avatar
    Join Date
    Oct 2004
    Location
    Belgium
    Posts
    1,014

    Default Giving money and settlements to other factions

    I found a way to give money and settlements to a faction other then the player's faction. This was thought to be impossible because add_money and capture_settlement only work for the local (player's) faction. Or atleast I think it is, if this is old news then excuse my ignorance.

    First you need to store the player's faction (the "local" faction). This is done with the following piece of code, at the beginning of the script:

    Code:
    	declare_counter player_faction
    
    	if I_LocalFaction romans_julii
    		set_counter player_faction 1
    	end_if
    	if I_LocalFaction romans_brutii
    		set_counter player_faction 2
    	end_if
    	if I_LocalFaction romans_scipii
    		set_counter player_faction 3
    	end_if
    	if I_LocalFaction romans_senate
    		set_counter player_faction 4
    	end_if
    	if I_LocalFaction macedon
    		set_counter player_faction 5
    	end_if
    	if I_LocalFaction egypt
    		set_counter player_faction 6
    	end_if
    	if I_LocalFaction seleucid
    		set_counter player_faction 7
    	end_if
    	if I_LocalFaction carthage
    		set_counter player_faction 8
    	end_if
    	if I_LocalFaction parthia
    		set_counter player_faction 9
    	end_if
    	if I_LocalFaction pontus
    		set_counter player_faction 10
    	end_if
    	if I_LocalFaction gauls
    		set_counter player_faction 11
    	end_if
    	if I_LocalFaction germans
    		set_counter player_faction 12
    	end_if
    	if I_LocalFaction britons
    		set_counter player_faction 13
    	end_if
    	if I_LocalFaction armenia
    		set_counter player_faction 14
    	end_if
    	if I_LocalFaction dacia
    		set_counter player_faction 15
    	end_if
    	if I_LocalFaction greek_cities
    		set_counter player_faction 16
    	end_if
    	if I_LocalFaction numidia
    		set_counter player_faction 17
    	end_if
    	if I_LocalFaction scythia
    		set_counter player_faction 18
    	end_if
    	if I_LocalFaction spain
    		set_counter player_faction 19
    	end_if
    	if I_LocalFaction thrace
    		set_counter player_faction 20
    	end_if
    Now to give money/settlements to another faction. The console commands "add_money" and "capture_settlement" only work for the "local" faction, but there is a way around this problem: This is done with the "control" command. Control changes the faction the player controls, thereby changing the "local" faction. An example:

    Code:
    	console_command control britons
    	console_command capture_settlement Paris
    	console_command add_money 2000
    First the local faction is set to the britons, then the settlement "Paris" is given to the local faction (the britons), then money is added to the local faction (yep, still the britons). This all happens within the same turn, so the player won't notice anything (apart from a small delay while the current garrison moves our of the settlement).

    Now all that remains is giving control back to the original player's faction, with the following piece of code:

    Code:
    	if I_CompareCounter player_faction = 1
    		console_command control romans_julii
    	end_if
    	if I_CompareCounter player_faction = 2
    		console_command control romans_brutii
    	end_if
    	if I_CompareCounter player_faction = 3
    		console_command control romans_scipii
    	end_if
    	if I_CompareCounter player_faction = 4
    		console_command control romans_senate
    	end_if
    	if I_CompareCounter player_faction = 5
    		console_command control macedon
    	end_if
    	if I_CompareCounter player_faction = 6
    		console_command control egypt
    	end_if
    	if I_CompareCounter player_faction = 7
    		console_command control seleucid
    	end_if
    	if I_CompareCounter player_faction = 8
    		console_command control carthage
    	end_if
    	if I_CompareCounter player_faction = 9
    		console_command control parthia
    	end_if
    	if I_CompareCounter player_faction = 10
    		console_command control pontus
    	end_if
    	if I_CompareCounter player_faction = 11
    		console_command control gauls
    	end_if
    	if I_CompareCounter player_faction = 12
    		console_command control germans
    	end_if
    	if I_CompareCounter player_faction = 13
    		console_command control britons
    	end_if
    	if I_CompareCounter player_faction = 14
    		console_command control armenia
    	end_if
    	if I_CompareCounter player_faction = 15
    		console_command control dacia
    	end_if
    	if I_CompareCounter player_faction = 16
    		console_command control greek_cities
    	end_if
    	if I_CompareCounter player_faction = 17
    		console_command control numidia
    	end_if
    	if I_CompareCounter player_faction = 18
    		console_command control scythia
    	end_if
    	if I_CompareCounter player_faction = 19
    		console_command control spain
    	end_if
    	if I_CompareCounter player_faction = 20
    		console_command control thrace
    	end_if
    Note that I haven't done a great lot of tests on this yet, so there might be drawbacks that I haven't discovered yet (switching control *might* mess up the AI). But if there aren't any problems then it should be usefull to help the AI by giving them extra money and for special events that change settlement control. There might be other commands that are limited to the "local" faction that work with this too, I haven't really checked them all.
    Last edited by Lord Adherbal; 09-01-2005 at 12:52.
    Member of The Lordz Games Studio:
    A new game development studio focusing on historical RTS games of the sword & musket era
    http://www.thelordzgamesstudio.com

    Member of The Lordz Modding Collective:
    Creators of Napoleonic Total War I & II
    http://www.thelordz.co.uk

  2. #2
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Giving money and settlements to other factions

    Great idea Adherbal!

    I think in the first code there is one mistake: if I'm not wrong the last scythia should be thrace.

    Question: is this part of a show_me script or a background script?

    It is very interesting as it could be part of a "senate" system for all the factions, both player and AI controlled.
    Perhaps some partial objectives could be stated at the beginning of the campaign and this would be the method to reward when each objective has been reached.

    P.S.: if this is not the place for discussion, please move this post. Thanks.

  3. #3
    aka AggonyAdherbal Member Lord Adherbal's Avatar
    Join Date
    Oct 2004
    Location
    Belgium
    Posts
    1,014

    Default Re: Giving money and settlements to other factions

    I've fixed it, thanks.

    It should work for both background and show_me scripts (I don't think there's a real difference between the two).
    Member of The Lordz Games Studio:
    A new game development studio focusing on historical RTS games of the sword & musket era
    http://www.thelordzgamesstudio.com

    Member of The Lordz Modding Collective:
    Creators of Napoleonic Total War I & II
    http://www.thelordz.co.uk

  4. #4

    Default Re: Giving money and settlements to other factions

    If I am right this is the core version of your idea:
    console_command add_money 40000
    console_command control Numidia
    console_command add_money -39000
    console_command control Egypt

  5. #5

    Default Re: Giving money and settlements to other factions


    Once again.

    console_command add_money 4000
    console_command control Numidia
    console_command add_money -4000
    console_command control Egypt

    I tried but nothing happened. I am with Egypt.

  6. #6
    aka AggonyAdherbal Member Lord Adherbal's Avatar
    Join Date
    Oct 2004
    Location
    Belgium
    Posts
    1,014

    Default Re: Giving money and settlements to other factions

    that should add 4000 denarii to egypt, then remove 4000 denarii for Numidia.

    however thanks to Jerome we now know you can also use:

    console_command add_money Numidia, 4000
    Member of The Lordz Games Studio:
    A new game development studio focusing on historical RTS games of the sword & musket era
    http://www.thelordzgamesstudio.com

    Member of The Lordz Modding Collective:
    Creators of Napoleonic Total War I & II
    http://www.thelordz.co.uk

  7. #7

    Default Re: Giving money and settlements to other factions

    Quote Originally Posted by [cF]Adherbal
    that should add 4000 denarii to egypt, then remove 4000 denarii for Numidia.

    however thanks to Jerome we now know you can also use:

    console_command add_money Numidia, 4000
    Thanks the problem solved already

  8. #8
    Member Member brymht's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, Georgia, US.
    Posts
    292

    Default Re: Giving money and settlements to other factions

    hmm. Very interesting. Going to give this sucker a shot.

  9. #9

    Default Re: Giving money and settlements to other factions

    There are a couple nasty (and fairly well-known) side-effects with using "console_command control":
    1. The AI doesn't work correctly for the faction you switch to/from.
    2. All player settlements revert to auto-managed when you switch back to the original faction.
    RTR VII Developer

  10. #10
    Member Member brymht's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, Georgia, US.
    Posts
    292

    Default Re: Giving money and settlements to other factions

    What happens with the AI? Is it a global AI issue, for the entire faction, all factions, or what?

  11. #11

    Default Re: Giving money and settlements to other factions

    I think it's an issue with AI not managing settlements properly for the faction that used to be controled by the player. Maybe other things, too - not 100% sure. JeromeGrasdyke (CA lead dev) posted a warning about using this command (quite) some time back.
    RTR VII Developer

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