• 🏆 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 question and Duel system

Status
Not open for further replies.
Level 3
Joined
Jun 13, 2010
Messages
43
Harlo guys. Uhmp currently i am having a problem in understanding how the trigger works such as the value commands . Anyway i will get to the topic since i don't know how to exlpain well hahas

well acutally i am making a hero map such as
Using a Unit to posses a hero ,However i came to realise that it won't work since i used a duel trigger for Players whom Used Selection Hero such as Hero tavern to trigger the Event for the duel to work
Set DuelGroup[(Integer A)] = (Units owned by (Picked player) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is alive) Equal to True)))

Is there any way i change the (Units owned by (Picked player) to other commands? so that a creep possesed hero can make the duel be trigged?

I got that duel template from somewhere else and i been trying to change its vaule to work. but i am not really good in this . so its came out without result instead i have ask someone to guide me.

Since the hero selection aren't Choosed from Hero Tavern. Instead from a creep which possess a hero. That's why it didn't trigged as PICKED player value for the duel to warp the hero to the following selective duel arena?

I am trying to get a trigger which
Allow any Unit OWNED by Player
waped Random HERO (dueling) to the arena
meanwhile allies Warped to Duel VIEWER reigon (Invunerable)
After duel ends Hero award ## Gold and return to respective Region BASE. as well the respective Allies wapred VIEWING heros
. There are 5 teams. 3 allied teams. 2 seperate teams single.
Which means Force 1 and 2 and 3 are allies
while force 4 and force 5 are solo

Thats about it i guess. i am still learning. Hope someone would guide or help me. thanks muchies
 
Level 13
Joined
Mar 24, 2010
Messages
950
eh i could probably help you but hard to follow what your saying...

maybe could you post your triggers in here that affect this such as your hero assign var's and the duel trigger..?

Like this:
  • Hero Number Assign
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Player_Hero_Array[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
I'll assume you dont know how to do this, so i'll tell you using my example above ^
You right click on where it says "Hero Number Assign" at the top on your trigger and click Copy as Text.
Then paste it in here and before all the trigger text put this -> [TRIGGER] *Then all your trigger text here* then type this -> [/TRIGGER] at the end of all the trigger text

Hope that helps :)

I have a game with a duel trigger system in it, check it out with someone and see if this is what your trying to do..
http://www.hiveworkshop.com/forums/maps-564/harry-potter-wiz-wars-m-o-m-2-60-a-169679/

(+rep) ^^
 
Level 3
Joined
Jun 13, 2010
Messages
43
This is the arrangement for forces for the script to trigger respective forces to work
(This is the working script i changed) However this wasn't the one i wanted

  • force
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to Forces[1]
      • Player Group - Add Player 2 (Blue) to Forces[1]
      • Player Group - Add Player 3 (Teal) to Forces[1]
      • Player Group - Add Player 4 (Purple) to Forces[1]
      • Player Group - Add Player 5 (Yellow) to Forces[1]
      • Player Group - Add Player 6 (Orange) to Forces[1]
      • -------- Force 1 / Force 2 --------
      • Player Group - Add Player 7 (Green) to Forces[2]
      • Player Group - Add Player 8 (Pink) to Forces[2]
      • Player Group - Add Player 9 (Gray) to Forces[2]
      • Player Group - Add Player 10 (Light Blue) to Forces[2]
      • Player Group - Add Player 11 (Dark Green) to Forces[2]
      • Player Group - Add Player 12 (Brown) to Forces[2]
This is the Variable that require to allow the hero to warp to spawn point on the region
  • Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set DuelSpawn[1] = (Center of Duel Spawn 1 <gen>)
      • Set DuelSpawn[2] = (Center of Duel Spawn 2 <gen>)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set RepickInteger[(Integer A)] = 1
          • Set RandomInteger[(Integer A)] = 1
      • -------- ------------------- --------
      • Set RandomHero[1] = Paladin 0008 <gen>
      • Set RandomHero[2] = Archmage 0009 <gen>
      • Set RandomHero[3] = Mountain King 0010 <gen>
      • Set RandomHero[4] = Blood Mage 0011 <gen>
      • Set RandomHero[5] = Blademaster 0012 <gen>
      • Set RandomHero[6] = Far Seer 0013 <gen>
      • Set RandomHero[7] = Tauren Chieftain 0014 <gen>
      • Set RandomHero[8] = Shadow Hunter 0015 <gen>
      • Set RandomHero[9] = Death Knight 0016 <gen>
      • Set RandomHero[10] = Lich 0017 <gen>
      • Set RandomHero[11] = Dreadlord 0018 <gen>
      • Set RandomHero[12] = Crypt Lord 0019 <gen>
      • Set RandomHero[13] = Demon Hunter 0022 <gen>
      • Set RandomHero[14] = Warden 0023 <gen>
      • Set RandomHero[15] = Priestess of the Moon 0021 <gen>
      • Set RandomHero[16] = Keeper of the Grove 0020 <gen>
  • Duel Begins
    • Events
      • Time - DuelTimer expires
    • Conditions
    • Actions
      • Quest - Display to (All players) the Quest Update message: It's Duel Time!
      • Countdown Timer - Destroy DuelTWindow
      • Set DuelTime = True
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in Forces[(Integer A)] and do (Actions)
            • Loop - Actions
              • Set DuelGroup[(Integer A)] = (Units owned by (Picked player) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is alive) Equal to True)))
              • Unit Group - Pick every unit in DuelGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Unit - Pause (Picked unit)
                  • Unit - Make (Picked unit) Invulnerable
                  • Set DuelPoint[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of (Picked unit)) is in Forces[1]) Equal to True
                    • Then - Actions
                      • Set DuelViewPoint[(Player number of (Owner of (Picked unit)))] = (Random point in Duel Viewer 1 <gen>)
                    • Else - Actions
                      • Set DuelViewPoint[(Player number of (Owner of (Picked unit)))] = (Random point in Duel Viewer 2 <gen>)
                  • Unit - Move (Picked unit) instantly to DuelViewPoint[(Player number of (Owner of (Picked unit)))]
                  • Camera - Pan camera for (Owner of (Picked unit)) to DuelViewPoint[(Player number of (Owner of (Picked unit)))] over 0.00 seconds
                  • Custom script: call RemoveLocation(udg_DuelViewPoint[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
                  • Selection - Clear selection for (Owner of (Picked unit))
      • Wait 2.00 game-time seconds
      • Trigger - Run Prepare Heroes <gen> (ignoring conditions)
  • First Duel
    • Events
      • Time - Elapsed game time is 120.00 seconds
    • Conditions
    • Actions
      • Quest - Display to (All players) the Quest Update message: The first Duel will...
      • Countdown Timer - Start DuelTimer as a One-shot timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for DuelTimer with title Duel Starts In:
      • Set DuelTWindow = (Last created timer window)
  • Prepare Heroes
    • Events
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 2, do (Actions)
        • Loop - Actions
          • Set DuelUnit[(Integer B)] = (Random unit from DuelGroup[(Integer B)])
          • Hero - Instantly revive DuelUnit[(Integer B)] at TempPoint, Hide revival graphics
          • Selection - Select DuelUnit[(Integer B)] for (Owner of DuelUnit[(Integer B)])
          • Set TempPoint = (Position of DuelUnit[(Integer B)])
          • Camera - Pan camera for (Triggering player) to TempPoint over 0.00 seconds
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Unit - Move DuelUnit[(Integer B)] instantly to DuelSpawn[(Integer B)]
          • Unit - Reset ability cooldowns for DuelUnit[(Integer B)]
          • Unit - Set mana of DuelUnit[(Integer B)] to 100.00%
          • Unit - Set life of DuelUnit[(Integer B)] to 100.00%
          • Unit - Make DuelUnit[(Integer B)] Vulnerable
          • Unit - Unpause DuelUnit[(Integer B)]
      • Trigger - Turn on Enter View Stand <gen>
  • Check Groups
    • Events
    • Conditions
    • Actions
      • For each (Integer IntegerD) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in DuelGroup[IntegerD]) Equal to 0
            • Then - Actions
              • For each (Integer IntegerE) from 1 to 3, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Player(IntegerE)) slot status) Equal to Is playing
                    • Then - Actions
                      • Set TempPoint = (Center of Duel Area <gen>)
                      • Hero - Instantly revive Hero[IntegerE] at TempPoint, Hide revival graphics
                      • Custom script: call RemoveLocation(udg_TempPoint)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Hero[IntegerE] belongs to an ally of Player 1 (Red)) Equal to True
                        • Then - Actions
                          • Unit Group - Add Hero[IntegerE] to DuelGroup[1]
                        • Else - Actions
                          • Unit Group - Add Hero[IntegerE] to DuelGroup[2]
                    • Else - Actions
            • Else - Actions
      • Wait 2.00 seconds
      • Trigger - Run Prepare Heroes <gen> (ignoring conditions)
  • Duel Ends
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) Equal to DuelUnit[1]) or ((Triggering unit) Equal to DuelUnit[2])
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to DuelUnit[1]
        • Then - Actions
          • Set WinInteger = 2
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to DuelUnit[2]
        • Then - Actions
          • Set WinInteger = 1
        • Else - Actions
      • Quest - Display to (All players) the Quest Update message: ((Name of (Owner of DuelUnit[WinInteger])) + is victorious!)
      • Player - Add 200 to (Owner of DuelUnit[WinInteger]) Current gold
      • Wait 2.00 game-time seconds
      • Unit - Reset ability cooldowns for DuelUnit[WinInteger]
      • Unit - Set mana of DuelUnit[WinInteger] to 100.00%
      • Unit - Set life of DuelUnit[WinInteger] to 100.00%
      • Set DuelUnit[1] = No unit
      • Set DuelUnit[2] = No unit
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in DuelGroup[(Integer A)] and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to DuelPoint[(Player number of (Owner of (Picked unit)))]
              • Custom script: call RemoveLocation(udg_DuelPoint[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
              • Unit - Unpause (Picked unit)
      • Custom script: call DestroyGroup(udg_DuelGroup[1])
      • Custom script: call DestroyGroup(udg_DuelGroup[2])
      • Set DuelTime = False
      • Set TempGroup = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in TempGroup and do (Unit - Unpause (Picked unit))
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Wait 10.00 game-time seconds
      • Quest - Display to (All players) the Quest Update message: The next Duel will ...
      • Countdown Timer - Start DuelTimer as a One-shot timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for DuelTimer with title Duel Starts In:
      • Set DuelTWindow = (Last created timer window)
      • Trigger - Turn off Enter View Stand <gen>
  • Enter View Stand
    • Events
      • Unit - A unit enters Duel Viewer 1 <gen>
      • Unit - A unit enters Duel Viewer 2 <gen>
    • Conditions
      • ((Triggering unit) Equal to DuelUnit[1]) or ((Triggering unit) Equal to DuelUnit[2])
    • Actions
      • Set TempPoint = (Center of Duel Area <gen>)
      • Unit - Move (Triggering unit) instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Less than or equal to 50.00
        • Then - Actions
          • Unit - Set life of (Triggering unit) to 1.00
        • Else - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 50.00)
(Players use Creeps) to (Ability)possesion) with respective Choosing Team Indiviual Hero
The trigger i trying to make is (Forces term from Tech tree in WE)
Allied:
Team 1
Force 1 5 Players
Force 2 2 players
Enemy
Force 3 3 players
Enemy solo
Force 4 solo
Enemy Solo
Force 5 Solo

