Scripts / [STICKY] AmenMoses scripts land fill thread.

Author
Message
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th Sep 2018 17:02 Edited at: 27th May 2021 08:59
In response to popular demand (i.e. the bloke that asked is quite popular) I will start filling this thread post with links to all my 'stuff' that has accumulated around here over the last few years so people can find it more easily.

I'll also use this thread to post any useful little scripts that I may have lying around that others may find useful.

First though a disclaimer: Some of these scripts were developed some time ago, since which GameGuru has 'evolved' somewhat. If you find any that do not work as advertised with the latest version of GG please send me a PM and I will endeavour to fix it.

My rewrite of DVader's Body script : https://forum.game-guru.com/thread/219891

Physics library tutorial : https://forum.game-guru.com/thread/219758#msg2601608

Sprite based fonts library : https://forum.game-guru.com/thread/219811
!!! new textlib.lua attached to this post, now with rotation of text !!!

Improved ai_viewanimations.lua : https://forum.game-guru.com/thread/219262

Fun with board games : https://forum.game-guru.com/thread/219163

DIY 'Moonlander' thingy : https://forum.game-guru.com/thread/219125

Zones using waypoints : https://forum.game-guru.com/thread/218470
(Added zonelib.lua to this thread)

Hidden Object game script : https://forum.game-guru.com/thread/218548

Whacky Racers scripts walk-thru : https://forum.game-guru.com/thread/218283

Gun Turrets : https://forum.game-guru.com/thread/218176

Platform/Entity mover stuff : https://forum.game-guru.com/thread/216730#msg2563082

Jump Pad script : https://forum.game-guru.com/thread/220466#msg2611159

Freeze player script: https://forum.game-guru.com/thread/220055#msg2614939

Boat script using physics: https://forum.game-guru.com/thread/220055#msg2615182

Notes using particles system: https://forum.game-guru.com/thread/220804#msg2616252

Particle tester: https://forum.game-guru.com/thread/220055#msg2622747

Light control: https://forum.game-guru.com/thread/220055?page=1#msg2622840

Sound control: https://forum.game-guru.com/thread/220055?page=2#msg2622953

Maze Generator:https://forum.game-guru.com/thread/220055?page=2#msg2640308

Spitfire script:https://forum.game-guru.com/thread/220055?page=2#msg2641656
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Duchenkuke
GameGuru VBOTB Developer
8
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 14th Sep 2018 19:02
finally a thread for all your great work. Awesome idea !
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 14th Sep 2018 21:19
Excellent. Thanks.
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.

JPH-GAMES
3D Media Maker
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Belgique
Posted: 15th Sep 2018 06:49
A big thank you AmenMoses, will facilitate the research, very precious .

Intel Pentium CPU G3220 3.000 GHz , 8 GB Ram , NVIDIA GeForce GTX 745 2GB , Windows 10 64-bit.
GameGuru , S2Engine HD , Shoot EM Up , CopperCube 5 , Clicteam Fusion 2.5 , Platfinity .
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 5th Oct 2018 00:23 Edited at: 5th Oct 2018 00:35
No but the gameplayercontrol.lua may have done. I'll check on my end to see if I have the same problem.

Try this.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 5th Oct 2018 18:21 Edited at: 5th Oct 2018 18:23
Yes, not sure what causes the over reaction on collision, will have to hunt though the GG code to figure that one out! But it isn't actually shooting off the map as you imagine, Lee put a 'fix' into the engine at some point which automatically destroys any objects with health of 0, the pickuppables script contains collision detection for thrown objects which forces their health to zero on collision (so that for example exploding entities will explode when thrown at something). So your thrown object is being destroyed by Lee's 'fix'.

To fix this you can comment out the line
SetEntityHealth( P.ObjectToEntity( thrownObj ), 0)
in the script but obviously thrown objects will no longer explode!

The line is in the function CheckThrowCollision() btw.

