• 🏆 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!

Help with my mod (How to play select and play in a specific area?) :) Thanks

Status
Not open for further replies.
Level 3
Joined
Aug 17, 2013
Messages
65
Has anyone ever played Trolls vs Elves on warcraft3? Well you know at the beginning of a round the host picks an "arena" to play in? I need something like this for my map (there are 4 different areas) how do I do this? THANKS! :goblin_yeah:
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
I don't know if I'm correct but you need to try this :
  • Initialize Areas
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Area[1] = Area 1 <gen>
      • Set Area[2] = Area 2 <gen>
      • Set Area[3] = Area 3 <gen>
      • Set Area[4] = Area 4 <gen>
      • Set Current_Area = Area[1]
      • Set TInteger2 = 1
      • For each (Integer TI) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Area_Centre_Base[TI] = (Center of Area[TI])
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to Area_Centre_Base[1] over 0.00 seconds
  • Next Area
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
    • Conditions
    • Actions
      • Set TInteger2 = (TInteger2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TInteger2 Equal to 5
        • Then - Actions
          • Set TInteger2 = 1
        • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out over 0.50 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Pan camera for (Picked player) to Area_Centre_Base[TInteger2] over 0.00 seconds
          • Cinematic - Fade in over 0.20 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
  • Previous Area
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
    • Conditions
    • Actions
      • Set TInteger2 = (TInteger2 - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TInteger2 Equal to 0
        • Then - Actions
          • Set TInteger2 = 4
        • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out over 0.50 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Pan camera for (Picked player) to Area_Centre_Base[TInteger2] over 0.00 seconds
          • Cinematic - Fade in over 0.20 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
  • Choose Area
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Trigger - Run Start Playing <gen> (checking conditions)

NOTE : Well this works only with Player 1 . There is a system that detects host . But there is 50 % chance to miss host .
NOTE 2 : When A Player presses Up arrow key . Your triggers must run which I didn't mention .
 
Level 3
Joined
Aug 17, 2013
Messages
65
I don't know if I'm correct but you need to try this :
  • Initialize Areas
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Area[1] = Area 1 <gen>
      • Set Area[2] = Area 2 <gen>
      • Set Area[3] = Area 3 <gen>
      • Set Area[4] = Area 4 <gen>
      • Set Current_Area = Area[1]
      • Set TInteger2 = 1
      • For each (Integer TI) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Area_Centre_Base[TI] = (Center of Area[TI])
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to Area_Centre_Base[1] over 0.00 seconds
  • Next Area
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
    • Conditions
    • Actions
      • Set TInteger2 = (TInteger2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TInteger2 Equal to 5
        • Then - Actions
          • Set TInteger2 = 1
        • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out over 0.50 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Pan camera for (Picked player) to Area_Centre_Base[TInteger2] over 0.00 seconds
          • Cinematic - Fade in over 0.20 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
  • Previous Area
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
    • Conditions
    • Actions
      • Set TInteger2 = (TInteger2 - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TInteger2 Equal to 0
        • Then - Actions
          • Set TInteger2 = 4
        • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out over 0.50 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Pan camera for (Picked player) to Area_Centre_Base[TInteger2] over 0.00 seconds
          • Cinematic - Fade in over 0.20 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
  • Choose Area
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Trigger - Run Start Playing <gen> (checking conditions)

NOTE : Well this works only with Player 1 . There is a system that detects host . But there is 50 % chance to miss host .
NOTE 2 : When A Player presses Up arrow key . Your triggers must run which I didn't mention .

Ok cool looks good :) Where can I get and how do I install it? Or do I do it all by hand?
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Hmm if you mean 'Host detector' then take a look at this link
http://www.wc3c.net/showthread.php?t=86119

Also , Create a variable named Host , type Player , No-Arrayed. In Map Initialization, Add these triggers in case you applied 'Host detector' :
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Add to Next Area <gen> the event (Player - Host Presses the Right Arrow key)
      • Trigger - Add to Previous Area <gen> the event (Player - Host Presses the Left Arrow key)
      • Trigger - Add to Choose Area <gen> the event (Player - Host Presses the Up Arrow key)
 
Use dialogs. Arrow Keys for Selection? Eh.

  • Dialog Display
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Dialog - Clear Dialog[0]
      • Dialog - Change the title of Dialog[0] to Select Arena Region
      • Dialog - Create a dialog button for Dialog[0] labelled |caaffcc00Echo Isle...
      • Set DialogButton[0] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog[0] labelled |caaffcc00Darkspear...
      • Set DialogButton[1] = (Last created dialog Button)
      • Dialog - Show Dialog[0] for Host
  • Init Hero
    • Events
      • Dialog - A dialog button is clicked for Dialog[0]
    • Conditions
    • Actions
      • Cinematic - Fade in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[0]
        • Then - Actions
          • Set ArenaImpathables[0] = EchoImpath2 <gen>
          • Set ArenaImpathables[1] = EchoImpath <gen>
          • Set ArenaRegion = Echo Isles <gen>
          • Set ArenaSafe = EchoSafe <gen>
        • Else - Actions
      • Wait 1.00 seconds
      • Player Group - Pick every player in (All players matching ((Matching Player controller equal to Computer) or (Matching Player controller equal to User)) and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Random point in ArenaRegion)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (ArenaImpathables[0] contains ArenaPoint) Equal to True
                  • (ArenaImpathables[1] contains ArenaPoint) Equal to True
            • Then - Actions
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Set TempPoint = (Random point in ArenaSafe)
            • Else - Actions
          • Unit - Create 1 (Unit) for (Picked player) at TempPoint facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TempPoint)
The example arena is 'EchoIsles'. In case there are impathables and you don't want your units stuck, set the Impathables to a region in the map.
 
Last edited:
Level 15
Joined
Oct 29, 2012
Messages
1,474
Use dialogs. Arrow Keys for Selection? Eh.
He knows about dialog . But he wants it same like Troll vs Elves , By arrows . Dialog's idea is good . But he wants arrows only .
Also using an arrayed dialog is completely useless >.> . Why not remove that array ? :p
Also may I ask? Why all units controlled by 'Computer' and why 0 arrays O_O? Don't they cause Desync or whatever it's named?
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
To select an area , Add these actions :
  • Cinematic - Enable user control for (All players)
  • Floating Text - Destroy (Last created floating text)
  • For each Variable TempInteger from 1 to Elves, do (Actions)
    • Loop - Actions
      • Unit - Create 1 Priest for Player(TempInteger) at StartPoint[(Player number of (Player(TempInteger))] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_StartPoint[udg_TempInteger])
      • Camera - Set Player(TempInteger)'s camera Angle of attack to 305.00 over 0.00 seconds
  • For each Variable TempInteger from 1 to Trolls, do (Actions)
    • Loop - Actions
      • Unit - Create 1 Troll for Player(TempInteger) at StartPoint[(Player number of (Player(TempInteger)))] facing Default building facing degrees
      • Unit - Hide (Last created unit)
      • Custom script: call RemoveLocation(udg_StartPoint[udg_TempInteger])
      • Camera - Set Player(TempInteger)'s camera Angle of attack to 305.00 over 0.00 seconds
 
Level 3
Joined
Aug 17, 2013
Messages
65
This is my Initialize Areas Trigger setup:
  • initialize areas
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Area = Area 000 <gen>
      • Set Area = Area 001 <gen>
      • Set Area = Area 002 <gen>
      • Set Area = Area 003 <gen>
      • Set Area = Area 004 <gen>
      • Set Current_Area = Area 000 <gen>
      • Set TInteger2 = 1
      • For each (Integer TI) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Area_Centre_Base = Area_Centre_Base
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Center of Area_Centre_Base) over 0.00 seconds


This is my Next Area Trigger setup:
  • Next Area
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
    • Conditions
    • Actions
      • Set TInteger2 = (TInteger2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TInteger2 Equal to 5
        • Then - Actions
          • Set TInteger2 = 1
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Cinematic - Fade out over 0.50 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Camera - Pan camera for (Picked player) to (Center of Area_Centre_Base) over 0.00 seconds
              • Cinematic - Fade in over 0.20 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency


This is my Previous Area Trigger Setup:
  • Previous Area
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
    • Conditions
    • Actions
      • Set TInteger2 = (TInteger2 - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TInteger2 Equal to 0
        • Then - Actions
          • Set TInteger2 = 4
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Cinematic - Fade out over 0.50 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Camera - Pan camera for (Picked player) to (Center of Area_Centre_Base) over 0.00 seconds
              • Cinematic - Fade in over 0.20 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency

Any help would be much appreciated! (+++ Reputation :goblin_good_job:) Thanks guys!!!! :goblin_yeah:
 
A TempPoint is a temporary point variable. An arrayed region is like this.

Region[1]
Region[2]
Region[3]
Region[4]

So that your "TInteger2" could be the index. For example;

Set TempPoint = (Center of (Region[TInteger2]))
Camera - Pan camera for (Triggering player) to (TempPoint) over 0.00 seconds

In your trigger, you set TInteger2 +1 every press of an arrow key. That means one press would make 'TInteger2' = 2, therefore returning Region[2].
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
A TempPoint is a temporary point variable. An arrayed region is like this.

Region[1]
Region[2]
Region[3]
Region[4]

So that your "TInteger2" could be the index. For example;

Set TempPoint = (Center of (Region[TInteger2]))
Camera - Pan camera for (Triggering player) to (TempPoint) over 0.00 seconds

In your trigger, you set TInteger2 +1 every press of an arrow key. That means one press would make 'TInteger2' = 2, therefore returning Region[2].

Exactly , You did store the same variable many times , Area= ... and Area= ... It's being repeated .
You must add an array for 'Area' therefore you can change regions using integers . like this Area[1] ... [1] is the array . Now name each area with an increasing integer like this Area[1] .. Next Area[2]...and so on ..
 
Level 3
Joined
Aug 17, 2013
Messages
65
Also the Variable "Area" has "no region" As seen here:
231971-albums6702-picture73290.png


Is it CORRECT?
 
Level 3
Joined
Aug 17, 2013
Messages
65
I don't know how to create the Trigger as such:
  • Camera - Pan camera for (Triggering player) to (TempPoint) over 0.00 seconds
There is no option for that as far as I can see, as seen here:
(Pan Camera for:____________________)
231971-albums6702-picture73291.png


Gonna Give you Awesome Guys Credit in my game for all your help!
Once I get this right....
 
Also the Variable "Area" has "no region" As seen here:


Is it CORRECT?

It's the initial value, before all variables are declared.

There is no option for that as far as I can see, as seen here:
(Pan Camera for:____________________)


Gonna Give you Awesome Guys Credit in my game for all your help!
Once I get this right....

Event Response - Triggering Player.
 
Status
Not open for further replies.
Top