Product Chat (Early Access) / My First Behavior for GameGuru MAX (version 2021-11-19)

Author
Message
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 27th Nov 2021 13:20
Hello,

As I previously wrote in my other topic (Huge Landscape ... ) I am a big zero in LUA scripting.

That's why I decided to start with a very, very basic script that I imported in the "Behaviors" (/scriptbank) of GameGuru MAX Editor.

I shared that script and a very compact standalone demo (zipped file = 151 MBytes) where that script is included.
Each time that the key "E" is pressed the animations are played.

The content of that demo was created by myself (that "K.I.S.S." script and the animated meshes) and it is free to use by everybody for any purpose.

Thanks for paying attention to this thread.

Link : [href]null[/href]https://1drv.ms/u/s!AjokN1FU3jK1l3aJkFghkjGfxFeR?e=wDrcQf

Attachments

Login to view attachments
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 28th Nov 2021 17:34 Edited at: 28th Nov 2021 18:52
The "global.lua" file is a source of inspiration.
I found there the "g_InKey" command and I was tempted to try it in a new script.

1) my tools for that new experiment :
- GameGuru Classic and its huge content of meshes and animations.
- FragMotion (licensed version 1.3.5 or 1.3.6 - not the latest version 1.3.7, because it doesn't handle the .DBO format anymore).
- ShaderMap Pro Commercial : to create additional texture maps.
- PHiSearch : a superb search engine with which you can find any occurence of a specific string inside the files ( preferably with ascii content) of a folder and its subfolders. That tool works at the speed of light.

2)
- Selection of the "unarmed goblin" in the "characters" of the "fantasy pack" of GameGuru Classic.
- Problem : GameGuru MAX cannot import properly the animation's track of that avatar.
- Solution : FragMotion 1.3.5 loads perfectly that animated avatar.
- "unarmed goblin" saved in .DBO and in .OBJ format.

3)
- Import of the "DBO" file in GameGuru MAX" (see screen capture relative to the import)

- Careful split of a part of the whole animation into a few tracks identified with a short name ("a1","a2" ... "a6" ... "a7 is not used).

4)
- Search for the string "g_InKey" in GameGuru MAX scripts folder with the tool PHiSearch.
- good fishing (see screen capture)


5) Creation of a behavior using that command :



6) ShaderMap : Creation of additional textures maps for the "unarmed goblin" (see screen capture)


7) Map and Game Project saved -> Test Standalone -> OK ( keys 1 to 6 of the numpad respectively activate the animation tracks "a1" to "a6").

End of my second study day on Lua scripting in GameGuru MAX.

(my new rating : 0.1 on a scale of 100).

PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 28th Nov 2021 17:52
Quote: "FragMotion (licensed version 1.3.5 - not the latest versions, because they don't handle the .DBO format anymore)."

v1.3.6 handles DBO, it's v1.3.7 that doesn't.

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++ VS2019, SQL, PL-SQL, JavaScript, HTML, Three.js, others
Hardware: ULTRA FAST Quad Core Gaming PC Tower WIFI & 16GB 1TB HDD & Win 10 (x64), Geforce GTX1060(3GB). Dell Mixed Reality VR headset, Aerodrums 3D
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 28th Nov 2021 18:55
Bored of the Rings, thank you for your clarification.
My previous comment was edited to correct my mistake.

(By the way, I noticed that you regularly post comments relative to FragMotion in this forum. I am curious to know if you could be the developer of that powerful application.)

PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 28th Nov 2021 19:01 Edited at: 29th Nov 2021 10:47
Quote: "(By the way, I noticed that you regularly post comments relative to FragMotion in this forum. I am curious to know if you could be the developer of that powerful application.)"

Absolutely not
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++ VS2019, SQL, PL-SQL, JavaScript, HTML, Three.js, others
Hardware: ULTRA FAST Quad Core Gaming PC Tower WIFI & 16GB 1TB HDD & Win 10 (x64), Geforce GTX1060(3GB). Dell Mixed Reality VR headset, Aerodrums 3D
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 30th Nov 2021 00:41
@ mikeven
Your code with a bit of modification.


