• 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)
I'm making a few tests but still haven't been able to add traits to the game.

So if any experienced modders want to check what I did, you might be able to spot something I'm missing, overlooking or have totally borked.
Ok, so these are the steps taken:

1. added "traitone" and "traittwo" in the common/traits.txt file.
2. added an event in the events/childhood_personality_events_traits.txt, which (hopefully) would fire for every child between 1 and 5 years old.

Code:
character_event = {
	id = 1992
	desc = "EVTDESC1992"
	picture = "GFX_evt_child_play"
	
	is_triggered_only = yes
	
	min_age = 1
	max_age = 5

		mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA1992"
		random_list = {
			
			50 = {
				add_trait = traitone
					
			}
			50 = {
				add_trait = traittwo
			
			
		}
	}

3. went to the localization/text1 and included descriptions for EVTDESC1992, EVTOPTA1992, traitone and traittwo.

4. duplicated two of the DDS files in the gfx/traits, recolored them and renamed them to traitone.dds and traittwo.dds


When the game is running, nothing happens, no crashes but no event either.


What I would like is to have this obligatory event firing up for every child between 2-5 and giving them one trait (to be randomly picked among 12 specific traits - for now, I'm leaving the option between 2).
Any advice is appreciated, I must be tripping on something fairly basic :blush: - but I'm hopeful once I get the gist, this experiment might turn into something interesting...
Thanks!
 
Last edited:
You made a triggered event, but didn't make anything to trigger it.

Most traits are given by events triggered in common/on_actions.txt; particularly, take a look at the on_yearly_childhood_pulse section governing the triggering of events to give traits to children.
 
:eek:hmy:
that was a quick reply, thanks, CyberSpyder.
And yes, of course, you're right.
One question, though, what would happen if erasing the "is triggered only=yes" from the code?

And now that I took a look at the file mentioned,
Code:
# For characters 2 to 16 years old
on_yearly_childhood_pulse = {
	random_events = {
		# Childhood Personality Events
		
		#Age 6-16, aiming to get at least 4 traits before adult.
		100 = 1500
		100 = 1510
		100 = 1520

The number 100 represents a higher chance of getting those events? So if you'd like to lower the chance of these events happening, you'd just lower the number?

And to trigger it, I would only have to add "100 = 1992" in there for instance?

Again, much obliged for the assistance!
 
Last edited:
If you just removed the line making it triggered only, it would fire every day for everyone between ages 1 and 5.

The 100s represent a weighting factor, influencing which event gets sent to the child, yes. These weights can be influenced by modifiers to the MTTH field, which is otherwise unused for triggered events. Adding "100 = 1992" would give your event a chance of being triggered every year for children between ages 2 and 16, but it wouldn't guarantee it.
 
Got it!
That's great, makes a lot of sense.

So I ran a few tests and - by removing the "is triggered only=yes" - lots of people get traitone but not all. What's even more intriguing -- no one got the traittwo! So I thought I was leaving it to luck (50/50 chance) but it doesn't seem to happen that way... At least, not with the code I've written.


Any guesses? Or glaring mistakes I'm making?
 
If you want the trait to actually show up in game as an icon you have to edit this file:

.../interface/traits.gfx (open with powerpoint...i know, weird right?)

Follow the existing format and just add it to the end. This identifies which graphic goes to which trait (and how the game should display it).