The jumping thing should also be fixed by that as it is due to the entity not being around anymore to reenable jumping!
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 5th Oct 2018 20:42
Interesting, when I tried it it got destroyed. Hmm, can't explain that one, what weight have you got set on it when it does that?
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th Oct 2018 11:56
Are you using the latest Beta? I can't replicate it my end but then realised I'm running my own local build so maybe it was something in the Beta that caused it?
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th Oct 2018 16:32
Curious, I can't replicate it, I wonder if it has something to do with the entity you are throwing it at, what is that in the video?
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th Oct 2018 19:02
Hmm, okay. I'm in the middle of a rewrite of the pickuppables anyhow, plus I'm tinkering in the engine with mass/force calculations in various places, hopefully in the next week or so I'll be pushing the results of my efforts and all will be a lot better.
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd Nov 2018 10:55
Attached is a new script for Bod's buttons.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Flatlander
GameGuru Master
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 5th Nov 2018 21:29
Thanks for this thread.
Alienware Aurora R7 with SSD 256GB boot drive ( C: ) and a secondary drive ( D: ) that is 2TB
Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 with Intel Turbo-burst
Installed RAM 16.0 GB
64-bit operating system, x64-based processor
Windows 10 Home
NVIDIA GeForce GTX 1070 with 8192 MB GDDR5 and 8095 MB shared system memory
igormm77
6
Years of Service
User Offline
Joined: 26th Jan 2018
Location:
Posted: 6th Nov 2018 00:29
Thank you very much, everything works.
PM
igormm77
6
Years of Service
User Offline
Joined: 26th Jan 2018
Location:
Posted: 8th Nov 2018 07:05
Sorry for disturbing
Where can I get a simple driving script?
Your script that you put on this forum is very good, but for me it is complicated - I recently worked with GameGuru. Can I have a top view and control?
thank

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 8th Nov 2018 19:44
It does have 'top view' or at least a 3rd person style view.
Press the Q key to switch from first person to third person.
Change the values tpZoff and tpYoff to change the camera position.
In the AttachPlayer function change the '25' value (in two places) to alter the 'look-down' angle.
Been there, done that, got all the T-Shirts!
PM
igormm77
6
Years of Service
User Offline
Joined: 26th Jan 2018
Location:
Posted: 9th Nov 2018 00:12
Yes, I know, but it does not work for me.
I took the finished model and redid it (I cannot model it myself yet ¯ \ _ (ツ) _ / ¯ )
Maybe I'm doing something wrong?
(I haven’t changed the wheel and steering coordinates yet - I don’t know what they look like with the car)

For some reason, I don’t get any scripts with cars - neither yours, nor taxis, nor the movement of wei-points, I can’t make the car move. They either do not work, or turn blue and jump.

thank

Attachments

