Help with a system

Level 4
Joined
Apr 24, 2009
Messages
115
Hi everyone,

I am currently trying to make a trigger that will function like the one in werewolf transylvania. The basic steps are:

1. First night a random player is chosen.
2. That night and each night after the the hero for the chosen player is replaced with another hero.
3. The replacing hero is a different color and hostile to all players, but can be controlled by the chosen player.
4. Each morning the player loses the new hero and gets their old hero back.
5. The levels, items, etc of both heroes are saved when not in use.

Any help? Even an example of a similar system would be helpful.
 
Okay. First off, you will need to set the unit, or the builder, owned by the player into a unit variable with an array size of 1.
If the units are pre-placed, use this:
  • Set PlayerBuilder[(The player number of the owner; if the owner is Player 1, then make the value 1 here)] = Builder 100x+10y+z <gen>
If the units are created via triggers, use this action after the action that creates the unit:
  • Set PlayerBuilder[(Same as the first example)] = (Last created unit)
Okay, let's say that there are six players.
  • Set PlayerBuilder[1] = Builder 000 <gen>
  • Set PlayerBuilder[2] = Builder 001 <gen>
  • Set PlayerBuilder[3] = Builder 002 <gen>
  • Set PlayerBuilder[4] = Builder 003 <gen>
  • Set PlayerBuilder[5] = Builder 004 <gen>
  • Set PlayerBuilder[6] = Builder 005 <gen>
Make sure all of the players are enemies with the 7th player, or the player you will place the Werewolf in.

  • First Night
    • Events
      • Game - The in-game time of day becomes Greater than or equal to 18.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set PlayerBuilderInteger = (Random integer number between 1 and 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerBuilderInteger Equal to 1
        • Then - Actions
          • Set PlayerIsWerewolf[1] = True
          • Set PlayerBuilderWithWerewolf = PlayerBuilder[1]
          • Player - Make Player 1 (Red) treat Player 7 (Green) as an Ally with shared vision and full shared units
          • Set PlayerBuilderPoint = (Position of PlayerBuilderWithWerewolf)
          • Unit - Hide PlayerBuilderWithWerewolf
          • Unit - Create 1 Werewolf for Player 7 (Green) at PlayerBuilderPoint facing Default building facing degrees
          • Set Werewolf = (Last created unit)
          • Custom script: call RemoveLocation(udg_PlayerBuilderPoint)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerBuilderInteger Equal to 2
            • Then - Actions
              • Set PlayerIsWerewolf[2] = True
              • Set PlayerBuilderWithWerewolf = PlayerBuilder[2]
              • Player - Make Player 2 (Blue) treat Player 7 (Green) as an Ally with shared vision and full shared units
              • Set PlayerBuilderPoint = (Position of PlayerBuilderWithWerewolf)
              • Unit - Hide PlayerBuilderWithWerewolf
              • Unit - Create 1 Werewolf for Player 7 (Green) at PlayerBuilderPoint facing Default building facing degrees
              • Set Werewolf = (Last created unit)
              • Custom script: call RemoveLocation(udg_PlayerBuilderPoint)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerBuilderInteger Equal to 3
                • Then - Actions
                  • Set PlayerIsWerewolf[3] = True
                  • Set PlayerBuilderWithWerewolf = PlayerBuilder[3]
                  • Player - Make Player 3 (Teal) treat Player 7 (Green) as an Ally with shared vision and full shared units
                  • Set PlayerBuilderPoint = (Position of PlayerBuilderWithWerewolf)
                  • Unit - Hide PlayerBuilderWithWerewolf
                  • Unit - Create 1 Werewolf for Player 7 (Green) at PlayerBuilderPoint facing Default building facing degrees
                  • Set Werewolf = (Last created unit)
                  • Custom script: call RemoveLocation(udg_PlayerBuilderPoint)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • PlayerBuilderInteger Equal to 4
                    • Then - Actions
                      • Set PlayerIsWerewolf[4] = True
                      • Set PlayerBuilderWithWerewolf = PlayerBuilder[4]
                      • Player - Make Player 4 (Purple) treat Player 7 (Green) as an Ally with shared vision and full shared units
                      • Set PlayerBuilderPoint = (Position of PlayerBuilderWithWerewolf)
                      • Unit - Hide PlayerBuilderWithWerewolf
                      • Unit - Create 1 Werewolf for Player 7 (Green) at PlayerBuilderPoint facing Default building facing degrees
                      • Set Werewolf = (Last created unit)
                      • Custom script: call RemoveLocation(udg_PlayerBuilderPoint)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • PlayerBuilderInteger Equal to 5
                        • Then - Actions
                          • Set PlayerIsWerewolf[5] = True
                          • Set PlayerBuilderWithWerewolf = PlayerBuilder[5]
                          • Player - Make Player 5 (Yellow) treat Player 7 (Green) as an Ally with shared vision and full shared units
                          • Set PlayerBuilderPoint = (Position of PlayerBuilderWithWerewolf)
                          • Unit - Hide PlayerBuilderWithWerewolf
                          • Unit - Create 1 Werewolf for Player 7 (Green) at PlayerBuilderPoint facing Default building facing degrees
                          • Set Werewolf = (Last created unit)
                          • Custom script: call RemoveLocation(udg_PlayerBuilderPoint)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • PlayerBuilderInteger Equal to 6
                            • Then - Actions
                              • Set PlayerIsWerewolf[6] = True
                              • Set PlayerBuilderWithWerewolf = PlayerBuilder[6]
                              • Player - Make Player 6 (Orange) treat Player 7 (Green) as an Ally with shared vision and full shared units
                              • Set PlayerBuilderPoint = (Position of PlayerBuilderWithWerewolf)
                              • Unit - Hide PlayerBuilderWithWerewolf
                              • Unit - Create 1 Werewolf for Player 7 (Green) at PlayerBuilderPoint facing Default building facing degrees
                              • Set Werewolf = (Last created unit)
                              • Custom script: call RemoveLocation(udg_PlayerBuilderPoint)
                            • Else - Actions
  • Morning
    • Events
      • Game - The in-game time of day becomes Greater than or equal to 6.00
    • Conditions
      • (In-game time of day) Less than 18.00
    • Actions
      • Set WerewolfPoint = (Position of Werewolf)
      • Unit - Hide Werewolf
      • Unit - Unhide PlayerBuilderWithWerewolf
      • Unit - Move PlayerBuilderWithWerewolf to WerewolfPoint
I hope that helped.
 
Last edited:
Top