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

Rune system with triggers, help me clarify please!

Status
Not open for further replies.
Level 3
Joined
Nov 23, 2015
Messages
21
http://www.hiveworkshop.com/forums/triggers-scripts-269/spawn-rune-240609/
so I found this, but it says nothing to me. Could someone make a wc3 map with a working rune system trigger (I want it to spawn just haste every 45sec from when you took the haste/used the haste rune) and ANOTHER ONE which is exactly the same but with invisibility. Meaning that haste will always spawn where the last haste rune spawned. But if someone could explain to me like im 5 years old or make a wc3 map with the trigger and send it so i can look at it myself! ):
 
Level 3
Joined
Nov 23, 2015
Messages
21
Two, one for the left side (which is haste) and one for the right side (which is invisibility)

EDIT: Yes, two regions with independent times if it's too hard to make / if it's much easier to make just one then I can re-do my map a little I think...
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can make them separately very easily.

Make a timer variable.
When the map starts, you start that timer with 0 duration. (one shot)
You make a trigger that will spawn a rune of haste on a specific location when that timer expires.
When you pick the rune up, you only have to start the timer again with 45 seconds.
 
So I made a little system. it's not as efficient as i'd like it to be, but I made this hastily, so hopefully it doesn't have any glaringly poor code :p

Disclaimer: yes, I tend to overcomplicate things.

What I did it was to setup all the rune types and locations in a setup trigger (Rune Setup), and at the end of that trigger fire the countdown timers. If you look at the disabled functions, those are custom scripts that were meant to create the timers (because arrays) but for some reason that didn't work, so I was forced to manually set the size of the array of the RuneTimer[] variable to 3 in the variable editor. Hopefully someone has a fix for that.

Now, when the timers all expire, they will create a rune at a specific location. I use if/then/else for that to identify which specific timer just expired. There's likely a better way to just grab the array of the specific timer that went off, but idk how to do that. So depending on the timer, the RuneIndex is set to a specific number, and because the specific array values were setup in the Rune Setup trigger, we can just go ahead and do Item - Create RuneType[RuneIndex] at RuneLocation[RuneIndex]. Then you store that specific rune in a variable so that the game will know that if that specific rune is used, it will know to restart the timer.

Rune Loop does just that. It checks if a rune was used and then restarts the timer. I've configured the system to handle 3 different types of runes, but you can easily add to it. If you want to stick to Haste and Invisibility runes, then just get rid of RuneType[3] amd RuneLocation[3] in the setup and in the two other triggers. Hopefully that helps.
 

Attachments

  • Rune Spawn System.w3x
    17.4 KB · Views: 64
Level 24
Joined
Aug 1, 2013
Messages
4,657
You probably had an event "Timers[x] expires"... that event is created before you set the value of that timer array to an actual timer, so at the moment that your event was created, you said "null expires"... the fix to this is set the event manually after you created the timers.
 
Status
Not open for further replies.
Top