Scripts / Help for new scripters - using NotePad++ - and a link to download

Author
Message
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 19th Jun 2014 10:10 Edited at: 19th Jun 2014 10:12
I see a few times on the Forum people are struggling with the new scripting language but it can be really simple and im just going to share a quick tip i use:



First up NotePad++, i find this very useful for scripting in LUA as it has full syntax highlighting support and automatically saving as .lua,



can get it from here: http://notepad-plus-plus.org/



so open up NotePad++ and open a script that you would like to reference to while you learn, for example i will just put here my character conditions script (hunger and thirst basically)

Note there is a much more heavily commented one in the forums if you would prefer to use that.







That script has a timer example, some declared globals and locals, and the basics functions_init and such i will cover this in a minute.



Once this is copied into NotePad++ you may wonder where the syntax highlighting is well, In the top left you will see a dropdown called Language, clcik that, scroll down to L, then select LUA, and see all the text come to colour and life, just jokes but it does make it easier to read. Now go to File New, again select the LUA language for the new page.



Now to make it easier to reference to the other script you have open you will see the 2 page tabs near the top left, right click on the one your working with and click Move to Other View, and bam you now have side by side views within the program and now you can start your script with a reference, i still do this with my cheat sheet type file of which here is an early version:







so some quick notes before you start your script, if your script is Called MyScript.Lua then in the script you must have:





grammer and spelling are critical prompt is not the same as Prompt

using NotePad++ over Notepad has the advantage of when you get a LUA error at runtime using reloaded it gives you a line number where it went wrong and you can quickly find that line number in NotePad++





Hope this helps somebody



p.s when you set language to LUA this is also what tells NotePad++ to save the file as a .lua

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home

Login to post a reply

Server time is: 2024-12-22 04:52:53
Your offset time is: 2024-12-22 04:52:53