I'm running 6 animations from the door; animations will be prompted as 1-6.



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: 30th Nov 2021 05:54
3com, thank you very much for posting your nifty script.
I like your demo shown with your video. Nice work.
I truly appreciate your assistance and I'm convinced that such one could please anyone who is studying LUA scripting in GameGuru MAX.

Now, thanks to you, on day #3, my new level of knowledge of LUA in GameGuru MAX is rated 0.2 on a scale of 100.
I would be happy if it could be rated 10 within a few months.



PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 30th Nov 2021 13:23
@ mikeven
Glad to help.
Just compact your code a bit, so, if you need let's say run 9 animations, you just have to change:
i=1,6,1,do, should looks as: i=1,9,1,do
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: 1st Dec 2021 21:02 Edited at: 2nd Dec 2021 04:00
Today I studied how to control the animation or the motion of three entities in the same scene.
I encountered a problem and I'll try to find a solution (if this one is available) : when an entity is moved by an imported animation, its collision cage doesn't move with the entity. It stays as a ghost on the initial place of the entity. Therefore every other entity in the scene can move through that animated entity.

[video=vimeo]https://vimeo.com/652189387[/video]

Thanks for watching.

(more comments later about that new experiment)


Edited later (after AmenMoses comment) : This is the script inside the behavior in that scene :
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Dec 2021 23:04
local anims = { "1" = "anim-one", "2" = "anim-two" ... etc }

local anim = anims[ g_InKey ]
if anim ~= nil then SetAnimationName( e, anim ); PlayAnimation( e ); end

Oh and you might need:
MoveWithAnimation( e, 1 )
Been there, done that, got all the T-Shirts!
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 2nd Dec 2021 04:33 Edited at: 2nd Dec 2021 04:34
Hello AmenMoses,

Thank you very much for your assistance.
I often watched your threads in the section "GameGuru Classic" relative to your huge collection of LUA scripts.

The main difficulties for a new user of a game engine are :
- learning the "vocabulary" of the scripting language used in that game engine.
- discovering the possible connections of a script with the main application.

The purpose of this topic that I humbly submit to this community is to show how much it is difficult to write a script ( a kind of "plugin") when you don't have a manual describing each available instruction.

I admit that I am trying to use GameGuru MAX in a deviate way because it seems that the developers want to offer a game engine mainly to users who don't have programming skills.

Sometimes I "play" with Dark Basic Pro and I consider that it is easy to write some nice little programs with it because the documentation is fully implemented inside the editor.

Scanning the code inside the existing scripts to try writing a custom one is not a solution.
Some gurus of this community are providing tools to enhance the possibilities of GameGuru (Classic or MAX).
You, AmenMoses, a Lua scripting guru, you could be the right person to provide a decent documentation relative to LUA scripting inside GameGuru MAX.

the Chinese proverb: Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.

I could say the same about the collection of scripts that you so generously offered to this community.
Sometimes when I look inside the code of a program that I wrote a long time ago, even if it is correctly commented, I have to spend a long time to understand ( to remember the logic of ) all its entanglements.
A script written by an expert is never easy to understand by a beginner.
But the teachings of an expert are priceless.

I posted this comment with all my sympathy for you.

PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 2nd Dec 2021 11:49
Comment relative to my previous experiment with a behavior controlling the animation or motion of three entities in the same scene.

1)
AmenMoses lines of codes are nice. Indeed using a local table to store the data relative to the identification of the animations is a clever choice and it provides a better structure to the code.
The condition "if anim ~= nil" avoids a crash of the script if the user presses a key other than a numkey, because a key corresponding to a letter couldn't be converted to a number in my script.