Login to view attachments
PM
igormm77
6
Years of Service
User Offline
Joined: 26th Jan 2018
Location:
Posted: 9th Nov 2018 00:28
No, no, I apologize for the trouble ... I attached the wrong folder ((
PM
igormm77
6
Years of Service
User Offline
Joined: 26th Jan 2018
Location:
Posted: 9th Nov 2018 06:15
Sorry, here is the correct model.

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 9th Nov 2018 11:00
You need to pop your model into a 3d app and scale and position it correctly.

Currently in the fpe file you have a scaling factor of over 2000, as the scripts need to use the scaling factor to figure out where to put the wheels etc that is why it will not work.

The origin for the vehicle body needs to be in the centre of the rear axle with the front of the model in +ve Z.


Been there, done that, got all the T-Shirts!
PM
igormm77
6
Years of Service
User Offline
Joined: 26th Jan 2018
Location:
Posted: 10th Nov 2018 00:09
Understood, thanks, I will try
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Dec 2018 22:20
Follow link for new pickuppables stuff:

https://forum.game-guru.com/thread/220290#msg2609040
Been there, done that, got all the T-Shirts!
PM
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 2nd Dec 2018 22:51
Thanks Amen,testing tomorrow

Dave
Windows 10 Pro 64 bit
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 19th Dec 2018 01:19
AmenMoses, the Moonlander thingy is missing one of its scripts: dynamic_entry.lua. Unfortunately I don't have it anymore. My hdd took a leap of faith. It's the script for the nozzle exhaust. Thank you
Jim C
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 19th Dec 2018 19:52 Edited at: 19th Dec 2018 19:54
https://forum.game-guru.com/thread/219125#msg2592694

Isn't that is?


Ahh, I mistyped the instructions a bit, should have been dynamic_entity.lua!
Been there, done that, got all the T-Shirts!
PM
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 20th Dec 2018 13:53
No problem-o, I made a level using your scripts. Thank you by the way,they are Awesome! I put the Sci Fi dome over the map. So the ship won't go out of bounds. But, with no collision on the ship, it will just fly through it. Is there some sort of way to put a no fly zone=stay in with in the dome? I tried the invisible wall script on the dome just for sheet and giggles with no luck. It will just fly through.(no collision on the ship) Hmm maybe there is some way to kill it when it touches the dome? It would be nice if it bounced off. Thanks
Jim C
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 20th Dec 2018 19:13
You would have to put some checks in the code to either detect objects (i.e. with raycasting) or a simple check on x&z values to stop it going out of bounds.

The truck scripts have collision detection in them, take a look at how it's done there.
Been there, done that, got all the T-Shirts!
PM
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 21st Dec 2018 03:43
I'll do that. Thank you for your advise.
Jim C
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 28th Dec 2018 05:44
I can't get the sound to work for the truck. What happened? I thought maybe I'm doing something wrong. Can somebody try it and see if it's working. Or is it on my end? Thanks
Jim C
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 23rd Jan 2019 21:06
Never mind, I fixed it myself. It was a windows 10 update that screwed everything up.
Jim C
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 16th Feb 2019 10:40


Showing off new addition to textlib.lua.
Been there, done that, got all the T-Shirts!
PM
Flatlander
GameGuru Master
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Mar 2019 03:00 Edited at: 7th Mar 2019 03:03
I wasn't exactly sure where to post this. I just wanted you to know that in your pickupable script at line 581 you have "PU.getNames( e )". I should be "PU.getName( e ) instead. I had downloaded the script from your "New pickuppables script and library" thread. Perhaps you have already fixed it and put it in another thread. BTW, excellent code.
Alienware Aurora R7 with SSD 256GB boot drive ( C: ) and a secondary drive ( D: ) that is 2TB
Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 with Intel Turbo-burst
Installed RAM 16.0 GB
64-bit operating system, x64-based processor
Windows 10 Home
NVIDIA GeForce GTX 1070 with 8192 MB GDDR5 and 8095 MB shared system memory
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 7th Mar 2019 19:25
Cheers for that.
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 26th Apr 2019 19:30
Simple little script (at least it is now) that will freeze the player for a period of time.

Attach to an entity and name it as follows:
<description>,<delay>,<distance> e.g. "Door to hell,3000,200"

When the player comes within the specified distance of the entity and is looking in its direction the Sound 0 for the entity will be played, a prompt is shown with the description and the player position will be frozen for the specified period (in milliseconds).

Each entity will only trigger once.

I've left in a debug prompt (line 50) for testing purposes, just comment that line out when you are satisfied it is working.


Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd May 2019 14:56
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 3rd May 2019 18:01
Nice work man!
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 4th May 2019 00:04
Nice Amenmoses.
Jim C
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 5th May 2019 00:24
very cool

cheers
Harry
Harry
When nothing goes right, go left
PM
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 6th May 2019 18:19
Great! Thank you!
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 7th May 2019 15:23
fantastic !!
You make this all look so simple
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Flatlander
GameGuru Master
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th May 2019 19:47
What can I say, but a profound thank you.
Alienware Aurora R7 with SSD 256GB boot drive ( C: ) and a secondary drive ( D: ) that is 2TB
Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 with Intel Turbo-burst
Installed RAM 16.0 GB
64-bit operating system, x64-based processor
Windows 10 Home
NVIDIA GeForce GTX 1070 with 8192 MB GDDR5 and 8095 MB shared system memory
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 29th Oct 2019 23:24 Edited at: 19th Aug 2020 21:44
Particles tester, basically allows you to fiddle with values and when happy save out a Lua snippet that can then be incorporated into your scripts.

Select value to change using I & K keys, adjust values using - & + keys (press Shift key to increment x10)

Attach script to an always active entity, edit script to add your own particle image files and shaders.

Changes in this version:
Added gravity, wind, limb index
Auto-saves values (just in case you select a noin-existant limb index and GG crashes) and reloads on restart.
Multiple output files can be generated
Hold Q for 100x increments

Came to my attention that not everyone has the 'additive' shader so added it to the post.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 30th Oct 2019 22:21
Excellent Thanks Amen
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 31st Oct 2019 12:41
nice idea
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Nov 2019 15:14 Edited at: 3rd Nov 2019 01:41
Light control script.
Add to lights and control entities, name the lights 'Light_num1_num2' where num1 is the sensitivity value and is the fade speed (if needed).
Name the control entities 'Fade_num', 'FlickerStart_num' or 'FlickerAlways_num' where num is the trigger range for the entity. Any other name is simple on/off of light.

When the player is within the specified range of a control entity it will act upon all lights where the light range value multiplied by the sensitivity value overlaps the control entity.

*** Edited to add: Change flicker modes to FlickerStart and FlickerAlways. ***

Attach the script to lights and control entities, the lights need to be called 'Light_n1_n2' where n1 is sensitivity and n2 is fade speed (if needed). The control entities can be named either 'Fade_n' where n is the trigger distance or FlickerStart_n or FlickerAlways_n or anything else.
if the control entity is called Fade_n then when the player comes withing n distance any lights within range (I'll explain that in a bit) will fade up. Move away and they will fade down. Speed of fade governed by the n2 value attached to the light.
if the control entity is called FlickerStart_n then similar except the lights will flicker for a bit before coming on full (like fluorescent lights).
if the control entity is called FlickerAlways then the lights will continuously flicker until you move away.
The range of the light itself multiplied by the sensitivity value determines in an entity triggers it or not, so if the range of the light is 500 and sensitivity is 2 then if the light is within 1000 units of the control entity it will be triggered by it.
If the control entity is called anything else then the light will just come on straight away.
You can have as many lights and as many control entities and the script sorts it all out.

*** Edited to add extra functionality ***
Lights and control entities can now take an identifier parameter. This links specific controls to specific lights (they still have to be in range though).
e.g. 'Light_2_5_fred' and 'Fade_200_fred' will be linked so only lights with 'fred' on the name will be controlled by control entities with 'fred' on the name.
Also added the following functionality to control entities:
'Motion' : if the name of the control entity starts with this then it activates only when the player is in motion.
'OnOnly' : if the name starts with this then the lights are only turned on by this entity
'OffOnly' : if the name starts with this the lights are only turned off by this entity.

For example: 'OnOnlyFade_200_betty' if the control entity is called this then when the player is within 200 units of the entity all lights within range that have 'betty' on the end of their names will be turned on with fade.

Be careful to exactly follow the naming conventions, Lua is case sensitive!

*** new version added 'zone' as trigger distance, e.g. if script is added to a zone marker set the trigger distance to 'zone' and the trigger will occur when the player is in the zone.
For example 'FadeStart_zone'

*** new version added 'Switch' option to the control entity so you can attach the script to switches, e.g. 'SwitchFlickerStart_80' when the player is within 80 units and looking at the entity you will get a prompt to press the E key to operate the switch. Add a 'click' sound to sound slot 0 and it will play when you press E.
Also added a variable called motionDelay to the script, if you select the 'Motion' type then this will determine how long after you stop moving the lights will trigger.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 1st Nov 2019 16:49
Excellent! All excellent and useful.
Now, when you can do this for the sun, (and especially make the FE sun
move toward the horizon), -- YO! YO!

Maybe ask them people in the control room- what up?
PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 1st Nov 2019 16:52
The script works great, but is there a way to keep the flicker going, so I can use it for a fireplace ?
PM
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 1st Nov 2019 16:53
THANKS Amen
PC 2 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB


PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 1st Nov 2019 16:56
@ bluemeenie195

Random values...? Random timing? Sure.
PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 1st Nov 2019 18:15
I'm pretty sure there is random values, random timing, but it shuts off when it hits the desired distance.

I'm trying to keep the flicker going the whole time in the area.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Nov 2019 18:38
Start a new thread about it.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-12-21 15:55:10
Your offset time is: 2024-12-21 15:55:10