Results: I reailse this Trigger would only work if There are only two team involed

I tried change its variables and its Forces vaule to make it work. But it came into a result with the hero only got warped into the arena region without any enemy. And Only 1 team are warped to the Viewing region.

I know that i need to edit much more to be more flexible with my Force and team arrangement . However i tried and it didn't show any much of a result. I wonder if anyone can come up with any script which i mention above?
 
Level 3
Joined
Jun 9, 2010
Messages
59
Maybe because you only have 2 arrays in DuelGroup and Duel_Viewer... so would that make it to where only 2 heroes will be selected? So just add more to the arrays and that may fix your problem(for more heroes)?
 
Level 13
Joined
Mar 24, 2010
Messages
950
So ok, i see your trig's, now what are you asking to be able to do clearly?

Sounds to me like your having a prob with your Player Group variables?
I see they are in an array? Care to take a screen shot of your variable table? and post it here as well?
I also see your using an array for your player groups..
I'm pretty sure theres a issue with those that you need to declare each one your using. Unlike others that you can just leave at 1 and still assign anything you want, Player groups require you to set it to the max number you plan on using i'm pretty sure.

Also does this system work correctly the first time used for you and then stop working after?
 
Level 3
Joined
Jun 13, 2010
Messages
43
  • Variables
  • Events
  • Map initialization
  • Conditions
  • Actions
  • Set DuelSpawn[1] = (Center of Duel Spawn 1 <gen>)
  • Set DuelSpawn[2] = (Center of Duel Spawn 2 <gen>)
  • For each (Integer A) from 1 to 6, do (Actions)
  • Loop - Actions
  • Set RepickInteger[(Integer A)] = 1
  • Set RandomInteger[(Integer A)] = 1
  • -------- ------------------- --------
  • Set RandomHero[1] = Paladin 0008 <gen>
  • Set RandomHero[2] = Archmage 0009 <gen>
  • Set RandomHero[3] = Mountain King 0010 <gen>
  • Set RandomHero[4] = Blood Mage 0011 <gen>
  • Set RandomHero[5] = Blademaster 0012 <gen>
  • Set RandomHero[6] = Far Seer 0013 <gen>
  • Set RandomHero[7] = Tauren Chieftain 0014 <gen>
  • Set RandomHero[8] = Shadow Hunter 0015 <gen>
  • Set RandomHero[9] = Death Knight 0016 <gen>
  • Set RandomHero[10] = Lich 0017 <gen>
  • Set RandomHero[11] = Dreadlord 0018 <gen>
  • Set RandomHero[12] = Crypt Lord 0019 <gen>
  • Set RandomHero[13] = Demon Hunter 0022 <gen>
  • Set RandomHero[14] = Warden 0023 <gen>
