• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How would you destroy a variable with an array of an integer variable?

Status
Not open for further replies.
Level 2
Joined
Jan 17, 2009
Messages
10
How would you destroy a variable with an array of an integer variable?

For example:
Set IntegerX = Random number between 1-10
Set Point[IntegerX] = Position of Triggering unit
Custom script: call RemoveLocation (udg_Point[IntegerX])

Unfortunetely that doesn't work =/
 
Level 4
Joined
Jul 28, 2009
Messages
64
In the example, I don't understand why you would save a point as a random integer in an array.

If it is temporary, then it wont matter if you use a random number in your point variable (like a Temp_Point).

If it is not temporary you run the risk of saving over a previous point with the same random number, which may cause problems...

Ultimately its very hard to understand what you are doing here, so more information would be helpful.

You do have to add the udg_ to the array variable too, but im not sure if you are just leaving it out in your example. So, it would have to be call RemoveLocation(udg_PointVariable[udg_IntegerVariable]).

Again, more information would help us understand the problem better. Perhaps you can paste the triggers here?
 
Level 2
Joined
Jan 17, 2009
Messages
10
Unit - A unit Dies

Set Revive_Integer = (Player number of (Owner of (Triggering unit)))
Set Revive_Timer[Revive_Integer] = (Last started timer)
Countdown Timer - Start Revive_Timer[Revive_Integer] as a One-shot timer that will expire in 5.00 seconds
Countdown Timer - Create a timer window for Revive_Timer[Revive_Integer] with title Revival
Set Revive_TimerW[Revive_Integer] = (Last created timer window)
Wait 5.00 seconds
Countdown Timer - Destroy Revive_TimerW[Revive_Integer]
Custom script: call DestroyTimer( udg_Revive_Timer[bj_Revive_Integer]) <<< this i can't figure out how to destroy
Set Revive_Point = (Center of Region 001 <gen>)
Hero - Instantly revive (Triggering unit) at Revive_Point, Show revival graphics
Custom script: call RemoveLocation (udg_Revive_Point)


I'm trying to make a countdown timer that displays the time left till revive to ONLY the owner of dying unit. I find that if the trigger is triggered twice or more times, it will screw up the timer.
 
Status
Not open for further replies.
Top