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

lua

  1. MStylo

    Lua maps protection

    Is there a way to protect maps that uses lua scripts? Up until now I have been using Map Optimizer 5.0 but that no longer works.
  2. Macadamia

    [Lua , vJass, GUI, TypeScript] UPROOT / ROOT events workaround

    Hello there, just a quick code to help people trying to catch when a building with root ability is actually rooted / uprooted. To be honest, detecting an uproot is really straightforward as the effect is immediate. But catching when a building has finished re-rooting is more complex. After a...
  3. Macadamia

    [General] How to declare UnitAlive native from common.ai in Lua ?

    Hello there ! I know that we can use this native from common.ai native UnitAlive takes unit id returns boolean by simply declaring it in the jass script. But now that I use Lua, how can I declare this native in order to use it in my Lua functions ?
  4. Macadamia

    [Solved] Lua - blindness ?

    Hello guys !! I don't know if it is because I have worked all night, but I am stuck on tracking a compile bug with my latest spell implementation. I have this really long Lua function that fires a "unknown error" when WE tries to save the map. I have narrowed the problem down to a very small...
  5. Macadamia

    [Spell] Setting unit animations with triggers : portrait issues !

    Hello everyone. I recently had issues with portrait animations for a Flying Balls model, and the model works perfectly so far. For a custom ability called "Torrefaction" that is supposed to burn the target for a few seconds, preventing it to move (yes I know damage would be more sensible but I...
  6. KirinXP

    Error Bars for Lua Maths in Warcraft 3

    Hi. I was testing some Lua maths in Warcraft 3 involving quadratic and apparently the obtained numerical value differs depending on whether math.sqrt or "^(1/2)" is used. Mathematically, they should be equivalent, thus, the same answer should yield. However, there seem to be a large difference...
  7. BladeMasterRUSH

    [Lua] Question about garbage collecting

    Hello! I am currently in the process of converting a map from JASS to LUA. Right now the map has no JASS script calls besides the standard manual garbage collection in GUI triggers. The gist is that this map is done entirely in GUI (and there are quite a few triggers) and only uses the above...
  8. Planetary

    [Lua] Minimalist UI

    [/hidden] The code came out rather hideous as it was torn apart and put back together several times but it's a working demo with lots of comments. (Note: this was my first time diving into local player code, so it's possible the end product is totally busted in multiplayer.) Here are some...
  9. Macadamia

    Lua : assigning a string to a variable containing a number ?

    Hello there, it's me again about Lua. I am asking this because I have not found the answer to this question, and before messing up my whole map for testing this, I just want to know if it is possible. As variables don't have types in Lua and only values have types, can I do this : a=5...
  10. Macadamia

    Lua : How to override global functions properly ?

    Hello there ! I am trying to override global functions, like those created by World Editor when saving the map script. I was hoping to use the context to modify them. I did a test with several of them, including "main", "config" or "InitBlizzard" : do local oldmain = main main =...
  11. Macadamia

    ...then I found the automatic JASS to LUA converter.

    Hello there ! As some of you already know, especially as I often come here to ask for help when I am hitting difficulties, I am currently converting my map from Jass2 to Lua. I have gone quite far, and only a few functions remain problematic, not mentioning the upcoming hidden bugs I have not...
  12. Macadamia

    Lua : ENTERING REGION firing multiple times for same unit.

    Hello there. Still working on converting my map from Jass2 to Lua, and I am currently experiencing a strange difference of behavior between Jass2 and Lua. The attacking creeps (Balls) in my TD follow a path of 8 WayPoints. These WayPoints are destructables with a model displaying their...
  13. Macadamia

    First attempt at converting Jass to Lua... FAIL

    Hello there, I hope you are all fine. So I decided to do the jump and start converting my map to Lua, trigger by trigger. But before I even go further, I cannot even manage to get my triggers to run. I have made a GUI trigger : Lua Init Events Time - Elapsed game time is 0.00...
  14. Planetary

    [Lua] Basic Knockback

    Jump to Latest Version
  15. iown_azz

    Maze Triggers - Death Region

    Are you making a maze and you know not much of coding or just lazy to add each region in GUI? Well today I bring to you a little project I am working on. A website of LUA Triggers for mazes, maybe other things as well. It is a website because now anyone can use it instead of making it in a...
  16. ivanbakavan

    [Defense / Survival] Dream TAG

    What's Dream TAG? It's a TAG (touch and go) map Tick, chasey or touch and go — is a playground game involving two or more players' chasing other players in an attempt to "tag" and mark them out of play. Dream TAG — is a rethinking of projects such as Vampirism Fire, Troll and Elves or Cat and...
  17. Killparadise

    Destroying Returned Locals

    So let's say I have a function that does a simple task of creating a quest. function questCreator (name, desc, icon, isReq) local qst = CreateQuest() local req = isReq or false QuestSetTitle(qst, name) QuestSetDescription(qst, desc) QuestSetIconPath(qst, icon)...
  18. Tukkel

    [Lua] Saving many regions in a hashtable

    I could not find this done before so I thought I might leave this here if anyone else also wants to store a lot of regions in a hashtable. With one custom script line you can store all your regions if you give them all a systematic name. In my case I wanted a checkerboard of regions that is...
  19. iown_azz

    [Solved] [LUA] Need a little help

    So i am trying to remove every unit of Demon Hunter(Edem) of player slot that is unused. I know this can easily be done in the gui trigger but I am trying to learn LUA. function HelloWorld() CheckPlayers3() CheckPlayers() print("Hello World") end function CheckPlayers3()...
  20. Tukkel

    [Trigger] Unable to turn off auto-cast for custom auto-cast spell

    The script language is in Lua so it may look a bit different from what you are used to. This trigger is able to turn off auto-cast for a normal auto-cast spell like heal, but I can't get it to turn off my custom faeriefire. It detects the custom auto-cast ability being turned on fine. Toggle...
  21. Black-apples

    [Solved] Unit Group Iterating Can't Get Casting Unit

    Good Evening everyone, I'm working on transitioning to LUA. I'm trying to remake the melee Blizzard spell in LUA. I have my code almost finished, but I've run into a minor hiccup. I've been banging my head against a wall for hours, so I hope somebody else can see my mistake. The problem...
  22. Sinthoras

    [Lua] Need help with boolexpr

    15 year old me used to make simple spells in gui 10 years ago and jass was too daunting to me. With the release of reforged beta and its support of lua it seems like the perfect time to get back in. I have no experience with lua either but I wanna learn it. Now to the question, Im not sure...
  23. rkt

    Any Lua API document for map making?

    I am new to Warcraft 3 map making, i like lua, before I digg into the map development, i just want to know if i can find the Lua API document for wc3 map making? I googled, but found nothing on the API documents. Please help me.
  24. BradPittlord

    [Solved] Visual Studio, pasting code to Trigger editor

    For some reason sometimes when I copy/paste Lua code from visual studio to the trigger editor it pastes these random symbols instead 鿐ϴ 昰Ϯ I thought it was VS causing the problem at first but I'm pretty sure maximizing and minimizing world editor copies those symbols to the clipboard anyone...
  25. BradPittlord

    Lua Question

    I can't seem to get this to work, all it ever prints is "2" gets stuck on if IsUnitType(u, UNIT_TYPE_STRUCTURE) == false then function PortalActions (L, PG) print ("2") local u = GetTriggeringUnit() local n = GetUnitTypeId(u) if IsUnitType(u, UNIT_TYPE_STRUCTURE) == false then...
  26. rufreakde

    TypeScript MPQ Command Line Tool - Node NPM - Project on Github

    Hey guys, I have written a simple TypeScript tool to use MPQ2K commands from your node project. Maybe someone wants to use it feel free to try it out. Feedback and suggestions for new commands that you need are appreciated. At the moment you can just execute the tool in your ts code and extract...
  27. BradPittlord

    syntax error

    When you save your map and it compiles your script if it gives a syntax error it tells you what it is but what line it's on and the text box of that line is never actually where the syntax error is. Is there a way to find where it is cause VS isn't catching any errors edit: For some reason if I...
  28. BradPittlord

    Couple Questions

    1. For bribes damage engine, it's faster if you combine all your triggers into one with the GDD_Damage_event. Does the same concept apply to other triggers? Say combining all your, "a unit is sold" or "periodic Event .03 sec" along with the many other events to reduce lag? 2...
  29. Uncle

    Preload for save/load system - Need help (Lua)

    Hi guys, I've decided to try something way over my head and I need some help. I'm trying to make a save and load system for my map. Here's the code i'm using: So i'm trying to use the tooltips for the Aerial Shackles ability ('Amls') to store my save code. This seems to work in the same game...
  30. Wrda

    [LUA] Unable to make dynamic filters

    For some reason I can't figure out how to make a dynamic filter/condition so that it can be used for unit enumerations are stuff like that, lua always gives me a vague error "unknown compile error". I've tried endless possibilities and can't wrap my head about it... function A() local b =...
  31. Aleksandr

    Do I need to destroy periodic timer

    Hello all, if I have following code TimerStart(CreateTimer(), 5.0, false, function() DestroyTimer(GetExpiredTimer()) --some code end) do I need to call DestroyTimer explicitly if the timer is not periodic ?
  32. Drulia

    cJass2Lua - Powerfull cJass converter

    Warcraft III Reforged brought us lua scripting, but still a lot of map makers for WC3 are using cJass. Just because C-style syntax rules. Unfortunately cJass extension is unsupported for Reforged and who knows how it will be. Lua is more efficient, useful and simple for game development. But a...
  33. Aleksandr

    How can I put external lua code into my map ?

    I want to put my custom war3map.lua file to the map. The initial goal is to create something like hot redeploy of lua script to the map while I'm working in World Editor. But once I replace generated war3map.lua on my custom one it does not work. Neither when WE is open nor it's closed. it...
  34. DanmakuUmineko

    [JASS] Changing scripting language

    Hello everyone, I'm coming back to Wc3 after nearly 10 years, I still got some rust on but I'm trying to understand the working of this new functionality that allows the use of LUA scripts within maps. I've seen that some people have made map that has the script language set to LUA, I see...
  35. Uncle

    Recycling Units - Is this even worth it? (Lua)

    Hey guys, I wanted to implement a unit recycling system into my map and I'm not sure if this is even worth it in terms of performance. So the basic idea is this: All of my units have a hidden Reincarnation ability. This ability has a 0 second cooldown/delay/cast time so when a unit dies it is...
  36. Aleksandr

    luaimport does not work

    Hello all. I'm trying to include external script to the map but it throws some unexpected error: I'm using following code: //! luaimport "c:\Game\x.lua" What could be wrong ? Or it should be included using another statement ? Attached map here...
  37. Drake53

    [Lua] Basic lua functions

    I checked all functions for lua 5.3 by comparing them to nil. You can see the result in the image below. Functions highlighted red cannot be used. You can find the list of functions and see their documentation here.
  38. seeYouInHell

    Lua to bytecode -- is it possible?

    I have feeling that I heard protected map now can contain just bytecode of Lua script, so there is no need in source code obfuscation: source code can be removed. But now I'm not sure about that: does WC3 support Lua bytecode in the MPQ or it compiles it every time on the loading screen like in...
  39. Rhobox

    Lua string formatting and decimal places

    Hello! Has anyone found a good way to print or set tooltips (or any other numbers) to only a certain number of decimal places in Lua yet? The string.format() option always just returns the minimum number it seems to be able to. Integer math doesn't work super well either as it is prone to...
  40. AtheosTG

    Are LUA apis identical to Jass?

    I'm trying to run the following code: function SpawnerActions() print "I am a test string." CreateNUnitsAtLoc(1, "hfoo", Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING ) end onTriggerInit(function () Spawner = CreateTrigger()...
  41. AtheosTG

    Does jasshelper now ship with standard warcraft 3?

    I can't seem to be able to remove Jasshelper. I want to use lua and i think JH is giving me trouble. However simply deleting the folder only results in it re-downloading. Anything i should know?
  42. JsonDalao

    Lua does not seem to automate garbage collection in 1.31

    Instances of Lua are created every second and used memory is exported, without notice that the memory is reduced and is freed by calling "collectgarbage("collect")
  43. Tasyen

    Variable Debugger

    This is a Lua UI resource that allows to inspect values of any global and table data during the game. But not no hashtable Data directly, for hashtables it uses an resource that replaces hashtables with Lua tables. One is also capable to Change number, string and boolean data. Such changes done...
  44. Uncle

    Issues with creating a Dialog (Lua)

    So the issue is weird. This code works as it should: function Test() DialogTest = DialogCreate() DialogAddButtonBJ(DialogTest, "TEST") DialogDisplayBJ(true, DialogTest, Player(0)) end It creates the Dialog and everything works fine. However, the problem occurs when trying to run...
  45. Uncle

    Imprecision of timers and working around it (Lua)

    The problem is that the Reals aren't precise. Here's a simple code I made in Lua: local duration = 5.00 TimerStart(SomeTimer, 0.05, true, function() duration = duration - 0.05 print("Duration = ", duration) if duration <= 0 then --End the timer end end end) When I...
  46. The_Spellweaver

    [UI] Lua (Wow) Talent system

    So, I've been busy last few couple of days and made this little thing that I need for a map and I thought it would be nice if I made it usable by other people. I'm mostly posting this for people to check out/use or note bugs. (1-2 I already know of) What I would also appreciate is ideas of how...
  47. strange_loop

    [Lua] Unit ID string to integer

    I'm new around here and I just recently started getting into W3 scripting now that Lua is a thing! I came up with a function that might be useful. If it's not, please just archive this thread and carry on :gg: Functions like native CreateUnit takes player id, integer unitid, real x, real y...
  48. Uncle

    Creating global variables in Lua (and some other Lua questions)

    Edit: I figured out my problem and managed to get the global variables and multi-dimensional array to work. However, this brings up a new question. Is there a way to set the default values of these Arrays to be 0 instead of having to manually set every single one to 0 like I do below? I don't...
  49. Yui Moe

    [Leak] Lua Scripting & Memory Leak

    Hello guys, Since now editor officially support Lua scripting and we all know Lua is a quite common and widely used language, I wonder will it avoid all or part of memory leak problems by using Lua instead of JASS? Actually the biggest blocker prevent me to create custom games is it forced me...
  50. Trokkin

    LUA tests and benchmarks

    I've been asked to check several statements about LUA, so here's a bunch of tests and benchmarks from me. This compilation might be supplemented should any questions appear. Ask any! I'm using Trokkin/CeresStdLib for utility. [/SPOILER] [/SPOILER]
Top