- Joined
- Oct 12, 2016
- Messages
- 769
One use of dynamic instancing is for custom alliance systems.
For example:
Let's say there's a trigger that uses events like string commands or abilities to set alliances between different players. This in turn pops up a dialogue box with options: share vision, declare war, go neutral, ally.
If player 1 wants to ally with player 2, they click "ally" which brings up another menu with a list of active players. Player 1 will then select player 2.
This could then assign a boolean value to an indexed array like this:
Alliance(player# triggering player(player# selected player)) = True
Afterwards, this would fire off an if/then/else check to see if the opposing player's alliance value matches:
If:
Alliance(player# triggering player(player# selected player)) = True
Alliance(player# selected player(player# triggering player)) = True
Then:
Set alliance status to allied for players 1 and 2
Else:
-
The same thing can be done for vision sharing in the example dialogue menu.
Of course I explained this in GUI, but it was still relevant to this mission post since it does not matter in what order the variables are accessed.
For example:
Let's say there's a trigger that uses events like string commands or abilities to set alliances between different players. This in turn pops up a dialogue box with options: share vision, declare war, go neutral, ally.
If player 1 wants to ally with player 2, they click "ally" which brings up another menu with a list of active players. Player 1 will then select player 2.
This could then assign a boolean value to an indexed array like this:
Alliance(player# triggering player(player# selected player)) = True
Afterwards, this would fire off an if/then/else check to see if the opposing player's alliance value matches:
If:
Alliance(player# triggering player(player# selected player)) = True
Alliance(player# selected player(player# triggering player)) = True
Then:
Set alliance status to allied for players 1 and 2
Else:
-
The same thing can be done for vision sharing in the example dialogue menu.
Of course I explained this in GUI, but it was still relevant to this mission post since it does not matter in what order the variables are accessed.