• 🏆 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!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

How to write Lua code in Warcraft 1.24

Status
Not open for further replies.
Level 2
Joined
Aug 18, 2018
Messages
8
Writing code in vJass is slower than that in Lua, so I am wondering if Lua can be run in 1.24? In other words, is there a tool that can convert Lua language to vJass or Jass?
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,853
There is only convertion from jass/vjass to lua, not the inverse, it's impossible. And this convertion is only possible since on one of the patches I've mentioned in my last post.

Your 1.24 map can be opened in 1.25 1.26 and so on to 1.32 version, just update and you'll be able to use lua.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,170
If the map cannot be opened in newer editors it might be a good idea to seek help migrating it rather than trying to use features that did not exist in a legacy version.

If the map cannot be opened in the editor due to trigger data issues that is usually caused by custom GUI actions such as were added by WEU and JNGP. In that case you can use the "fixer" tool GhostWolf wrote which replaces such unsupported actions and functions with lines of supported custom script.

Once the map can be opened in the current version of World Editor, you can then port the code Lua using one of the third party converters. This is not required though as depending on what is incompatible you may be able to fix it in JASS so the map is playable once again.

The reason porting Lua to JASS is not really possible is due to the language feature differences between Lua and JASS. Lua is a lot more powerful of a language than JASS. Sure with a lot of hackery it might be able to emulate parts of Lua reasonably well, but there will always be unsupported features and chances are the emulated performance will be abysmal. Porting from JASS to Lua is supported due to Lua supporting most of what JASS can do and also Blizzard adding additional natives to support the features that Lua does not support directly.

An example of a feature that would be near impossible to implement is the dynamic compilation and execution of Lua source code. Not only would a JASS implementation of a complete Lua parser be required to emulate this, but since it is emulation rather than running native the performance will be abysmal. Even something like Lua tables would be very complicated and slow to simulate fully using JASS.
 
Level 2
Joined
Aug 18, 2018
Messages
8
If the map cannot be opened in newer editors it might be a good idea to seek help migrating it rather than trying to use features that did not exist in a legacy version.

If the map cannot be opened in the editor due to trigger data issues that is usually caused by custom GUI actions such as were added by WEU and JNGP. In that case you can use the "fixer" tool GhostWolf wrote which replaces such unsupported actions and functions with lines of supported custom script.

Once the map can be opened in the current version of World Editor, you can then port the code Lua using one of the third party converters. This is not required though as depending on what is incompatible you may be able to fix it in JASS so the map is playable once again.

The reason porting Lua to JASS is not really possible is due to the language feature differences between Lua and JASS. Lua is a lot more powerful of a language than JASS. Sure with a lot of hackery it might be able to emulate parts of Lua reasonably well, but there will always be unsupported features and chances are the emulated performance will be abysmal. Porting from JASS to Lua is supported due to Lua supporting most of what JASS can do and also Blizzard adding additional natives to support the features that Lua does not support directly.

An example of a feature that would be near impossible to implement is the dynamic compilation and execution of Lua source code. Not only would a JASS implementation of a complete Lua parser be required to emulate this, but since it is emulation rather than running native the performance will be abysmal. Even something like Lua tables would be very complicated and slow to simulate fully using JASS.
Your reply help me a lot. Thank you!
 
Status
Not open for further replies.
Top