Scripts / Script for item database? survival looting objects ect..ect..

Author
Message
McTank
8
Years of Service
User Offline
Joined: 2nd Mar 2016
Location:
Posted: 8th Mar 2016 14:14
Wondering if there is a script that works on GG for an item database instead of manually throwing items in as entities?? how would I go about doing this, any help would be great, I've already learned so much from this forum so thanks for that as well.

You're welcome to comment on here or PM me
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th Mar 2016 14:10
I'm not quite sure I understand your question correctly (sorry, english not my first lang)
1- You want to have all the items listed in a database.
2- You just want to have the items used on a map.

You want to work with this database during the game.

In either case you should keep in mind that GG constantly updates the data thru loops, which do not stop working, until you close the game.
Working with a database either MS Access, Excel or SQL, on flight, demand a lot of resources; since GG it would constantly create queries, for each of these elements.

Create a database, or even a sheet / book excel with all relevant data is not so difficult, simply dump the data from the "Guru-MapEditor.log" file to a text file (using regular expressions, or something else), then create a table / excel with this file, then create macros that auto-updating the database, etc.

But as I said above, this is not very profitable because GG must constantly update data; even when you have the program minimized in the taskbar.

Open file Explorer, locate the "GameGuru" folder and look at the "Guru-MapEditor.log" file, you will see a constant activity in the file.

If you want an example, about excel, you can take a look at this link:

https://forum.game-guru.com/thread/209929

hth

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

PM
McTank
8
Years of Service
User Offline
Joined: 2nd Mar 2016
Location:
Posted: 9th Mar 2016 15:14
I'm not entirely sure this answers my question, I don't know much about using those programs. nonetheless maybe if you pm me I can break down what I'm trying to do in my game for you to better understand what I am aiming for. thanks!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th Mar 2016 19:23
Perhaps if you realize out, what you are looking for, might help; so, everybody can help you, not just me.

The only think I know, is than if you want deal with DBs, you need some knowledge about it.

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

PM
McTank
8
Years of Service
User Offline
Joined: 2nd Mar 2016
Location:
Posted: 10th Mar 2016 16:13
ei" I want to place an entity such as "dresser with a search script" then want a random item to be found and either accepted or choose not to except it option. is what I am trying to accomplish.
PM
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 11th Mar 2016 00:57 Edited at: 11th Mar 2016 01:00
I'm trying to figure this out myself, but I think that A lua table would probably work as a database but i haven't had much time to look into it because of work and all that... I'm going to play with some things this weekend. I don't know what gg can do with lua.

Have a table, in the table store your item names, have the table a global so it can be accessed through out the game for the search script. this is what im going to try to do anyways its theory.. we need Smallg lol...
Markchapman10 is my Skype let's have some dev talk.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Mar 2016 04:26
You need an array or table as I've heard it called in lua. I've not had much luck with this myself. I have got most things working fine with a single dimension array, but in this case you really need a multi dimensional one. Check out arrays in lua and you should find some info.



That's an example out of the reference guide. I can't help much more than that as I haven't yet used them in GG. Useful for many things when you get making games and of course a database.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 11th Mar 2016 14:13 Edited at: 11th Mar 2016 14:48
I googled lua arrays and got the tables but The tables can store different kinds of data so I figured that they would work maybe better.
Markchapman10 is my Skype let's have some dev talk.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Mar 2016 14:53 Edited at: 11th Mar 2016 14:56
That's because they are the same thing when it comes down to it, a way to store data.

Quote: "We implement arrays in Lua simply by indexing tables with integers"


Lua is a bit convoluted for me in comparison to DB or AGK for instance. The above code snippet would only need this sort of thing in both the aforementioned languages.



You can see that is far simpler than having to make 2 for next loops just to create it. Still, not a problem really just different. I have had a look and got a simple 2 dimensional array working and storing data fairly easily using the above example (my first post) and a little extra to add data in rather than just 0 in all the elements. Works fine and could be used for any data you want, lua seems quite flexible in this regard.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Mar 2016 14:54
Dvader gave the example for how this would work.

