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

[Solved] Running a Lua script on map init

Status
Not open for further replies.
Level 9
Joined
Jul 30, 2018
Messages
445
Hey!

This may seems a bit simple question, yet I have not been able to find an answer for it.

With JASS, one can make an initializer to make a function run on map init. Or you can convert an empty GUI trigger to Custom Text and then check "Run on Map Initialization".

But is there such a thing for Lua? I've been trying to Google and search the answer, but apparently there aren't that much people making Lua tutorials for Warcraft 3. It just seems a bit silly to make a bunch of Lua functions and then call them all in a GUI trigger... :p
 
Level 9
Joined
Jul 30, 2018
Messages
445
Yeah! That's just it. Thank you!

I remember seeing that onGlobalInit() function being used on some systems and maps, but it didn't work for me and I never realized it was just created separately elsewhere.
 
Status
Not open for further replies.
Top