Scripts / Multilevel question.

Author
Message
vrg
10
Years of Service
User Offline
Joined: 27th Aug 2014
Location: Netherlands
Posted: 17th Mar 2016 13:55
Creating a multilevel game where you have to collect stolen Aliens-in-cilinders. I created a script where a counter is counting down the collected aliens (alienincilinder = alienincilinder - 1), a second counter is counting the amount of collected aliens (allcilinders = allcilinders + 1). For example in level 3 I have to pickup 5 Aliens I only can find 4 Aliens, my allcilinder counter = 4.
I am going to the next level 4 , I am going to use a Alien in cilinder script with 8 Aliens but my allcilinders counter must be 4 for start. Is it possible to take amounts to different levels (global?) maybe to use one script to use in all the levels?

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Mar 2016 15:10
yes but you need to save it out to a file when the level ends and then read it when the next level starts... this will be easier to add once the save & load feature is added as we should be able to simply add it into the code there.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
vrg
10
Years of Service
User Offline
Joined: 27th Aug 2014
Location: Netherlands
Posted: 18th Mar 2016 07:37
Thanks smallg not so easy as I thought
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 18th Mar 2016 23:55 Edited at: 19th Mar 2016 01:51
I would look up lua functions on google. reading from and writing to a text file or data file.I don't know if this helps but these two pages of the lua site may help you here.
http://www.lua.org/pil/12.html and http://www.lua.org/pil/10.1.html#DataDesc

the second link shows how A lua program will read from a file. As for how to set this up in scripts on the gg map I don't know without a menu of sorts? If we could change(add to or take from what is loaded between each levels we could easily make this. . .
Markchapman10 is my Skype let's have some dev talk.
SounDesign
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 7th Apr 2016 00:08
Hi!

Actually with a LOT of help from smallGod, and some from Mookosh as well as numerous other snippets, I have arrived at a nice working set of scripts to create a nice hud, working on 'in level only values, which then get added to the overall value count. So I am pretty much doing what you seek.

Just I need to extract and reduce down all of my 'fluff' to get to something you can work with so give me a couple of days.

If you don't hear from me by all means prompt me by PM or email phil.sadler@adm.co.za with a reminder...


cheers for now

Phil
PM

Login to post a reply

Server time is: 2024-12-22 15:45:59
Your offset time is: 2024-12-22 15:45:59