• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Repick and Random command problem

Status
Not open for further replies.
Level 9
Joined
Nov 3, 2010
Messages
448
Hey,
i make a map named War of Wrath
but i have a problem:
the repick command works but i made it so that you have a whisp and klick on the hero (the hero is on the ground) with rightklick and you have him and the whisp is down
the same with ar all whisps are away then.
The problem is when i type repick the hero is away and i will take a new but the whisp is away then
and when i type random you can take 2 heroes not only 1.. because whisp is there to take one

pls help me
when you want i send the map.. :goblin_cry:
 

sPy

sPy

Level 21
Joined
Apr 10, 2009
Messages
268
Try this:

  • Repick Command
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
      • Player - Player 7 (Green) types a chat message containing -repick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -repick as An exact match
    • Conditions
      • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 1
      • PlayerRepicked[(Player number of (Triggering player))] Equal to False
    • Actions
      • Game - Display to (All players) the text: (Playername[(Player number of (Triggering player))] + has repicked)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make (Unit-type of (Picked unit)) Available for training/construction by (Picked player)
      • Set PlayerRepicked[(Player number of (Triggering player))] = True
      • Set PlayerRepickPos = (Center of heldenspawn <gen>)
      • Unit - Create 1 Wähler for (Triggering player) at PlayerRepickPos facing Default building facing degrees
      • Selection - Select (Last created unit) for (Triggering player)
      • Camera - Pan camera for (Triggering player) to PlayerRepickPos over 0.20 seconds
      • Custom script: call RemoveLocation(udg_PlayerRepickPos)
 

sPy

sPy

Level 21
Joined
Apr 10, 2009
Messages
268
Your "Random" trigger problem solved

  • Random Command
    • Events
      • Player - Player 1 (Red) types a chat message containing -random as An exact match
      • Player - Player 2 (Blue) types a chat message containing -random as An exact match
      • Player - Player 3 (Teal) types a chat message containing -random as An exact match
      • Player - Player 4 (Purple) types a chat message containing -random as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -random as An exact match
      • Player - Player 6 (Orange) types a chat message containing -random as An exact match
    • Conditions
      • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
    • Actions
      • Set Random_Hero = (Random integer number between 1 and Random_Count)
      • Set RandomHeroSpawn = ((Triggering player) start location)
      • Unit - Create 1 Hero_Array[Random_Data[Random_Hero]] for (Triggering player) at RandomHeroSpawn facing Default building facing degrees
      • Game - Display to (All players) the text: (Playername[(Player number of (Triggering player))] + ( has randomed + (Name of (Last created unit))))
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Camera - Pan camera for (Triggering player) to RandomHeroSpawn over 0.20 seconds
      • Set RandomTempGroup = (Units owned by (Triggering player) of type Wähler)
      • Unit Group - Pick every unit in RandomTempGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Set Random_Data[Random_Hero] = Random_Count
      • Set Random_Count = (Random_Count - 1)
      • Custom script: call DestroyGroup(udg_RandomTempGroup)
      • Custom script: call RemoveLocation(udg_RandomHeroSpawn)
      • -------- RandomHeroSpawn = Point Variable --------
      • -------- RandomTempGroup = Unit Group Variable --------
 
Level 8
Joined
Oct 31, 2010
Messages
238
Can I do a system, and you just replace your system with mine?