You need to store everything into arrays first and then use a method to retrieve a value (math.random(#,#) is good)

This is one of those scripts that's better to do yourself as you know how you want it to work and depending on how much detail you want to put in can become quite large very fast (item weight, carry limit per item and also total carry weight limit, chance to appear, name, quantity that appears... Etc)

If you're hesitant about posting details of your requirements then you will need to find someone capable and PM them to help on a personal basis as I feel there isn't enough information here for someone to realistically help you with a finished script (they could certainly start).
On that note, I personally can't help right now but will be happy to help you out if you start and get stuck, sorry
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
McTank
8
Years of Service
User Offline
Joined: 2nd Mar 2016
Location:
Posted: 11th Mar 2016 18:38
Thanks guys, that is greatly helpful just to know that this is a possibility through GG, Problem is I am not script maker or coder soooo that draws an issue for me, I know how I want my game to look and what I want it to do! but...... making it do what I want is entirely more difficult than making it look the way I want.
If someone could help me personally on this "array table" I would be most appreciative thanks again guys!.
PM
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 12th Mar 2016 00:40 Edited at: 12th Mar 2016 00:46
Making it yourself would be better though since, like smallg said you know everything about it. you can get it you just need to play with lua. this also helped me thanks for the post. I'll post anything I get if it helps you tank and maybe we could leave this post open to show progress of our stuff tank. If you want your script public that is.

All A inventory is is a series of variables, what im going to do is make a list(table)
1.health_pack
2. item 2
3. item 3

when I pick up say the health pack the health pack script will change the table to give me one of item one.
as it stands now i have a problem with buttons, there isn't enough buttons that we can use for lua.
Markchapman10 is my Skype let's have some dev talk.
McTank
8
Years of Service
User Offline
Joined: 2nd Mar 2016
Location:
Posted: 12th Mar 2016 13:43
MChapman, I'd appreciate that.. Yeah I'd definitely share my progress here if this thread stays open I'm sure we could help more than just you and I create some pretty awesome luas.
Yes see but this for me won't be an inventory, they'll be items you can find for your inventory but not freely given in my game.
I'll have to create some sort of table database that consists of a list of every "Item entity" I have to use in this game to be "found" and to get real crafty figure out a way to persuade the script to give a %finditem to make it more interesting.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Mar 2016 17:55
creating a basic inventory is simple, the hard part is actually using the items.

the inventory;
player_inventory.lua


and the code to find an item
loot.lua




this should put you on the right track at least, good luck
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
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 13th Mar 2016 18:16 Edited at: 13th Mar 2016 18:18
Above and beyond smallg, above and beyond.Thank you for this!
edit: by the nine divine smallg lol.. thank you.
Markchapman10 is my Skype let's have some dev talk.
Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 13th Mar 2016 19:53
A inventory is the most requested feature in GG, I not understand why nobody wrote a real good one. Why nobody want to earn some money here
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 14th Mar 2016 02:20 Edited at: 14th Mar 2016 02:39
I fixed the problem I guess it was somthing that I did......... lol, resolved.
Markchapman10 is my Skype let's have some dev talk.
McTank
8
Years of Service
User Offline
Joined: 2nd Mar 2016
Location:
Posted: 16th Mar 2016 16:20
Smallg that's an amazing job you did bro, I am extremely appreciative. kudos my friend what a big help!
PM
McTank
8
Years of Service
User Offline
Joined: 2nd Mar 2016
Location:
Posted: 16th Mar 2016 16:26
How come I am not prompted with the option to "e" loot "object" still? what am I doing wrong.. I loaded the loot.lua into the objects and put the player_inventory.lua on a random object.. whats up? help me out here I am apparently illiterate.
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 16th Mar 2016 17:30
Have you set your loot items to dynamic? (static = no)

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 25th Mar 2016 20:53
If this wasn't resolved, I would make sure that the loot and player inventory scripts are both in dynamic entities and they are always on.
Markchapman10 is my Skype let's have some dev talk.

Login to post a reply

Server time is: 2024-12-22 15:23:39
Your offset time is: 2024-12-22 15:23:39