Scripts / Scripts for GameGuruMax

Author
Message
grinseengel
8
Years of Service
User Offline
Joined: 27th Jul 2015
Location:
Posted: 9th May 2022 10:25
Hello, I bought the Quest system for GameGuruMax today. I need help to assign the scripts to an object. I copied all the scripts into the script bank. However, I can't assign a new script to an object in the editor. What am I doing wrong?
grinseengel
8
Years of Service
User Offline
Joined: 27th Jul 2015
Location:
Posted: 9th May 2022 10:55
I apologize for the spelling mistakes in my post topic. Maybe an admin can correct this?
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th May 2022 12:35 Edited at: 9th May 2022 12:38
@ grinseengel
Any script to be shown in GGMax has to have a header, something such as:
Quote: "--Description: what my scrip does"

Copy and paste these lines on your script header.

And about the mistakes, just click on the "Edit" button, then you can edit your post.

Edit: as said above I pressed the EDIT button, and now I'm editing my post, just to add something that most help to you.
Create a folder named "USER" in your docs/GameguruApp>Scriptbank folder, and store your custom scripts there.
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
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 9th May 2022 12:35
if the object doesn't let you assign a script you need to enable physics mode on the object.
if the script isn't appearing in the list of possible scripts you need to add --DESCRIPTION: "script description" as the first line of the script
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
grinseengel
8
Years of Service
User Offline
Joined: 27th Jul 2015
Location:
Posted: 10th May 2022 12:41
Thank you for the info. Now I have been able to insert the scripts. However, the Quest system does not work flawlessly. The script is from ACID. So I'm not sure if you can help me now. Anyway, I get the following error message when starting:scriptbankAcidquest_collect_destroy.lua:38 attempt to index global 'quest_type' (a nil value). I have already tried renaming the objects, but without success. Do you have an idea? Acid unfortunately does not respond to my posts.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 10th May 2022 18:25
@ grinseengel
I don't own that script and you can't post it here; so, the only one that can help you is the author of the script.
Sorry, if I can't help you with that issue.
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
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 11th May 2022 08:49
Quote: "Anyway, I get the following error message when starting:scriptbankAcidquest_collect_destroy.lua:38 attempt to index global 'quest_type' (a nil value). I have already tried renaming the objects, but without success."


Yeah, renaming things rarely works.

The script(s) obviously use a global list called quest_type so somewhere in one of them there will be (or should be) a line:

quest_type = {}

In any script that accesses this list you should also add the line:

quest_type = quest_type or {}

(in fact it will do no harm to add that line to the top of all the scripts that access the list)

What that line does is create a global list called quest_type if one does not already exist, if one does exist it simply creates the list and initialises it to the contents of the existing one.

That is the correct way to deal with globals btw.
Been there, done that, got all the T-Shirts!
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 11th May 2022 15:49 Edited at: 11th May 2022 15:52
Hello everybody,

About the global variables I want to share this with this community.

I had a moment of inspiration to discover why I got an error message relative to my attempt to apply a behavior to an entity .
Indeed I found that the engine is reading each behavior in a sequential order defined by the ID number in the object list.

Example :
step 1 : global variables are defined in a behavior applied to the object #10 in the object list.
step 2 : a behavior applied to the the object #2 tries to read a global variables defined in step 1 : an error message appears because that variable is not yet read and stored by GameGuru MAX engine.
step 3 : same process as tried in step 2 but now it is applied on object #12 : successful execution of the level.

Demonstration with a video published on my Vimeo account ( 1 minute 37 seconds = 80 MBytes, HD, no sound , secured and anonymous access ) : https://vimeo.com/708666507
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 11th May 2022 22:14
Quote: "I had a moment of inspiration to discover why I got an error message relative to my attempt ... etc"


And the proper way to handle global variables that avoids this issue is in the post directly preceding yours!
Been there, done that, got all the T-Shirts!
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 12th May 2022 00:41
Global vars need a plan B to avoid headaches.
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
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 12th May 2022 10:10
@amenmoses posted this :

Quote: "I had a moment of inspiration to discover why I got an error message relative to my attempt ... etc"
And the proper way to handle global variables that avoids this issue is in the post directly preceding yours!

Hello AmenMoses I previously read your advice before posting my previous comment and I admit its pertinence for the majority of cases.

However I don't think it could be doable if one is dealing with a large number of global variables.
In my project a single script is capable of controlling random animation of a large number of objects.



PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th May 2022 16:14
Quote: "However I don't think it could be doable if one is dealing with a large number of global variables."


If you have a large number of globals then you are doing something wrong, I very rarely use global variables because they are very inefficient.

Been there, done that, got all the T-Shirts!
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 12th May 2022 20:57
Quote: " If you have a large number of globals then you are doing something wrong, I very rarely use global variables because they are very inefficient."


Good to know. Thank you.
PM

Login to post a reply

Server time is: 2024-05-01 23:10:46
Your offset time is: 2024-05-01 23:10:46