Jump to content

Need help with triggers finding characters


SieurEtalon

Recommended Posts

Posted

I'm making a mod, and part of it includes giving characters traits on birth depending on if their parent had a trait, but the trigger is not detecting the parents.

 

I modeled the event on the "born in the purple" event that gives the newborn the trait based on if the mother was in the correct location

 

Just to make sure that the event absolutely does occur, I moved it into the vanilla on_birth file

 

on_birth_child = {
	events = {
		seduction_birth_event.1 #My events
		seduction_birth_event.2
		seduction_birth_event.3
		seduction_birth_event.4
		seduction_birth_event.5
		middle_east_decisions.0012 #Saoshyant Descendants.
		major_decisions.0101 #Divine/Consecrated Blood Descendants.
		birth.8001 #Reincarnation
		birth.8011 #Born in the Purple
		trait_specific.0500 #To handle genetic traits not expressed until later in life
		debug.0010 # Disease data tracking
	} #etc ...

 

and the event file itself looks like this

 

seduction_birth_event.1 = {
	type = character_event
	hidden = yes
	
	trigger = {
		OR = {
			scope:mother = {
				has_trait = seduction_target
			}
			scope:real_father = {
				has_trait = seduction_target
			}
		}
	}

	immediate = { add_trait = seduction_child }
}

 

The traits themselves work fine if I use the console/decisions to add the traits, but they aren't getting added on birth. What am I missing?

 

 

Also just a side note but my localization is also not working, for some reason the description triggers aren't good.

 

l_english:
seduction_child:0 "Seduction Child"
seduction_child_desc:0 "This person is the child of the target of seduction"

 

seduction_child = {
	index = 55502
	ruler_designer_cost = 0

	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = seduction_child_desc
			}
			desc = seduction_child_desc
		}
	} 
}

 

Posted

I think... you don't set a scope.
[scope:real_father] is a method used after set as [save_scope_as = real_father].
It seems to work if you just change it to [root.real_father].
And [type = character_event] is not needed when [hidden = yes].

 

In the case of localization... it looks like a trait,
An additional 'trait_' is prepended to the trait name.
I think it work with [trait_seduction_child:0 "Seduction Child"].
And description works even if the [desc = { ... }] part is removed.

 

Sorry, I'm not good at English.

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...