Scripts / adding functions to global.lua

Author
Message
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 19th Aug 2016 03:02
If i add my own function to the global.lua will i be able to call it in all of my scripts? If not thats fine ill call it elsewhere but I figured adding them to one spot it would be better for game development, when I release my system pack ill include the function in the scripts. IF this is possible....
Markchapman10 is my Skype let's have some dev talk.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 19th Aug 2016 08:26 Edited at: 19th Aug 2016 08:28
Yes but you shouldn't do it because whenever there's an update global.lua will be overwriten.

You can just put them all in one script, call it say myglobal.lua, and add that to a barrel in your game.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
AmenMoses
GameGuru Master
9
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 19th Aug 2016 19:39
I have my own global.lua which I save off before updating GG then put it back afterwards.

Mind you I also have all my own versions of nearly all the scripts as I have re-written most of them.

But to answer your main question, yes if you add it to global.lua it can be called from any other script.
Been there, done that, got all the T-Shirts!
PM
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 20th Aug 2016 09:31
Lol, ive modified a few of my scripts as well. like the health script. ( until I added the perks and inventory now I dont even use any of the items other then the ammo but ill have my own ammo scripts soon with other perks that are added to the stats.
Markchapman10 is my Skype let's have some dev talk.

Login to post a reply

Server time is: 2025-04-20 05:27:50
Your offset time is: 2025-04-20 05:27:50