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

Global Lua variable with newline

Status
Not open for further replies.
Level 11
Joined
Apr 27, 2009
Messages
213
In Jass set udg_newline = "\n" is for a newline. udg_ is for global in Jass? I need a newline String in Lua that is Global but I don't know how global variable are made in Lua. Could someone help me out?

How could someone edit a Variable made in Trigger with Lua?

This is in Jass
brisi4.png
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,389
If you want to reference a GUI variable in Jass/Lua you need the "udg_" prefix, otherwise it's unnecessary.

To create a new Lua variable in GUI you would do this:
  • Custom script: newline = "\n"
Note how Lua doesn't use call or set.

If you want it to be a local variable simply add local before it's name.
  • Custom script: local newline = "\n"

Some other differences between Jass and Lua:
Null becomes Nil, FourCC() must be called when referencing rawcodes, endif becomes end, ' ' becomes " ", and many more.
 
Last edited:
Status
Not open for further replies.
Top