• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

ash001

friend&foe
10 Badges
Jun 5, 2009
796
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Rome Gold
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
So I've tried to code this simple event - the result would be a chance for all recently-born characters to gain 1 trait from a list of 7 traits.

I made a few comments following ###, these are doubts or impressions I have, let's see how this goes:

Code:
character_event = {
	id = 1992
	desc = "EVTDESC1992"
	picture = "GFX_evt_anewdawn"
	
	
	
min_age = 0      ### [B]I have defined these 7 traits as "source = birth" instead of "personality = yes" over at the traits.txt files[/B]
max_age = 8     ### [B]meaning there's 8 years for the event to trigger (I also I placed a weight of [500] on the yearly childhood pulse just to increase any chances of the event popping up)[/B]

	is_triggered_only = yes
	
	trigger = {
		NOT = {
			personality_traits = 8  ### [B]didn't need this trigger exactly, but decided to leave it for now...[/B]
		}
		NOT = {
			trait = traitone
		}
		NOT = {
			trait = traittwo
		}
		NOT = {
			trait = traitthree
		}
		NOT = {
			trait = traitfour
		}
		NOT = {
			trait = traitfive
		}
		NOT = {
			trait = traitsix
		}
		NOT = {
			trait = traitseven
		}
	}

	}
	mean_time_to_happen = {
		days = 1        ### [B]I could have set weeks or months or years, right? Went for the one most likely to reinforce the chances of the event firing for all the characters in-game... but I'm not sure how much strain it might put into the CPU [/B]
			
	}

	option = {
		name = "EVTOPTA1992" #### [B]Strangely, this is where something is going WRONG - I expected to be able to click an answer, instead, I get this:[/B]
[SPOILER] [ATTACH=CONFIG]47711[/ATTACH][/SPOILER]
		

		random_list = {
			14 = {
				FROM = { 
					add_trait = traitone
					hidden_tooltip = {
						ROOT = {
							character_event = {
							id = 92001  ### [B]so this event is supposed to fire just ot let us know what trait the character has gained[/B]
							}
						}
						
					}
				}
			}
			14 = { 
				FROM = {
					add_trait = traittwo
					hidden_tooltip = { 
						character_event = {	
							id = 92002
						}
					}
				}
			}
			14 = {
					FROM = {
					add_trait = traitthree
					hidden_tooltip = { 
						character_event = {	
							id = 92003
						}
					}
				}			
			}
				14 = {
					FROM = {
					add_trait = traitfour
					hidden_tooltip = { 
						character_event = {	
							id = 92004
						}
					}
				}			
			}
				14 = {
					FROM = {
					add_trait = traitfive
					hidden_tooltip = { 
						character_event = {	
							id = 92005
						}
					}
				}			
			}
				14 = {
					FROM = {
					add_trait = traitsix
					hidden_tooltip = { 
						character_event = {	
							id = 92006
						}
					}
				}			
			}
				14 = {
					FROM = {
					add_trait = traitseven
					hidden_tooltip = { 
						character_event = {	
							id = 92007
						}
					}
				}			
			}
		}
	}
}

So... I hope someone a bit more experienced might shed some light here...
and thanks for reading!
 

Attachments

  • modscreenshot.jpg
    modscreenshot.jpg
    233,5 KB · Views: 25
Have you done all those traits correctly without any errors ? Are they coded right, do they have icons etc. ? But now looking at it, i would say that you probably have some already used event id. Make it so big that you can be sure it's not used twice. Also you should keep count of all the events you script yourself.
 
You think I might have made a double entry, using the same event id twice? Because I made sure to pick ids that I couldn't find anywhere else (scanning all the csv. files to be sure).

The thing is - I did make it work once, and everything was working smooth, the event would pop up and if you hovered the mouse over the "answer", you'd get everything laid out - 14% chance for each of the seven traits. Soon after clicking, you'd get an event announcing which trait you got.
All nice and swell...
And, then, I might have deleted something by chance... And I can't, for the life of me, realize what it might have been. Just thought of showing the code here to see if anything would come up. And there's always plenty of things to discover.

By the way, if you check this out, the devs mention a very interesting way to name event ids now...

Has anyone tried it yet?
I guess, because it's so new to what people are used to, few have given it a try, and most of us (newbie modders) are in the dark as far as the potential this new system has.
 
That's why it's very good idea to keep either backup files or even the entire working history of your mod. Unfortunately i can't see anything myself at the moment. We have to wait someone to spot the flaw somewhere (and you try to remember what you changed ;) ).

I haven't modded CKII yet, i put my ideas on paper and finish my Rome interface first. Once done i'm going to try out the new naming scheme.