EDIT: Here's the system.
It's similar to yours and it should work. Copy the triggers into your map.
Just create new variables and edit the hero array stuff.


  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Display to (All players) the text: You have 15 seconds...
      • Selection - Select Wisp 0000 <gen>
      • -------- ///////////////////////////Game Settings --------
      • Set RepickAvailable = 1
      • Set Hero_Array[1] = Alchemist
      • Set Hero_Array[2] = Naga Sea Witch
      • Set Hero_Array[3] = Tinker
      • Set Hero_Array[4] = Beastmaster
      • Set Random_Count = 4
      • For each (Integer A) from 1 to Random_Count, do (Actions)
        • Loop - Actions
          • Set Random_Data[(Integer A)] = (Integer A)
  • T15
    • Events
      • Time - Elapsed game time is 15.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Default mode.
      • Trigger - Turn off AllRandom <gen>
      • Trigger - Turn on Random <gen>
      • Trigger - Turn on Choose <gen>
  • T45
    • Events
      • Time - Elapsed game time is 45.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Game starts
      • Trigger - Turn off Repick <gen>
  • Choose (Initially OFF)
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Player_Chosed[(Player number of (Owner of (Triggering unit)))] Equal to False
      • (Owner of (Target unit of issued order)) Equal to Neutral Passive
    • Actions
      • Set Player_Chosed[(Player number of (Owner of (Triggering unit)))] = True
      • Set Random_Hero = (Random integer number between 1 and Random_Count)
      • Set Random_Data[Random_Hero] = Random_Count
      • Set Random_Count = (Random_Count - 1)
      • Unit - Remove (Triggering unit) from the game
      • Set TempPoint = (Center of Move <gen>)
      • Unit - Create 1 (Unit-type of (Target unit of issued order)) for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • Camera - Pan camera for (Owner of (Triggering unit)) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
  • Random (Initially OFF)
    • Events
      • Player - Player 1 (Red) types a chat message containing -random as An exact match
    • Conditions
      • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
    • Actions
      • Unit - Remove Wisp 0000 <gen> from the game
      • Set Random_Hero = (Random integer number between 1 and Random_Count)
      • Set TempPoint = (Center of Move <gen>)
      • Unit - Create 1 Hero_Array[Random_Data[Random_Hero]] for (Triggering player) at TempPoint facing Default building facing degrees
      • Camera - Pan camera for (Triggering player) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Selection - Select (Last created unit) for (Triggering player)
      • Set Random_Data[Random_Hero] = Random_Count
      • Set Random_Count = (Random_Count - 1)
  • Repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
    • Conditions
      • RepickCount[(Player number of (Triggering player))] Less than RepickAvailable
    • Actions
      • Set TempGroup = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Set TempGroup = (Units owned by (Triggering player))
          • Set RepickCount[(Player number of (Triggering player))] = (RepickCount[(Player number of (Triggering player))] + 1)
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Set TempPoint = (Center of Wisp <gen>)
          • Set PlayerRepicking[(Player number of (Owner of (Triggering unit)))] = True
          • Unit - Create 1 Wisp for (Triggering player) at TempPoint facing Default building facing degrees
          • Selection - Select (Last created unit) for (Triggering player)
          • Camera - Pan camera for (Triggering player) to TempPoint over 0.10 seconds
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Game - Display to (All players) the text: You can now repick.
        • Else - Actions
          • Game - Display to (All players) the text: You don't have a he...
      • Custom script: call DestroyGroup(udg_TempGroup)
  • RepickChoose
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Owner of (Target unit of issued order)) Equal to Neutral Passive
      • PlayerRepicking[(Player number of (Owner of (Triggering unit)))] Equal to True
    • Actions
      • Set PlayerRepicking[(Player number of (Owner of (Triggering unit)))] = False
      • Unit - Remove (Triggering unit) from the game
      • Set TempPoint = (Center of Move <gen>)
      • Unit - Create 1 (Unit-type of (Target unit of issued order)) for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • Camera - Pan camera for (Owner of (Triggering unit)) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
  • AllRandom
    • Events
      • Player - Player 1 (Red) types a chat message containing -ar as An exact match
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off T15 <gen>
      • Unit - Remove Wisp 0000 <gen> from the game
      • Game - Display to (All players) the text: All Random
      • Set TempPoint = (Center of Move <gen>)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Random_Hero = (Random integer number between 1 and Random_Count)
          • Set TempPoint = (Center of Move <gen>)
          • Unit - Create 1 Hero_Array[Random_Data[Random_Hero]] for (Player((Integer A))) at TempPoint facing Default building facing degrees
          • Camera - Pan camera for (Player((Integer A))) to TempPoint over 0.10 seconds
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Selection - Select (Last created unit) for (Player((Integer A)))
          • Set Random_Data[Random_Hero] = Random_Count
          • Set Random_Count = (Random_Count - 1)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyTrigger(gg_trg_AllRandom)
 

Attachments

  • Choose.w3x
    19 KB · Views: 49
Last edited:
Status
Not open for further replies.
Top