Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Substitutions to be defined from Phrases #6981

Open
LazerLit opened this issue Jun 28, 2022 · 2 comments
Open

Allow Substitutions to be defined from Phrases #6981

LazerLit opened this issue Jun 28, 2022 · 2 comments
Labels
enhancement A suggestion for new content or functionality that requires code changes

Comments

@LazerLit
Copy link
Contributor

Problem Description

I want to be able to define several global substitutions which can be dynamically altered by events, but where the specifics of the new entry may not be known. Specifically, I am writing missions to simulate government elections in the Republic and need to define who is the major governing bloc, who is the opposition, the name of the Prime Minister, and the name of the Opposition Leader, as all of these things can be referred to in Missions, News items and Conversations.

However, each of these will change over time, and particularly by player involvement, and so when the Opposition win an election, for example, I would need to be able to switch the Prime Minister and Opposition Leader, and the Incumbent and Opposition.

Furthermore, if a leader is removed for whatever reason (retirement, impeachment, vote of no confidence, assassination, etc.), I need to be able to choose a new name from a list (which would be accomplished by creating a Phrase using either male or female first names, and the family names mentioned in my other Feature Request (6968)).

Related Issue Links

Not specifically for the same issue, but Issue 6968 is related because both are for the same project.

Desired Solution

Currently a global substitution can be changed if you can say specifically what you are changing it to. For example, if you have a substitution, set up to give you "John Smith", you can then use an event to change it to "Tom Jones". I want to be able to;

  • use the current value of another previously defined substitution, (when the opposition wins an election), and also;

  • use the result of a phrase which makes up a name from lists of first and family names (when a new leader takes over from an outgoing one)

Alternative Approaches

I have tried using phrases instead of substitutions but, doing it this way would mean that the name of the Prime Minister would be selected randomly every time it is displayed.

Additional Context

No response

@Amazinite Amazinite added the enhancement A suggestion for new content or functionality that requires code changes label Jun 28, 2022
@Amazinite
Copy link
Collaborator

Would the following be effectively what you're looking for, just with more steps?

event "election: majority orange"
	substitution
		"<majority>" "orange party"
		"<opposition>" "purple party"

event "election: majority purple"
	substitution
		"<majority>" "purple party"
		"<opposition>" "orange party"

event "election: steve vs eli"
	substitution
		"<majority leader>" "Steve"
		"<opposition leader>" "Eli"

event "election: david vs goliath"
	substitution
		"<majority leader>" "Goliath"
		"<opposition leader>" "David"

mission "Election"
	...
	on offer
		conversation
			`You see election posters in the spaceport.`
			branch orange
				random < 50
			action
				event "election: majority purple"
			# I don't think the substitutions will be filled immediately, so you might need
			# to hard code them in the first time, then in later missions you could use
			# the substitutions.
			`	The orange party is running to take power from the purple party.`
				goto next
			label orange
			action
				event "election: majority orange"
			`	The purple party is running to take power from the orange party.`
			label next
			branch david
				random < 50
			action
				event "election: steve vs eli"
			`	The parties are led by Steve and Eli.`
				goto end
			label david
			action
				event "election: david vs goliath"
			`	The parties are led by Goliath and David.`
			label end
			`	Cool story, I guess.`
				decline
	...

You could then use more branches and events to have more possibilities. Given the overhead required, you'd likely not have as many possibilities as if you could make use of phrases, but this at least allows you to have something while substitutions can't be randomized.

@LazerLit
Copy link
Contributor Author

I had been hoping to avoid having to define every possibility because the idea is that events and missions can effect election outcomes, and we have no way of knowing exactly when a player will get around to doing the missions. I mean, somebody could potentially spend thirty years just trading or fighting pirates before they get to the mission chains.

Having said that, though, that would probably be unusual, and having something in place for now would allow the Republic mission chain to move on. Thanks for the suggestion. I'll probably use it for now.

I'd appreciate if you could leave the issue open, though, as I imagine having this capability could be useful for others too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A suggestion for new content or functionality that requires code changes
Projects
None yet
Development

No branches or pull requests

2 participants