• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

lua

  1. moddiemads

    TIL The Length Operator (#) can cause a time-bomb desync.

    Basically the title. I've been helping the CoE map by modernizing its implementation and translating it to LUA, and this gnarly desync started happening after 30min or more of game time. It turns out that, after a lot of bug hunting, the # operator in LUA does not behave consistently across...
  2. KW~

    A strange error in Lua script

    Add a line with a meaningless comment in the code, and the program crashes after running the check. --length % scale Does anyone know why?
  3. GeorgesZebit

    ABILITY_SLF_SPELL_LIST not work?

    I wanted to dynamically modify spell list of spellbook with BlzSetAbilityStringLevelField, but it just do nothing with ABILITY_SLF_SPELL_LIST field. code is like this, A003 is spellbook. local a = BlzGetUnitAbility(u, FourCC('A003')) print(BlzGetAbilityStringLevelField(a, ABILITY_SLF_SPELL_LIST...
  4. sur5al

    [Trigger] Need help to make trigger

    So... i get many search hits on the net for "convert jass to lua", but i need the opposite thing! Which i cant figure out. I am super low level in jass. Use it only when need things outside gui possibilities (local variable, damage detection system, etc.). All my jass triggers in my maps are...
  5. Luashine

    [Mapping] Explaining Warcraft's lockstep architecture for mapping (avoid desyncs)

    I haven't seen Warcraft 3's concepts explained anywhere in a condensed manner, let me try it here. Who is this tutorial for? The beggin beginners in War3 modding, though the explanation will probably require some prior programming knowledge or a little experience with World Editor. Lockstep...
  6. Bloodheaven_

    [Lua] Does this desync?

    Hi there, I'm trying to implement my UI while also fiddling with GetLocalPlayer(), I wonder if this method of doing it causes any desync. Is it unnecessary to do it like that, can I just use "BlzFrameSetTexture(backdrop, s, 0, true)" in the GetLocalPlayer() block? How do I test if any...
  7. Bloodheaven_

    [Lua] Reforged UI Designer doesn't work In-Game

    Hi there, I created my UI in the Reforged UI Designer and exported the UI to Lua. Then I pasted it in the Map Custom Script Code only to find out it doesn't show up, the JASS version of that UI doesnt have that Problem at all, do I need to call the UI somehow? Here is the snippet: The JASS...
  8. Bloodheaven_

    [Lua] How to convert GetUnitGoldCost to LUA?

    Hi there, I'm trying to convert this native to a LUA Function but I'm failing miserably. Jass Function converted to LUA Function //Jass native GetUnitGoldCost takes integer unitid returns integer //-->LUA<-- function GetUnitGoldCost(unitid) end Function Call Custom script...
  9. MangaPwnz

    [Solved] [LUA] Change ability field for ALL abilities with abilCode

    Hello :) I'm trying to make a custom spell system and need help with a specific part of it. Goal: I want to be able to create custom spells while touching the object editor as little as possible. I want to be to fill in as many as possible of the fields - the most important are cooldown, mana...
  10. HerlySQR

    [Lua] Time result cannot be represented in this installation

    Hello, in my save load system I included save the date when the save was made, to the players can keep track of them but for some reason in this line to show the date: BlzFrameSetText(TooltipDate, os.date("\x25c", os.time(data.date))) Sometimes happens this error: To let you know, the value...
  11. HerlySQR

    Lua W3 handles instantiation

    Hello, while I wanted to translate the Zwiebelchen's Threat System to Lua, during the Debug Board it checkes the handles that are existing in the map and to asign them an integer does an operation that involves creating 50 locations, get their handle ids and finally removing all of them every...
  12. Arvin.Ma

    [Crash] [HELP] internal error in the LUA transpiler

    i have a bug, it's make me confuse long time, my script is write by lua. (have not one line jass code). but when i use RestartGame() API to restart game, sometimes, it will random crashing. (About 1 in 10 probability) 。 below is the war3 error log. can someone guys help me ? 5/8...
  13. Insanity_AI

    [Lua] Task Processor

    Inspired by Chopinski's Relativistic Missile System way of processing missiles, I've come up with an idea of mimicking OS's process scheduling inside Lua's runtime for the purpose of eliminating "processing" lag by sacrificing the fact that the code will always execute immediately upon call. At...
  14. fllwr9141

    [General] Questions on Reforged for a old newbie

    1. What are the constraints and best practice for FourCC allocation? (except for H*** for heroes) 2. Is it possible to place same ability on different UI button positions depending on unit type? (non-hero) 3. Does Leak matters in Reforged, given sufficient memory? (In other words, will incur...
  15. Killparadise

    [Solved] Lua Modulo Weird Behavior

    Hello! I'm writing out some scripts but it seems like when I try to run a modulo I get some weird behavior, for example: a % b - Causes a syntax error a % n - Crashes the world editor a % 1 - Saves fine Are we not able to use variables with the mod functionality? Full Example that gives a...
  16. Uncle

    [Lua] [solved] Lua Grid System - Need help with OOP design

    I don't know what I'm doing, help me! -- This creates a 2d, 3d, etc. array (table). It needs to be above the variable creation function newAutotable(dim) local MT = {}; for i=1, dim do MT[i] = {__index = function(t, k) if i < dim then t[k] =...
  17. HerlySQR

    [Lua] How can I increase the performance of this system?

    Hello, I was creating a map with a guy, and we were testing, I made this system for spawning creeps, but the map lags a lot and it get worse, but just for me and not for his or another person, I know the problem is this system because the memory starts too increase a lot when is running, and I...
  18. HerlySQR

    [Lua] Metatable method is not received when I'm calling it

    Hello, I'm again trying to translate the Codeless Save Load System to Lua, but for some reason I'm not receiving the method of the metatable when I'm calling it, this is weird because I though if a table doesn't have a field, it will check to its metatable, basically I did this: ---@return...
  19. HerlySQR

    Creep spawn system lags after a while when spawn a unit

    Hello, I made a creep spawn system, it worked fine, but for some reason from a certain point when creates the first creep, eventually the game lags a lot, and I don't know why, I can't just erase things until I don't get the problem, because almost everything is important to the system works, I...
  20. Luashine

    How to contribute to jassdoc for dummies

    What is jassdoc? Jassdoc (lep's explanation, source & viewer; moyack's) is the community's collaborative attempt to do something a multi-billion (or smol million?) corporation couldn't afford a budget for: documentation for the part of the game, the part that made it live on for almost a decade...
  21. MindWorX

    [Miscellanous / Other] Warcraft III: Community Edition

    What is Warcraft III: Community Edition? Warcraft III: Community Edition is a launcher designed specifically for Warcraft III, version 1.29.2.9231, nothing more, nothing less. You can grab your own copy of 1.29.2 here, under the Game Files tab. But .. why is Warcraft III: Community Edition? I...
  22. Lamer

    [Script] Hero/unit info panel

    Hello everyone! I'm a GUI custom map maker and to make Resource Bars I need to learn Jass or Lua. I just started reading tutorials but this upgrade I need on my map asap :thumbs_up: Let me know if it's even possible do this way. So the example pannel gonna look like this: From upper left: 1st...
  23. HerlySQR

    [Lua] Control the order of the scripts

    Hello, I create this thread to discuss a thing that bothers me a lot, you know that all the custom scripts are placed in a unique file war3map.lua, the problem is, we can't control the order in where they will be placed, and this matters since we have libraries that requires other libraries are...
  24. HerlySQR

    Lua GetStackTrace

    I don't know if this was actually found, but there is a way to get the stack trace in W3 Lua, just using the error function, because is the unique function that can tell us what function called it and the function that called this and so on, so I did something like this: function GetStackTrace()...
  25. HerlySQR

    [Crash] Error with the Lua transpiler?

    Ok, this error never happened to me, and I don't have idea what tries to tell me, I need an explanation, only I know is just for having this trigger: Jijimon House Enter Leave Events Map initialization Conditions Actions Set VariableSet TP_EnterRect = JijimonsHouse...
  26. therealhjrp

    [Lua] How to use SelectUnitSingle()

    Short question: the first code snippet (in JASS) works, but the second one (Lua) does not. function selectPriest takes nothing returns nothing call SelectUnitSingle( gg_unit_hmpr_0000 ) endfunction function selectPriest() SelectUnitSingle( gg_unit_hmpr_0000 ) end Why?
  27. Luashine

    [Lua] Process memory leaking at high GC pressure

    Disclaimer: This is not something you would ever encounter under normal circumstances. TLDR: At very high GC pressure processes' memory will grow. If the GC catches up, the memory will not be released to OS. I'm currently attempting to debug a memory leak in a big trigger-heavy map I'm porting...
  28. Luashine

    [JASS] Performance analysis of 'leaking' Jass strings & Lua

    Common knowledge has it Jass strings leak!!!1 and are bad!!!1 Let's benchmark by generating A TON of strings. Test code & setup The code below takes your chat message, like "-10" and generates ONE 10-char long string (1=10/10). That's equivalent to generating 10 distinct unique strings in Jass...
  29. Luashine

    Blizzard's hidden jass2lua transpiler

    A few threads here have made me curious: "...then I found the automatic JASS to LUA converter." - Macadamia found by mistake that WorldEdit can transpile all Jass code to Lua. Nobody knows how exactly "Lua, embedded jass" - Tasyen found out, that Lua maps can have Jass code, automatically...
  30. Luashine

    Reforged's luahelper.lua and broken FourCC

    I won't just feed you, I will teach you how to fish 1. How to extract luahelper.lua 2. luahelper.lua ...Then let's print the file starting at these positions (start at byte 37392400 | only readable text | max 50 lines): user$ tail --bytes +37392400 "Warcraft III.exe" | strings -n 1 | head -n 80...
  31. The Nightmare Book

    [Lua] Problem with spell

    Hey guys, I have next spell that does alot of things depending on targets global group (animals, humans, etc). But right now I don't know why it doesn't work - my spell simply doesn't call and I don't know why. I tried different approaches but currently I don't found the answer. Init 10 Spells...
  32. HerlySQR

    [Lua] What is bad with this code?

    I getting tired with the WE, I tried to improve the Lua version of my Unit Transmission system, but the game displays error when I wanna run the map, so what is wrong with this code? do -- version 1.1.0 --[[ Also requires the Lua Timer Utils...
  33. HerlySQR

    [Lua] World editor closes when I save the map because of this code.

    I tried to update the Lua pure code version of my Bounty Controller but every time I saved it the editor closes and I don't know why, I wrote it in the VSCode with pluggins and never displayed me a syntax error or something like that, to see what is happening here is the code: --The pure Lua...
  34. VaaL

    Lua endblock error

    I have a Lua script which I wanna import in my map, but when I'm trying to save the map it says "endblock error at line 547" while the test map has 546 lines I'm a noob at Lua, I know zero Also I noticed that if I delete everything and leave a single function it starts giving me another error...
  35. HerlySQR

    [Lua] Trigger variable event is not working

    For some reason the variable event for a system I did in Jass and worked in that is not working in Lua, basically the triggers with that event doesn't run, why?
  36. 0x4b

    [Solved] Issues using Lua extension with ObjectMerger

    Hello, I am following the Lua Object Generation guide posted by PurgeandFire and trying to get it working but triggers in Lua aren't working at all for some reason. I am able to use the normal ObjectMerger syntax just fine to create objects, but the Lua extension isn't working. I'm using this...
  37. HerlySQR

    [Lua] Text macro in Lua?

    I searched if there is a way to do this but I didn't find anything, so I'm here to ask you.
  38. ScrewTheTrees

    1.32 The LUA GC is seemingly disabled.

    This is just a heads up for whoever uses Lua / TypescriptToLua or similar frameworks for their warcraft 3 maps. The Lua GC is seemingly disabled. Over in the hiveworkshop discord we did quite a bit of experimentation on this issue after i realised my map was leaking 0.6MB/s, but the leaks made...
  39. NightKnight

    Reforged UI Designer

    Allow me to introduce you to the: Ultimate Reforged UI Designer (RUID) There is now a new thread for this tool. This thread is no longer being updated. - Designed to take Map modding to the next level, with graphical Frame creation and adjustment. - Made for everyone, from the humble GUI...
  40. HerlySQR

    Can you explain me how works Lua?

    I'm getting started in Lua after 4 months of learning Jass and vJass, I know some basics things like I can't use the words "call", "set", "takes" or "returns", for code functions I can do it inside of the current function, the IDs needs FourCC and all the variables can have any type of value, I...
  41. NightKnight

    Need Typescript/Javascript coders

    This is for my map: Fantasy Life. It is slightly similar LoaP in the regard that it has jobs, but mostly different. More details in the map link. So some of the things that we will be making: Tens of mini-games using Frames and UI for jobs and events. (the main point) UI for almost anything...
  42. TheDoener

    Concatenate Strings in LUA

    Hey all, I have a question. When i write this line: print("Congratulations to", GetPlayerName(Player(0)), ". You have been elected to rule the kingdom!") why is it printed ingame like this: Congratulations to_____Name of Player______. You have been elected to rule the kingdom! (_____ shows...
  43. wd40bomber7

    Cerrie Hot Reload & 'initialization'?

    Hello, First off I realize that both ceres and cerrie have more-or-less been abandoned. I didn't want to let a little abandonware come between me and excellent tooling so I've given a shot at using them. Honestly all-in-all my experience has been excellent. (Regardless of current project...
  44. Kick King

    [Crash] Issue with game crashing about 15 minutes into map

    Hey, So, I've been dealing with this issue of and on with my map I'm working on. (AOS) Basically almost every game, about 15 minutes in, the game freezes and then crashes. I've checking my handle count and it never goes above 9000. (lots of units on the map), and I've simulated a Memory leak...
  45. Uncle

    Creating a Unit that acts like a Tower (Pseudo-Building)

    Alright, so I'm trying to create a Unit with these properties (it's basically a Guard Tower with special behaviors): 1) It cannot move normally BUT it can be moved with triggers using SetUnitX/Y. 2) It cannot turn. 3) It cannot attack but it can acquire targets. I use a custom missile system to...
  46. TheDoener

    [Solved] The Trigger removes the unit in the wrong UnitGroup

    Hey all, i have a problem with my following triggers: The global variables are already created. function Trig_SetExplorationReward_Filter4() return GetOwningPlayer(GetFilterUnit()) == GetOwningPlayer(FlagUnit) and UnitAlive(GetFilterUnit()) == true and IsUnitType(GetFilterUnit()...
  47. TheDoener

    TriggerRegisterEvent not starting

    Hey all can someone tell me why this trigger isnt starting or repeating when the game starts? function Trig_Enemy_Spawn_Conditions() return udg_SpawnCap < 500 end function Trig_Enemy_Spawn_Func004Func002A() udg_TempLoc = GetUnitLoc (GetEnumUnit()) udg_SpawnCap = udg_SpawnCap +...
  48. Tasyen

    FourCC breaks in V1.31

    This a nasty bug happening only in the not upto date Warcraft 3 V1.31. And only for maps in Lua mode. After the game was Saved&Loaded FourCC stops working. This breaks any Unit/Ability/Item/Buff/Destruct/Terrain... Type comparer in GUI and written code. This does not happen in the upto date...
  49. Glint

    [Lua] Console Window at Runtime

    Hello! I had this idea since Blizzard implemented Lua and the custom user-interface in Warcraft III. When I was testing my other projects (Perlin Noise, File IO, Network), I'm using player chat event and Lua's load function as an input, DisplayPlayerTextMessage/print for output, to debug my...
  50. Kick King

    New to LUA, does this leak?

    Hey, so I'm fairly new to Lua and I created this unit spawning script for my map and it seems like my map keeps crashing around the same time every time I launch it. This is my first foray into Lua so I'm not super sure the things that I need to look out for or do to make sure that I'm not...
Top