Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Using a variable to change variables linked to that variable in sugarcube

$
0
0
For my game I have 64 areas, each area has three slots for a commander with their own respective troop numbers, morale and special ability.

I want to make it possible to remove or assign commanders to each area, as well as assign or remove troops or influence their individual morales through a general management screen.

What I currently did (which is most likely extremely messy) is assign each area with a number and then have each area have it's own variables for each commander (area1commander1, area1commander 2, area2commander 1 etc.)

The only way I can think of to change this would be by using a lot of if statements in the management screen.
Example:
<<if $area is 1>><<set $area1commander1 to $chosencommander1>><</if>>

This will be extremely inefficient and messy though. Is there a better way to do this?
Thanks in advance

Viewing all articles
Browse latest Browse all 1844

Trending Articles