2)
I noticed that the entity "Goblin" doesn't appear with the PBR textures that I applied to that animated mesh when I imported it in my custom assets.
Now I remember these points :
- GameGuru (Classic or MAX) materials works preferably with the textures created in .DDS format.
- Avenging Eagle, a valued member of this community, published a beautiful guide to texture optimisation : https://forum.game-guru.com/thread/222504
- Following the advices of Avenging Eagle, I imported a new version of that asset with PBR textures created in DDS format (version DXT1 = BC1) (https://wiki.beyondskyrim.org/wiki/Arcane_UniversityDS_Data_Format because the material of that entity doesn't require an alpha channel. ShaderMap Pro is currently limited to the DDS formats DXT1, DXT3 and DXT5.

3)
- Modifying the placement of an entity with an animation created with an external application and included in its DBO format could be a wrong choice.
- I tried again the command "MoveWithAnimation" suggested by AmenMoses, ( I previously found that command in the "global.lua") but it seems that it cannot bring the solution to the problem of the collision cage not moving with the entity. It is quite possible that I'm misusing that command.

4) Yesterday I updated GameGuru MAX to the latest version (2021-11-26) but I was constrained to revert its installation to the version (2021-11-19) because each time that I tried to run a standalone game, it wasn't played and a error message (code 7008) appeared.
I'll report that problem to the GameGuru Repo on GitHub.


PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Dec 2021 17:51
Lua manual is freely available online: https://www.lua.org/manual/5.2/

GG uses 5.2 IIRC, I don't think Lee has changed that in MAX but it is a fully backwards compatible language so anything written for 5.2 should work fine in 5.4 for example.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Dec 2021 22:04

Quote: "The condition "if anim ~= nil" avoids a crash of the script if the user presses a key other than a numkey, because a key corresponding to a letter couldn't be converted to a number in my script."


Amen gyve you just an idea, but Amen's script is not yet complete, i.e.
The condition "if anim ~= nil" don't avoid a crash of the script by itself, due it has to check that value before checking the condition, as for example here:
local anim = anims[ g_InKey ]
if as for example you press the W key so, it will look such as:
if anim ~= nil then SetAnimationName( e, "W" )
Here anim is not a nil value, is just a wrong value, since the code doesn't expect "W" as desired value, but 1, 2, 3, etc.
You have to check first whether the entered value is a numeric value (Type(g_InKey )) if it is within the range (1-n), and son; of course you will have to take a look at the LUA manual Amen linked above.
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: 2nd Dec 2021 22:07
Quote: "The condition "if anim ~= nil" don't avoid a crash of the script by itself"


Um, yes it does!

If there is no match for anim = anims[ g_InKey ] then anim will be nil!
Been there, done that, got all the T-Shirts!
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 3rd Dec 2021 10:09 Edited at: 3rd Dec 2021 11:23
AmenMoses and 3com,
Dear fellows of this community,
I hope that you have a good sense of humor when you'll watch this movie "The Two Guards, Two Doors Riddle" on YouTube :


But, first of all, I want to apologize for having posted my previous script containing that awful "mish-mash" without any clear explanation of its content.

This is the revisited code taking into consideration AmenMoses and 3com comments.
I want to thank each of them for their willingness to assist me on my uneasy way to the knowledge of Lua scripting.


(this script was successfully tested --> however when I click a second time on the same key of the numeric keypad - for instance the key "2" - then the animation clip of the entity "Goblin" cannot be repeated. That animation clip is reactived if I select another animation clip of that entity. That problem doesn't occur for the entity "#1 movex10m" probably because it contains only one animation clip -> to meditate ... )




Explanation of the purpose of my script (the revisited one) :

1) screen capture showing the entities present in the scene :


2)
Using my terminology :
The Family ( or Class or Object ) "Goblin" contains two members identified by :
- their Family name in the "Object Properties Panel"
- a "identifying number #n". "#n" being an integer automatically defined by GameGuru MAX when the entity was introduced in the scene.

When I studied a little bit the instructions (commands) contained in the LUA scripts of GameGuru MAX, I noticed the use of (e) to anonymously designate an entity.
That (e) may be replaced by the "identifying number #n" to apply a command to a specific entity of the scene.

