• 🏆 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 help (probably easy to help me so check it out)

Status
Not open for further replies.
Level 9
Joined
Jan 14, 2008
Messages
366
  • ctf respawn
    • Events
      • Time - timer_revive[1] expires
      • Time - timer_revive[2] expires
      • Time - timer_revive[3] expires
      • Time - timer_revive[4] expires
      • Time - timer_revive[5] expires
      • Time - timer_revive[6] expires
      • Time - timer_revive[7] expires
      • Time - timer_revive[8] expires
      • Time - timer_revive[9] expires
      • Time - timer_revive[10] expires
      • Time - timer_revive[11] expires
      • Time - timer_revive[12] expires
    • Conditions
    • Actions
      • Set TempPoint1 = (Random point in Region 001 <gen>)
      • Camera - Pan camera for (Player((Integer A))) to TempPoint1 over 0.10 seconds
      • Wait 0.25 seconds
      • Unit - Create 1 Mage for (Player((Integer A))) at TempPoint1 facing (Random real number between 0.00 and 360.00) degrees
      • Set hero[(Integer A)] = (Last created unit)
      • Unit Group - Add (Last created unit) to Unitgrp_invulnerable
      • Special Effect - Create a special effect at TempPoint1 using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation (udg_TempPoint1)

thats my trigger. now doing 12 "if - then -else" functions would be stupid, but how can i tell the actions to be performed for the player who corresponds to the timer array ?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Use hashtables to attach the player to the timer (use GetHandleID() for the main index and the child to be a string hash of a string like "player") and then you can get the expired timer via the native which you can then use to retreive the corosponding player from the hashtable.
 
Level 9
Joined
Jan 14, 2008
Messages
366
im afraid i have no clue what hashtables are, nor how to use them properly. but thanks, i will look into it, i believe i saw a hashtable tutorial on her recently.

they seem to be useful stuff :eek:
 
Status
Not open for further replies.
Top