• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Global Lua variable with newline

Status
Not open for further replies.
Level 11
Joined
Apr 27, 2009
Messages
223
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 74
Joined
Aug 10, 2018
Messages
7,957
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