User talk:Xyloz

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

-

Modability suggestions page[edit]

Moderator edit: Suggestions for additional game content belong on the forums. The wiki is designed to report factual content and give example strategy guides. We don't host requests or suggestions. I've copied the content to your user page should you wish to work on it or post it on the forums. Thanks Dauth (talk) 17:48, 29 November 2017 (CET)

Question about variables[edit]

I'm working on updating my parser to recognise variables. Some of the syntax used isn't explained at Variables so, as you wrote that page, perhaps you could answer? In culture_religion_events.3 we have

	trigger = {
		...
		religion_group = new_variable:ruler_religion
		...
	}

How is new_variable:ruler_religion different from ruler_religion? Patch notes for 1.23 say 'Triggers and effects supporting "variable:" syntax now also support "new_variable:" syntax' but I have no idea what that means. Also later in the same event there is

	option = {
		...
		event_target:conversion_province = {
			change_religion = variable:From:new_ruler_religion
			...
		}
	}

The event is triggered by an event pulse so I don't see what From could be. Hairy Dude (talk) 23:24, 8 January 2018 (CET)

new_variable is essentially an inline export_to_variable. In your example, it is used to export the religion of the current scope's ruler (as an index).
The difference between this and ruler_religion = <scope> / <religion> is that religion_group = new_variable:ruler_religion checks if the current scope's religion group is in the same religion group as the ruler's religion, where as ruler_religion = <religion> checks if the ruler of the current scope has X religion.
variable:From:new_ruler_religion is simply scoping backing to the ROOT scope from within the event target scope.
The difference between variable and new_variable is that variable uses already defined variables filled with a value else where. Where as new_variable exports the specified export value in place, saving you from having to use export_to_variable, or allowing you to check export values within triggers (since export_to_variable is an effect).