the acutal setting i used that's about it

variable.png


For this trigger , The timer worked fine and it will teleport Heros into duel arena once time expire.

Main problem:However it did only sent Team 1 as The Force 1 to the arena. and Only one sent to the duel battlefield. and rest of the team of force 1 and at the viewer(invunerable)stay there untill duelunit is killed and the time which suppose to expire didn't do so.it is as good as stucked there , Unless the triggering hero is killed then the VIEWER region hero will unpause. The enemy which supposed to sent such as force 3 aren't been sent. same goes to the rest. as the team i mention above. So Basically there's no one to duel and it bugged the team 1(Force 1)

Maybe i should add array. But i don't fully understand how trigger works yet. That's the issue i am having.
Thanks for helping out
 
Level 3
Joined
Jun 13, 2010
Messages
43
  • force
    • Events
    • Map initialization
    • Conditions
    • Actions
    • Player Group - Add Player 1 (Red) to Forces[1]
    • Player Group - Add Player 2 (Blue) to Forces[1]
    • Player Group - Add Player 3 (Teal) to Forces[1]
    • Player Group - Add Player 4 (Purple) to Forces[1]
    • Player Group - Add Player 5 (Yellow) to Forces[1]
    • Player Group - Add Player 6 (Orange) to Forces[2]
    • Player Group - Add Player 7 (Green) to Forces[2]
    • -------- Force 1 / Force 2 --------
    • Player Group - Add Player 8 (Pink) to Forces[3]
    • Player Group - Add Player 9 (Gray) to Forces[3]
    • Player Group - Add Player 10 (Light Blue) to Forces[3]
  • -------- Force 4--------
    • Player Group - Add Player 11 (Dark Green) to Forces[4]
  • ------ Force 5 --------
    • Player Group - Add Player 12 (Brown) to Forces[5]
