Scripts / [GUIDE] Scripting guides

Author
Message
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th May 2017 16:37 Edited at: 8th Jun 2017 20:18
1. Scripting basics - Quick look at Entity properties (that effect scripts) and how to create your first script.
*please note, this is aimed at new users, if you have any experience with writing scripts you can skip it*



2. Displaying an entity name on screen - how to write your first script which will return an entity's name onto the screen in game.



3. Collecting an object for points - how to store points in a variable and increase them by collecting an object (also shows how to remove objects from the game world).



4. (continuing on from 3) How to gain points by killing enemy characters - learn how to use the exit(e) and your first multiple script variable change



5. Spend our collected points to unlock a door



*update: 08/06/2017 below*

show_points.lua


shop_keeper.lua


shop_weapon.lua


shop_ammo.lua


shop_health.lua


i've also made a few changes to the previous scripts (not edited above so as not to cause confusion with the previous videos) which can be found in the attachment (along with the new scripts and the map used in the new video *video coming soon*).

Making a basic game using the scripts we've learned so far.
*video coming soon ~ 2hours upload time*




---------------------------------------
Another good source of videos and tutorials can be found on the official GameGuru twitchcasts on youtube
and also check the link in my signature for a good written guide on scripting in GG

i will continue adding videos and tutorials as time permits and if others have any videos to add please do so.
if anyone has any suggestions or questions please post them (but i will try to keep my guides aimed at the simple scripts so requests for scripts that will take a long time to write or would be too confusing to follow will likely not be covered).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 20th May 2017 19:28 Edited at: 21st May 2017 14:37
Thank you.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 20th May 2017 19:53 Edited at: 20th May 2017 19:53
Thank you,this will help people like me who haven't got a clue when it comes to this .

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Jerry Tremble
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 21st May 2017 00:45
What Dave said! Thanks yet again!
Desktop: i7 4770@3.4Ghz (passmark 9809), 12GB RAM, Win 10/64, GeForce GTX 1080 (passmark 12006), 1TB SSD, 1TB HDD; Laptop: i7 4800MQ@2.7Ghz, 16GB RAM, Win 10/64, GeForce GTX870M , 1TB SSD.
PM
warlock12
7
Years of Service
User Offline
Joined: 12th Sep 2016
Location: Argentina
Posted: 21st May 2017 14:04
Valued Member... No more words... Eternal Valued Member!!! Ty Small... You are a teacher.
The game is a serious thing (El juego es una cosa seria)
devlin
10
Years of Service
User Offline
Joined: 12th Feb 2014
Location:
Posted: 21st May 2017 16:51
big thanks from me
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st May 2017 17:10 Edited at: 21st May 2017 18:52
Curious if I should comment the scripts as I go (will likely mean shorter videos or upload in parts though as if videos get too long it will take me forever to upload them due to my slow internet) or if it would just be more helpful to do a quick section on how to comment your own scripts and let you guys add them as you need to?
I will continue to provide the scripts anyway so you can always write your own while you follow the videos (as you don't need to focus on typing out the scripts themselves).

edit, updated the original post with a new guide on using our gained points to unlock doors
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st May 2017 19:18
Quote: "Curious if I should comment the scripts as I go "


That would be good for me,but at the end of the day it's what works best for you I think.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 21st May 2017 19:42
Cracking idea smallg just what the community needs cheers m8
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
Szabi
8
Years of Service
User Offline
Joined: 25th Oct 2015
Location:
Posted: 23rd May 2017 20:06
Thanks for helping!
PM
seppgirty
Game Guru Backer
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location: pittsburgh, pa.
Posted: 27th May 2017 14:41
These videos are great. Love how you are starting simple. Thanks a bunch.
Windows 7 Home Premium Service Pack 1.Intel core i5-2300cpu @2.80 GHz 2.80 GHz
RAM 16 gb G-Skill G.SKILL Ripjaws Series 16GB (4 x 4GB) 240-Pin DDR3 SDRAM DDR3 1066 (PC3 8500) Desktop Memory

AMD Radeon HD 6670. ASUS Radeon HD 6670 DirectX 11 EAH6670/DIS/1GD5 1GB 128-Bit GDDR5 PCI Express 2.1 x16 HDCP Ready Video Card. 1GB 128-Bit GDDR5
Memory Size
1GB

Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 5th Jun 2017 18:26
Thank you for these! The more I can learn about scripting the better because I know basically nothing!
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Jun 2017 20:19
updated and added a new video - longer video, less code focused & more focused on getting the scripts working together in your level along with the new shop system.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Flatlander
GameGuru Master
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 8th Jun 2017 22:46
Good stuff m8.
When in doubt -- C4 :heh, heh, heh:

-Jamie Hyneman
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th Jun 2017 16:51
Nice help mate.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM

Login to post a reply

Server time is: 2024-04-26 17:55:41
Your offset time is: 2024-04-26 17:55:41