+ Reply to Thread
Results 1 to 19 of 19

Thread: factor = 0 not actually 0...??

  1. #1

    factor = 0 not actually 0...??

    To keep track of how the AI choose in this event I set two variables in a previous event -- optionone & optiontwo -- and assigned them the value of zero. Since Denmark is catholic, the AI should never choose the first option. But when looking at the variables in the save file, optionone had the value 2 while optiontwo had the value 24. How come the AI choose the first option twice? I thought factor = 0 meant an option never triggered.

    Code:
    country_event = {
    
    	id = 828282
    
    	trigger = {
    		tag = DAN
    		has_global_flag = inittest
    	}
    
    	mean_time_to_happen = { days = 1 }
    
    	title = "titletest"
    	desc = "desctest"
    
    	option = {
    		name = "nametest"
    		ai_chance = {
    			factor = 90
    			days = 1
    			modifier = {
    				factor = 0
    				religion = catholic
    			}
    		}
    		change_variable = { which = optionone value = 1 }
    	}
    	option = {
    		name = "nametest"
    		ai_chance = {
    			factor = 10
    			days = 1
    			modifier = {
    				factor = 10
    				religion = catholic
    			}
    		}
    		change_variable = { which = optiontwo value = 1 }
    	}
    }

  2. #2
    well, IMO, option one should never be chosen by a catholic nation so this must either be a bug, or perhaps denmark recently became catholic and the data has not updated yet?

    this should be posted as a bug report IMO because I realy doubt its WAD.

  3. #3
    Quote Originally Posted by Darken View Post
    well, IMO, option one should never be chosen by a catholic nation so this must either be a bug, or perhaps denmark recently became catholic and the data has not updated yet?
    Well this occured in 1399 and Denmark is catholic from the start so that shouldn't be it.

    Quote Originally Posted by Darken View Post
    this should be posted as a bug report IMO because I realy doubt its WAD.
    It certainly looks like a bug, but before I report anything I'll do a few more test-runs. Just in case it depends on some mistake of mine (not that unlikely )

  4. #4
    Zero has never meant zero.

    Before ai=yes/no triggers, Magna Mundi used an event to set a specific flag to identify countries as player-controlled.
    Sometimes, the ai would choose that option.
    Mourning Magna Mundi

  5. #5
    Quote Originally Posted by Helius View Post
    Zero has never meant zero.

    Before ai=yes/no triggers, Magna Mundi used an event to set a specific flag to identify countries as player-controlled.
    Sometimes, the ai would choose that option.
    Ok, thanks for clarifying that (sort of... since I'm still confused as to why zero don't mean zero )

  6. #6
    What we tell the AI are merely suggestions. Zero is a very strong suggestion (24/26 in your case), but still just a suggestion.
    Mourning Magna Mundi

  7. #7
    Magrathean Engineer Haftetavenscrap's Avatar
    Crusader Kings IIEuropa Universalis 3Divine WindHearts of Iron IIIHeir to the Throne
    Europa Universalis III: In NomineEU3 Napoleon's AmbitionRome GoldSword of the StarsSword of the Stars II
    Victoria 2Rome: Vae VictisEuropa Universalis IV

    Join Date
    Nov 2007
    Location
    Alberta, Canada
    Posts
    5,200
    Blog Entries
    1
    Is having a modifier inside an ai_chance even legal syntax? It never worked for me.
    Try Haftetavenscrap's Realistic Map Generator!
    Explore, colonize and conquer a world you've never seen before!
    Much more intricate and realistic maps than Conquest of Paradise

    Get it HERE!

  8. #8
    Quote Originally Posted by Helius View Post
    What we tell the AI are merely suggestions. Zero is a very strong suggestion (24/26 in your case), but still just a suggestion.
    24/26 is not that different to 9/10... so perhaps factor=0 is not much different from factor=0.1?

  9. #9
    Quote Originally Posted by Helius View Post
    What we tell the AI are merely suggestions. Zero is a very strong suggestion (24/26 in your case), but still just a suggestion.
    I thought the suggestion approach applied to any other value -- that's logic -- but that zero actually ment zero. I'm no mathematical genius but I know what happens when multiplying with zero I just can't see the logic behind PI having it work this way.

  10. #10
    Quote Originally Posted by Haftetavenscrap View Post
    Is having a modifier inside an ai_chance even legal syntax? It never worked for me.
    It seems to work fine for me in the tests I've done. I can also tell you after a lot of testing that it doesn't work within random_list (which would have made my life so much easier...)

  11. #11
    Quote Originally Posted by TheLand View Post
    24/26 is not that different to 9/10... so perhaps factor=0 is not much different from factor=0.1?
    Maybe. If I find the time, I'll try that test event again for a longer run, once with modifier zero and once with 0.1 and see if I get any significant difference.

  12. #12
    Quote Originally Posted by Haftetavenscrap View Post
    Is having a modifier inside an ai_chance even legal syntax? It never worked for me.
    Absolutely! SRI and MMP events use it, all the time (and have been using it, since before NA).
    Mourning Magna Mundi

  13. #13
    I just looked at your code again. Here's something: You no longer need to use "days = 1"! Maybe leaving that out will make a difference?
    Mourning Magna Mundi

  14. #14
    Quote Originally Posted by Helius View Post
    I just looked at your code again. Here's something: You no longer need to use "days = 1"! Maybe leaving that out will make a difference?
    Haha... I have never used it before and didn't even know about its existence until dharper enlightened me the other day:

    Quote Originally Posted by dharper View Post
    I do it purely because Johan said to. I have no evidence that it matters, but that's how I learned it, so that's what I do.
    If days = 1 was used as a ground value which wasn't altered by the modifier, this actually makes sense. Will try without it and see if I get zero for one of the results.
    Last edited by pigglet82; 24-02-2009 at 02:11.

  15. #15
    Quote Originally Posted by pigglet82 View Post
    If days = 1 was used as a ground value which wasn't altered by the modifier, this actually makes sense. Will try without it and see if I get zero for one of the results.
    Nope, no change from what I can see. I did two test runs and the result was 2/168 and 3/201 (they were supposed to stop at a nice and even 100 but I guess my stop catch didn't really work as planned...)

  16. #16
    i know nothing about modding but heres my 2 cents. What if you put in -1?

  17. #17
    I'm going a little off topic here lads, but can anyone tell me why factors for MTTH events use decimal fractions as positive modifiers and anything at or above 1 for negative modifiers?

    Does it directly modify the MTTH? The chance that it will fire at the MTTH? Or something else?

    Thanks!
    Europa Universalis 3 Player
    -------------------------------------------------------------------------------------------

  18. #18
    General orwell's Avatar
    Hearts of Iron 2: ArmageddonCrusader Kings IIDeus VultEuropa Universalis 3Divine Wind
    For the MotherlandHearts of Iron IIIHeir to the ThroneEuropa Universalis III: In NomineEU3 Napoleon's Ambition
    Victoria: RevolutionsEuropa Universalis: RomeSemper FiSupreme Ruler 2020Victoria 2
    Victoria II: A House DividedRome: Vae VictisMount & Blade: WarbandEuropa Universalis IV

    Join Date
    Sep 2006
    Location
    Washington
    Posts
    2,224
    Blog Entries
    8
    50 months x factor .8 = 40
    50 months x factor 1.2 = 60
    Here's a useful beginner guide to events, and I'm working on a project that will theoretically make it even easier.
    Even an ignorant, paranoid, cowardly, ugly, corrupt, unsociable, aristocratic thug can conquer large parts of the world, kill thousands of people and be celebrated as the saviour of the Republic.

  19. #19
    Quote Originally Posted by orwell View Post
    50 months x factor .8 = 40
    50 months x factor 1.2 = 60
    Here's a useful beginner guide to events, and I'm working on a project that will theoretically make it even easier.
    Ah, I see, thats what I thought. A useful guide indeed, thanks man!
    Europa Universalis 3 Player
    -------------------------------------------------------------------------------------------

+ 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