Example in that scene :
- I want to animate the second animation's clip (of a serie of six) of the entity "Goblin" having the identifying number "6".
- For that purpose, I want to remember the names of the animation's clips that I attributed to that entity when I imported it into GameGuru MAX (in my custom assets folder).
- In this case, I attributed the name "a2" to the second animation's clip of the entity "Goblin".
- My behavior sends this "message" to the main program of GameGuru MAX :
SetAnimationName(6,anim) ---> where "6" is the entity "#6 Goblin" in the scene, and "anim" is the animation clip "a2" of that entity.
PlayAnimation(6) ---> the animation clip "a2" of the entity "#6 Goblin" is played once each time I click on the key "2" of
the numeric pad of my keyboard.

3) The script inside that behavior is indeed a "mish-mash" because it contains the commands to activate animations clips OR a motion for three distinctive entities. That's not a good way to write a script that could be readily understood by any programmer (beginner or not).

4)
- In order to write LUA scripts for GameGuru MAX, the programmer needs to learn the basic concepts of LUA (found in Lua 5.2 Reference Manual, as kindly mentioned by AmenMoses).
- But the knowledge of the instructions specific to the main program of GameGuru MAX with which the Lua scripts can interfere ( I could say in my own terminology : "can find the connections to establish a dialogue") is also a requirement.

5)
To conclude :
- I want to confirm my assumption : the physic engine ("Physics on" activated in the "Object Properties Panel") cannot detect the position of an entity if this one was moved by an animation clip. How could it detect that ? In that experimental project, the entity "movex10m" is an imported animated mesh moving 10 meters forward. I think that the physics engine ignores that parameter stored in the .DBO file of the animated entity.
- All of us (the early adopters of GameGuru MAX) are testing alpha versions of that new game engine. There are bugs (unresolved old ones and probably new ones will appear) that could lead to misinterpretations.

Thank you very much for reading this long comment.

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd Dec 2021 11:26 Edited at: 3rd Dec 2021 11:27
You should avoid using explicit entity Ids, they are not guaranteed to stay the same!

Instead you can use the name of an entity to differentiate it from others, i.e. use the _init_name function instead of _init and store the name in a global list that all functions can access.

Been there, done that, got all the T-Shirts!
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 3rd Dec 2021 16:37 Edited at: 3rd Dec 2021 16:45
AmenMoses, thank you again. Your code snippet is excellent !
It helped me to understand that an entity present in the scene knows the id number assigned to it by the main program.

