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

how to make an issue order target an 3 diffrent players after the timer expires

Status
Not open for further replies.
Level 5
Joined
Aug 24, 2010
Messages
133
something like this what you want?
where gametimer is a timer variable
playerpoints is a point array
and playernumber is an integer variable

  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Countdown Timer - Start gametimer as a Repeating timer that will expire in 30.00 seconds
  • main
    • Events
      • Time - gametimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack Ground playerpoints[playernumber]
          • Set playernumber = (playernumber + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • playernumber Equal to (Number of players)
        • Then - Actions
          • Set playernumber = 1
        • Else - Actions
 
Well, what is playerpoints, actually? It's a point variable but where is it? How do you set it? At map init, all integers are equal to 0. So at first, units will attack playerpoints (player 0). Only after 2 expirations of the timer will it work because you only set it up to 1, not 0. That's why it didn't work. Arrays actually can start from 0.

So change the If/Then/Else to: playernumber equal to ((number of players) -1)
set playernumber = 0

Edit: and try to preplace playerpoints.
 
Level 5
Joined
Aug 24, 2010
Messages
133
right you are en_tropy
i made the assumption the initial value was set to 1 cause thats what i normally do so the variable number is the same as the player number
but the reason it doesnt work is because i accidentally put the Set playernumber = (playernumber + 1) as part of the loop where it should after it

Edit: oh yea about those playerpoints you want to put a region in each base then declare the point the middle of the region on map initialisation or something like that anyway
 
Level 9
Joined
May 31, 2010
Messages
366
  • Timer
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Countdown-Timer - Start Timer1 as a Wiederholt timer that will expire in 30.00 seconds
  • Order
    • Ereignisse
      • Einheit - A unit enters YourSpawn <gen>
    • Bedingungen
    • Aktionen
      • Einheit - Order (Entering unit) to Angreifen/Bewegen nach (Center of Position)
  • Change
    • Ereignisse
      • Zeit - Timer1 expires
    • Bedingungen
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • counter Gleich 1
        • 'THEN'-Aktionen
          • Set Position = Enemy 2 <gen>
          • Set counter = 0
        • 'ELSE'-Aktionen
          • Set Position = Enemy 1 <gen>
          • Set counter = 1
this should work, its very basic and maybe has leaks but others here can help you to change the leaks in this
 
Level 9
Joined
May 31, 2010
Messages
366
do not double post*

btw.: my english is not the best please kill me now^^ xD

variables i used are:"YourSpawn" - is not a variable, its an area where the units spawn (if you dont have one create one at the position where the units are spawning)
"Timer1" - just a timer

"Position" - area - this is the target area where the spawned units should move (so you need to create 1 area for each position where the unit should move after the timer expires. you make the areas to "position" in the third trigger i posted)

"Enemy 1" and "Enemy 2" are no variables too, like "YourSpawn" they are just areas (the ones wich are needed for fpr position in the third trigger)

so thats all
 
Status
Not open for further replies.
Top