+ Reply to Thread
Results 1 to 14 of 14

Thread: Does unit_in_siege work?

  1. #1

    Does unit_in_siege work?

    I've been having trouble using unit_in_siege as a trigger for a country_event. I'm not sure if I'm not using it correctly, or if it just doesn't work. Do I need to use scopes on it or something?

    Code:
    country_event = {
    	id = 673230
    	trigger = {
    		unit_in_siege = yes
    	}
    	mean_time_to_happen = { months = 2 }
    	title = "EVTNAME673230"
    	desc = "EVTDESC673230"
    	option = {
    		name = "EVTOPTA673230"
    		owner = {
    			any_country = { limit = { has_country_flag = protect_player }
    				random_owned = {
    					limit = { owner = { has_country_flag = protect_player } }
    					owner = { change_variable = { which = protect_playervalue value = 2 } }
    				}
    			}
    		}
    	}
    }

  2. #2
    Quote Originally Posted by Ccide View Post
    I've been having trouble using unit_in_siege as a trigger for a country_event. I'm not sure if I'm not using it correctly, or if it just doesn't work. Do I need to use scopes on it or something?

    Code:
    country_event = {
    	id = 673230
    	trigger = {
    		unit_in_siege = yes
    	}
    	mean_time_to_happen = { months = 2 }
    	title = "EVTNAME673230"
    	desc = "EVTDESC673230"
    	option = {
    		name = "EVTOPTA673230"
    		owner = {
    			any_country = { limit = { has_country_flag = protect_player }
    				random_owned = {
    					limit = { owner = { has_country_flag = protect_player } }
    -->					owner = { change_variable = { which = protect_player*value value = 2 } }
    				}
    			}
    		}
    	}
    }
    You're missing a white space at the marked point.

    Oh, never mind - I see that that is the name of your variable.

    Anyway, I've seen it work, I think. What happens when you trigger this in the console?
    Mourning Magna Mundi

  3. #3
    Quote Originally Posted by Helius View Post
    You're missing a white space at the marked point.
    No I think Ccide uses "protect_playervalue" as variable name deliberatly. But he is also using owner = {} in country scope and that's wrong.
    Last edited by Ignatich; 09-07-2009 at 11:32.

  4. #4
    Quote Originally Posted by Helius View Post
    What happens when you trigger this in the console?
    When I trigger the event in the console, I get a little red star next to the unit_in_siege, even though I have units besieging a province (I'm playing Byz, and I have units besieging Lybia: 3 regiments of footsoldiers). And I do get the effect to change the variable in other events, so I doubt that the problem is with the effect.

  5. #5
    It could be that the trigger's scope is province, not country. Assuming that this is the case, your event is in fact contradictory: it's a country event, yet checks for a trigger whose scope is province-based and uses a province-scope event effect(owner = {).
    You might want to change "country_event" to "province_event," though the event may still not work if something else is wrong with the code.

    Speaking of "units_in_province," I wonder what the difference is between this trigger and the "has_siege" modifier. Sounds the same to me, but maybe they're different since these are separate triggers....
    Member of the Magna Mundi team once upon a time, in charge of Asia

  6. #6
    Quote Originally Posted by Ese Khan View Post
    Speaking of "units_in_province," I wonder what the difference is between this trigger and the "has_siege" modifier. Sounds the same to me, but maybe they're different since these are separate triggers....
    Well, as far as I know, units_in_province has nothing to do with sieges, so you can use it to find out for instance if you have troops in one of your own provinces.

  7. #7
    My bad, I meant "unit_in_siege," which you brought up.
    Member of the Magna Mundi team once upon a time, in charge of Asia

  8. #8
    Quote Originally Posted by Ese Khan View Post
    My bad, I meant "unit_in_siege," which you brought up.
    Ah, then my bad, wasn't trying to be a stickler and point out the obvious.

    Ccide: did the event work when you took out the owner scope as Ignatich suggested?

  9. #9
    Quote Originally Posted by pigglet82 View Post

    Ccide: did the event work when you took out the owner scope as Ignatich suggested?
    Here's what I did. I cleared out the effects of the event, leaving only this.

    Code:
    country_event = {
    	id = 673230
    	trigger = {
    		unit_in_siege = yes
    	}
    	mean_time_to_happen = { months = 2 }
    	title = "EVTNAME673230"
    	desc = "EVTDESC673230"
    	option = {
    		name = "EVTOPTA673230"
    	}
    }

    I figured I'd do my normal diagonsis procedure, soooo. First I cleared out everything but the trigger, that way I would know if the effect was the problem. Still getting a red star when I console fire the event. I tried to fire it for multiple countries (i.e. while playing Byz, I fired it for TUR and MAM), but I still got a red star next to Have Units in Siege.

    Step 2, per Ese Khan's suggestion, I made the whole event a province_event (see below). Tried it for my country, nothing. Tried console firing it for Libya (where I had a siege going against the Mamluks) and finally I got the green star! Strange thing is, on the list of triggers on the http://forum.paradoxplaza.com/forum/...d.php?t=361849 unit_in_siege was listed under country scope.

    Code:
    province_event = {
    	id = 673230
    	trigger = {
    		unit_in_siege = yes
    	}
    	mean_time_to_happen = { months = 2 }
    	title = "EVTNAME673230"
    	desc = "EVTDESC673230"
    	option = {
    		name = "EVTOPTA673230"
    	}
    }
    Thank you for all the suggestions.

  10. #10
    I'm confused about the difference between the trigger unit_in_siege and has_siege. I thought that unit_in_siege would fire for a state that had units in a siege, regardless of the status of the province being besieged. So unit_in_siege would be true if I was besieging my own province (held by rebels or a different state), a rebel held province of an ally, or an enemy's province. However, it does not seem to work this way. It only seems to be true for provinces that have units besieging them, which seems no different than has_siege. Is this true, or am I missunderstanding?

  11. #11
    Now that we know that unit_in_siege has province scope, there is no difference between it and has_siege.
    Mourning Magna Mundi

  12. #12
    Quote Originally Posted by Helius View Post
    Now that we know that unit_in_siege has province scope, there is no difference between it and has_siege.
    Can we have a nice funeral for unit_in_siege since its now redundent and its job has been outsourced to has_siege. Maybe with some nice flowers, and then give it a nice resting place in some old, out-of-date version of the game? qq. WE'LL MISS YOU UNIT_IN_SIEGE!!! rest in peace.

  13. #13
    Field Marshal jdrou's Avatar
    200k clubHoI AnthologyArsenal of DemocracyHearts of Iron 2: ArmageddonCrusader Kings II
    Darkest HourDeus VultEast India CompanyEuropa Universalis: ChroniclesEU3 Complete
    Divine WindFor The GloryFor the MotherlandHearts of Iron IIIHOI3: Their Finest Hour
    Heir to the ThroneEuropa Universalis III: In NomineEU3 Napoleon's AmbitionVictoria: RevolutionsRome Gold
    Semper FiSupreme Ruler 2020 GoldVictoria 2Victoria II: A House DividedVictoria II: Heart of Darkness
    EU3 Collectors Edition500k clubEuropa Universalis IV: Pre-orderEUIV: Wealth of NationsEUIV: Conquest of Paradise
    EUIV: Res Publica

    Join Date
    Jun 2002
    Location
    Michigan, USA
    Posts
    22,660
    Did anyone ever use unit_in_siege in a mod? It doesn't seem to be used in any vanilla events. They added province-scope has_siege in patch 1.2 and the original docs Johan posted showed unit_in_siege to be country-scope so apparently it should be; this could probably be reported as a bug.
    "The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all." --H. L. Mencken

    Playing EU4

    Download the Fix-it-Yourself Pack for HoI 1.06c (updated 11/14/05)
    Download the Unofficial fixpack for EU3 4.1b 4/29 beta or final 11/24 patch (updated 12/25/10)
    Download the text fixpack for EU3 Divine Wind (updated 2/11/11)

  14. #14
    Quote Originally Posted by jdrou View Post
    Did anyone ever use unit_in_siege in a mod?
    I've only seen it used in one event in MMP1.404: SRI_Jewish_Events, event 112002. Granted, I've never had the event fire for me, so I don't know how it works.

+ Reply to Thread

Posting Permissions

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