Here is the content of my behavior including your new lines of codes.
Of course, the script of that behavior is saved in this file "test.lua" in the "../scriptbank/objects" folder of GameGuru MAX and I also created two new thumbnails with the same prefix as the .lua file (by the way, I don't know why a second .png thumbnail is required).



PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd Dec 2021 18:12
If you put them in the main MAX files folder they will get deleted on update so make sure you put them in the one in your Documents folder!
Been there, done that, got all the T-Shirts!
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 3rd Dec 2021 19:05
Quote: "If you put them in the main MAX files folder they will get deleted on update so make sure you put them in the one in your Documents folder!"


Indeed, I know it and it is good to mention that point for the users reading this thread, who would experiment with their own behaviors.

As far as I discovered, when I placed my custom behaviors in my "Documents/GG Projects/" folder, the editor couldn't locate them.
That's why I placed those behaviors in the "scriptbank/objects" folder created by the Installer of GG MAX.

I'm still experimenting with the update 2021-11-19.

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd Dec 2021 19:47
They need to be in the documents files/scriptbank folder, if there isn't already a folder there create one.
Been there, done that, got all the T-Shirts!
PM
Ratall
16
Years of Service
User Offline
Joined: 29th Jun 2008
Location: Not Here
Posted: 4th Dec 2021 00:46
Hi
If you have 2 scripts with the same name one in document files script folder and one in main script folder which will be executed?
For example if I wanted to create a customised global.lua can I place it in the document files script folder and know it will both be executed and not overwritten by an Update.
Thanks
Rick
“Everything should be made as simple as possible, but not simpler.”
Albert Einstein
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th Dec 2021 01:11
I assume the one in the documents area takes precedence.
Been there, done that, got all the T-Shirts!
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 4th Dec 2021 08:09 Edited at: 4th Dec 2021 20:41
Hello,

Please, please, remember that I'm a beginner in Lua Scripting.
Furthermore I am testing scripting in GameGuru MAX with the guess method while I am glad to accept advices of members having a deep knowledge of GameGuru.

Therefore I would advice you to stay alert. Don't follow blindly any advice I could suggest in this thread.

I am in hell.

Today, early this morning, I decided to follow the advice (a good one) of AmenMoses. I moved all my custom behaviors in my custom folder.
I reloaded my latest project where my behavior (test.lua) was applied to the entity "Goblin".

Workflow :
- I executed that project in edit mode.
- I verified if the behavior "test.lua" was assigned to the entity "Goblin" and as expected it wasn't loaded (because I moved all my behaviors in my custom folder containing all my GameGuru MAX projects).
- Then I selected that behavior "test.lua" found in the "user" category ( the default selection being always "objects" when the "Behavior library" opens).
- I applied again that behavior "test.lua" to the entity "Goblin".
- But ... (and I am very, very sorry about that) ... I discovered that one of my previous behaviors "playanimtracksbis.lua" was applied to the two other entities in the scene.
- In fact, from modification to modification of my initial behavior, I saved each new version in a new .lua file with new icons, according to the definitions of the _init( ) and _main( ) in the updated script.

- To rectify that, I applied the behavior "test.lua" to those entities having a previous version of my renamed behavior.

- Then I clicked on the icon (the rocket) "test game".
- The game started.
- I pressed key "1" on the numpad of my keyboard and I got an error message.

- I opened the script "test.lua" in notepad to locate the line where an error was detected (see screen capture)




My conclusion :

- Previously, two versions of my behavior (I show again these ones herewith for a better understanding of the problem) where included in that project :
- the behavior "test.lua"



- the behavior "playanimtracksbis.lua"



- When the project was tested with a version of each behavior included in the scene, no errors were detected and I was convinced that the behavior "test.lua" was correct.
- When the project was tested with only one behavior, the latest one, "test.lua" in the scene, then the errors in the script were detected.
- May I conclude that GameGuru MAX is using another method to identiy the entities in a game ?

Thank for reading this comment.
And again, please accept my sincere apologies.

(anyway I will return to Earth)
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th Dec 2021 12:07 Edited at: 4th Dec 2021 12:09
No MAX uses the _init_name method same as GG and it works fine when I have used it.

Check that your entities name is exactly what is in the script, i.e. "Goblin", names are case sensitive.

Try the attached, make sure you attach it to the "Goblin" and the "movx10m" entities.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 4th Dec 2021 13:03 Edited at: 4th Dec 2021 13:03
AmenMoses, thank you for having given some part of your time to assist me in my difficult journey in Lua scripting in GameGuru MAX.
I just downloaded your attached.file "test.lua" and I'll study and test it carefully this evening.

This morning I spent a long time to debug my own script and I decided to come back to a previous version that I updated to try understanding that (e) and its role in a game.

Here is the code :


And here is a screen shot showing the result :




You are a master and I am still playing in the kindergarden.

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th Dec 2021 14:18
Every visual asset you place into the level is given a unique identifier called the object Id, many Lua commands use the object Id, especially AI related ones.

If an object is dynamic it also has an entity Id, this is effectively it's index into the global g_Entity list of entity values, such as health and position.

So you can see what the health of an entity is by: g_Entity[ e ].health

The name of the entity is not in that list so you have to store it in your own list if you need access to it. (the _init_name function is only called once for each entity)

If you delete a dynamic entity from your level then next time you load that level any entities further up the list (i.e. with higher indexes) than the deleted entity will probably get shuffled down as the entity Id is allocated by the engine when the level is loaded. So you can't rely on the numbers in your scripts.


Been there, done that, got all the T-Shirts!
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 4th Dec 2021 20:37 Edited at: 4th Dec 2021 20:44
AmenMoses, your explanation relative to the visual assets placed into a level are perfectly clear and particularly useful.
I now understand why it would be risky to rely on the Id number of an entity inside a script.

I examined in detail your "test.lua" that I placed in my "scriptbank/user" folder situated in the main folder of my Projects GameGuru MAX.

It works correctly for the entity "Goblin", but I cannot explain why it cannot identify the other entities included in the level.
I hope that I didn't make a mistake.

Here is a picture where I assembled the signicant parts of a few screen captures.



There are bugs or recalcitrant settings in the editor of the alpha version 2021-11-19 and it could explain several "issues" reported on GameGuru MAX repository on GitHub.

- A typical case is "the floating entities" when some settings of the level are modified. To avoid that problem, you need to reset the "collision type" of the entity and save again the level.
- Another case : The "Grouped Entities" ... there is more than one problem with that feature.
- The selection of a behavior in the "Behavior Library" could be more user friendly. Indeed, you need to uncheck some filters and to click more than one time to see your own behaviors. That's why I previously thought that they couldn't be accessed in my custom folder.

I already posted some of those issues to the repository.
But before reporting new bugs, I'll see if the latest update of yesterday (not yet installed on my desktop) contains some fix of previously reported bugs.
PM
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 6th Dec 2021 12:55 Edited at: 6th Dec 2021 20:26
Hello,

I promised that I'll return to Earth.

I come back with a simple script inspired by the script "test.lua" that AmenMoses kindly offered to assist me.

Personally, when I learn a new programming language, step by step I write very simple instructions.
I don't like too much "concatenation" of the code by using a lot of functions. Using them for the purpose of optimizing the program is good when this one works correctly.

Here is the code of my new test :



Here is a screen capture showing the entities in the level.
That lua script (GameGuru MAX behavior) was applied to each of them.



And here is a very short video showing the execution of the script :



(24 seconds = 29 MegaBytes before optimization on Vimeo) (time is money).

Currently I decided to continue my experiments with GameGuru MAX alpha 2021-11-19.
Even if there are bugs (or recalcitrant settings) in its editor, I know where there are and how I could avoid their pitfalls.

Previously I made a few mistakes in my tests with the animations of several entities active in the same level :
- each entity needs a distinctive name (not a generic one). Therefore I renamed each of them in the Editor > Object Tools > Identity.
- each animation clip needs a distinctive label when it is imported with a new asset in GameGuru MAX.
Having the same animation clip "a2" for two different entities was a mistake.
Therefore I decided to skip the animation clip "a2" in my script.
- Some entities were "floating" in the air in my previous tests. It seems that I could correct that problem with the "Positioning Mode".
- The Physics/Collision settings are recalcitrant. I had to confirm their settings to obtain "Physics = on" with a correct collision mode ("Box" or "Character Collision").

What I learned (beside the content of the script provided by AmenMoses) :
- There are two types of animations that I could use in my games with GameGuru MAX :
1) The decorative animations : these ones wouldn't need to interact with the physics engine. That's the case of those "movx2m" entities in my test.
Each time I press the key "7" they move forward by a step of 20,000 GG MAX units (approximately 10 meters), but their collision cage stays at the initial position of those entity. Therefore it is not advisable to move an entity with this kind of animation if they require an interaction with other entities.
2) The interactive animations : the rigged entities like the "Goblin" contain animation clips ("walk", "run", "fighting poses", etc) where their x,y position don't move. Therefore their collision cage is still valid with each of their animation clips. I think that those ones simply require a "movewithanimation(e,v) command to obtain a correct animation interacting with the physics engine when their position x,y is modified to simulate a real walk or run process.

Now I think that I could be able to create a good little game with GameGuru MAX (alpha version 2021-11-19) for my own pleasure.

PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th Dec 2021 17:41
@ Amen
Quote: "Um, yes it does!

If there is no match for anim = anims[ g_InKey ] then anim will be nil!"

I'm Sorry guy finally got the time to test your code, at first glance LUA threw an error msg at line:
local anims = { "1" = "a1", "2" = "a2" , "3" = "a3", "4" = "a4", "5" = "a5", "6" = "a6" }



And no time left to track the error or the cause; also accidentally removed my imported DBO file with the door anims working fine.
I've fixed the error and as you have pointed above it works as expected.

The whole script


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-12-22 05:28:11
Your offset time is: 2024-12-22 05:28:11