If you meant by this. this is what i trying to have. hahas
 
Level 13
Joined
Mar 24, 2010
Messages
950
No i meant this:

variable.png

I need to see more or it, i need to see where your Player Force var's are

I'm pretty sure i already know your problem though. When you are assigning players to force[2] and force[3] and force[4] etc..
They arnt assigning anything because you probably didnt declare them properly in the var's. I'll know for sure when i see it..

Also.. in your "Duel Ends" trigger you cant do this:
  • Custom script: call DestroyGroup(udg_DuelGroup[1])
  • Custom script: call DestroyGroup(udg_DuelGroup[2])
You can only do that with Temp_Groups becuz once you do that your not declaring what that group is again, once you do that its gone forever.
 
Level 3
Joined
Jun 13, 2010
Messages
43
naw. >< this is just all the variables i used and everything that didn't work. My issue was that i have few teams and array that i didn't know how to apply to the respective DUEL VIEWING and the enemy didn't (Team 3 didn't came into the duel) ..

So i was hoping maybe if you can arrange the trigger ? Sorry lolx
 
Level 13
Joined
Mar 24, 2010
Messages
950
lol sorry its kinda of hard to understand what your asking..

whats not working how you want it too..? if your not worried about posting ur map or this section of the triggers here to this link i might be able to help is i play it and see whats wrong.. other than that not sure what your asking :/
 
Status
Not open for further replies.
Top