• 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.

Any Tutorial on how to start using Lua scripts?

Level 6
Joined
Apr 15, 2016
Messages
118
For start importing and using Lua Scripts into my map, what do I need to do first? Or is it already automatically supported in 1.31?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Lua is supported in 1.31 and maps can be set to use JASS or Lua as their language... but not both. Scenario > Map Options > Script Langauge. You can only switch languages with that menu when the following are all true:
  • There are no 'custom text' triggers in existence (commenting out the whole trigger doesn't bypass this).
  • There is nothing in the map's Custom Text header (click the map name in the trigger list).
  • There cannot be any custom script lines at all in any remaining GUI triggers; disabling them directly does not bypass this.
So if you're deep in a project this may be annoying to change. I have no idea what happens if you try to export trigger data when the map is JASS and then import it when the map is Lua.
 
Level 6
Joined
Apr 15, 2016
Messages
118
Lua is supported in 1.31 and maps can be set to use JASS or Lua as their language... but not both. Scenario > Map Options > Script Langauge. You can only switch languages with that menu when the following are all true:
  • There are no 'custom text' triggers in existence (commenting out the whole trigger doesn't bypass this).
  • There is nothing in the map's Custom Text header (click the map name in the trigger list).
  • There cannot be any custom script lines at all in any remaining GUI triggers; disabling them directly does not bypass this.
So if you're deep in a project this may be annoying to change. I have no idea what happens if you try to export trigger data when the map is JASS and then import it when the map is Lua.
This absolutely sucks, the heck. No third party programs makes these work?
 
Level 6
Joined
Apr 15, 2016
Messages
118
I have no idea what you're trying to say. Those are the limitations. JASS and Lua are not the same language, and the trigger editor cannot alter text in custom triggers so how would it make things work properly?
What if there's a system that's only Lua, and it doesn't have a Jass version, or vice-versa, and you wanted both? Though I think that's not possible? Does any Hive resource maker actually make something in one language that it doesn't have a version in another language? I think not.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
What if there's a system that's only Lua, and it doesn't have a Jass version, or vice-versa, and you wanted both?
Then you figure out a solution or transpile one the resources to the language you want to use. I think you don't understand that this is a fundamental modification to the map itself at the second-lowest possible level. "Why can't my car run on both diesel and petrol? There are two different versions and I could have bought either." Because they are two entirely different combustion cycles and you can't have two things occupying that same fundamental space.
Does any Hive resource maker actually make something in one language that it doesn't have a version in another language? I think not.
Many such resources exist.
 
Top