Scripts / [STICKY] Smallg's free scripts

Author
Message
Isagabe
10
Years of Service
User Offline
Joined: 12th Sep 2014
Location:
Posted: 22nd Aug 2015 08:47
Apologies double post. archaic internet where I am at right now.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th Aug 2015 14:30 Edited at: 24th Aug 2015 14:31
i'm sure some of you may have already worked this out but for anyone interested i figured out how to use the RotateX/Y/Z commands so you can actually rotate stuff "locally" with a predetermined outcome (the reason to use this over SetRotation(e,x,y,z) is because that uses the global axis and it's not always the result you need depending on the current rotation)

basically what you need to do is set the speed in line with the FPS -
so if i wanted something to turn 90 degrees in 1 second i would use something like this



and have a trigger that sets rotate to 1 when i want to start rotating.
if you wanted to make it turn quicker but not over turn you would need to adjust the fps variable up while adjusting the "rotate" counter by the same amount

here's an example script of it in GG (note it's not 100% perfect as fps can change while the rotation is happening but unless someone has a better method it's hopefully useful to someone)

all objects are using the same script but the "speed" at which they rotate is random each time i press 'e'


rotate_local.lua
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Timba
9
Years of Service
User Offline
Joined: 22nd Apr 2015
Location: Florida
Posted: 26th Aug 2015 18:19
smallg can you make the player have to hit E to pickup ammo boxes? Right now is set to automatic pick up.
ASUS MAXIMUS VII HERO | Intel Core i7 4790k | 16 GB RAM | EVGA GTX 980 SC | 120GB SSD(OS) | 512GB SSD(Programs) | 1TB WD Black(Backups) | EVGA SuperNova 1000W G1
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th Aug 2015 18:30
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Timba
9
Years of Service
User Offline
Joined: 22nd Apr 2015
Location: Florida
Posted: 26th Aug 2015 19:17
awesome thx
ASUS MAXIMUS VII HERO | Intel Core i7 4790k | 16 GB RAM | EVGA GTX 980 SC | 120GB SSD(OS) | 512GB SSD(Programs) | 1TB WD Black(Backups) | EVGA SuperNova 1000W G1
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 26th Aug 2015 19:49
is there a script that set the door opened at start? or that block the door closing animation to a certain value due to simualte a broken door ( most useful for sliding automated door.or scifi door)
PC Specs:

Q9550@3,8GHZ - 8GB RAM - SVGA R9 280 3GB GDDR5 - HDD WD 1500TB
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 27th Aug 2015 18:12
Quote: "is there a script that set the door opened at start? or that block the door closing animation to a certain value due to simualte a broken door ( most useful for sliding automated door.or scifi door)"


this is 2 scripts here?

for number 1 you want a door that's already open and then can be used as normal (closed and opened again etc) by the player?

for the second you want the door to kinda be jammed in a sort of trying to close state (sort of opening and closing on repeat a little maybe?) so it can't be used right?
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 27th Aug 2015 22:03
Quote: "this is 2 scripts here?

for number 1 you want a door that's already open and then can be used as normal (closed and opened again etc) by the player?

for the second you want the door to kinda be jammed in a sort of trying to close state (sort of opening and closing on repeat a little maybe?) so it can't be used right?"


yes to all your question...

any of them??
PC Specs:

Q9550@3,8GHZ - 8GB RAM - SVGA R9 280 3GB GDDR5 - HDD WD 1500TB
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Sep 2015 22:12 Edited at: 8th Jun 2017 14:52
grenades script(s)

*edit, way points added*

1.a. set the name of each soldier unique e.g. grenadier1 , grenadier2 etc
1.b. give him ai_grenade.lua
2.a. and name all grenades the same (that will be assigned to him) and place them near to him
2.b. set them explodable and assign the grenades the 2 sounds (slot 0 is the pin, slot 1 is the bounce)
2.c. give them grenade.lua
3. change the settings for speed and distance as you wish (default works fine for me at 60fps)
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
AceRimmer
Reviewed GameGuru on Steam
9
Years of Service
User Offline
Joined: 28th Feb 2015
Playing: classic British heavy metal mostly
Posted: 4th Sep 2015 20:55
thanks smallg, the grenades scripts are great.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 29th Sep 2015 13:25 Edited at: 17th Nov 2015 19:32
couple new scripts to expand the fantasy pack
(well one is a kinda new version of an old one but it fits)
wall arrow type trap
trap_arrow.lua


and a new boulder (this one will repeat if you desire compared to the old version)
trap_boulder.lua


there are some settings in the code but you also/mainly need to adjust the name and the strength of the entity's (this allows you to customise individual traps easier in the editor)
name = the range at which the trap begins to trigger -something like 200 is good for the arrow & and 1000 for the boulder maybe, it depends on your map, so play around
strength = the damage a hit will deal
and as always i have commented the settings you can change so you can adjust as you wish

p.s. the boulder is from the death valley pack but any roundish rock will work (it uses GG physics to fall, roll and bounce)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 30th Sep 2015 10:51
Another nice set of scripts. Thank you.
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

HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 30th Sep 2015 12:23
That is really cool....
i also love the arrows/darts....

thanks

Harry
Harry
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Oct 2015 14:56 Edited at: 3rd Oct 2015 14:59
following on from Lee's twitch video in which he talked about using a script to fake an animation i have created a script for a sliding door/wall/whatever.
you need to name it (in the GG editor) based on the direction you want it to move in GG -* this means you can use 1 script for all 4 directions *- (note it only works in north, east, south or west, no other directions or rotations will work i'm afraid as it's moving via global direction, i may change it later to local if i have time and it works ok)
(opening)
x1 = west - > east
x2 = right -> left
z1 = south -> north
z2 (or anything else) = north -> south
so you simply name it "x1" or "x2" etc
sliding_wall.lua

obviously you can't beat a real animation but not all of us are able so hopefully it's helpful
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 3rd Oct 2015 14:59
I like your 'raiders' scripts - very cool
science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 3rd Oct 2015 16:56
major appreciation for the arrow and boulder trap, i been trying to make both and both failed everytime, many thanks indeed appreciated greatly

an unquenchable thirst for knowledge of game creation!!!
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Oct 2015 18:35
no worries, if you have any others you need let me know, always happy to help
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 5th Oct 2015 18:52
Very nice smallg. You keep coming up with great stuff.
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

science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 7th Oct 2015 13:58 Edited at: 7th Oct 2015 14:03
@ small g i do get very baffled with which actual parts to change have you a colour code going on? i get error 39 etc, i set the entity to none static and things, everything is trap_arrow even entities,

i am obviously putting wrong values in places and maybe missing in others, could you maybe bold the text or something ( or would that come up as an error) i have decided i am naff at scripting lol and easily get muddled, anyway any tips or guidance where or what to function the arrow be great.

any info or help would be appreciated,
an unquenchable thirst for knowledge of game creation!!!
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Oct 2015 15:03
Like the post says, name the arrow in the editor to adjust its triggering range (something like 200)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 7th Oct 2015 18:37
thanks small g. yes sorry for being the most none brain user in the galaxy, to think i am a deputy manager, lol
an unquenchable thirst for knowledge of game creation!!!
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 9th Oct 2015 23:14
fishing WIP
today i decided to continue my mini game scripts and i made some fishing

there's 4 types of rod and 4 types of bait by default.
- the rod type makes it easier/faster to reel the fish in
- the bait type makes it easier/faster to actually get a bite (and also slightly easier to reel in - but much less than the rod type)
the higher the quality the bigger the bonus - it is possible to reel a fish with basic but it's obviously a lot harder

script detects for no fishing rod (no fishing started), no bait (no fishing started), 1 rod & 1 bait in inventory only (fishing will automatically start using that rod & bait), multiple rods & 1 bait (you choose rod and then fishing will start automatically), multiples of both (you choose which to use)

it still needs some more testing and tweaks but hopefully i shall be able to release it soon - depending on any major issues.
p.s. this requires 3 scripts (+1 optional to show the rod & +1 optional for the fish - the rod script will be included but not the fish script as this comes with the fish on the store & neither model is included but you can find the rod in the free models section and the fish on the store)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Oct 2015 17:15 Edited at: 10th Oct 2015 17:26
found a few serious issues with what happened when you ran out of a certain bait and how it handled adding more thereafter (although the script handled everything fine till then) so after a bit lot of a rewrite (which naturally causes more issues) i have hopefully got everything working as i wanted it

i have included some code for sound but i didnt have any so it's not included in the video (sound0 is the successful catch, sound1 for the failed catch - set these on the object to use as the fishing area)

i have now added a visual to the rod while reeling / fish on the line
and have added the option to have a fish swim towards you (it doesnt really line up great but it's good enough)
and as before you dont have to use the rod or the fish if you dont wish (the script should still work fine)

for set up you need to name the rods and the bait in the editor to specify which "type" they are (this is done with numbers 1 ~ 4, i.e. basic bait/rod is named "1" - you can change the 'displayed name' i.e. "basic" to whatever you wish in the scripts)
set the health/strength of the bait as the quantity of bait it will give when collected
you need to name the object to use a the fishing "area" the same as the fish you will use (if you wish to use 1)
make the fish & the rod always active (the visual aids - this is so you can place them anywhere and it shouldnt matter)
place the fish in the water at around a decent distance away (where it will start swimming towards you from)

*script assignment*
bait = bait.lua
rods (the ones to collect) = rod.lua
fishing area = fishing.lua
rod (to use while fishing) = fishing_rod.lua
fish = fish.lua
(hopefully i've remembered everything, it's a bit of a messy script due to the rewrite but i have commented all settings you can freely edit, anything else should only be edited if you're happy to break it )



p.s. my fish is from Gtox's fresh water fish pack (i just adjusted the fpe to make it rotatey by 90 so it faces the player)
p.p.s bites are random but based on bait too, it kinda increases the likelihood of a bite over time as well as giving greater initial chances for better bait so although it's definitely possible to get a quick bite on lower bait, the better the bait the quicker the bite should happen (more often at least) and also a bait will never fail, you will only lose the bait if you fail to reel the fish.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Oct 2015 15:33
sliding wall trap by request.
make sure the objects are rotated to face the intended direction (should work for a ceiling too if you have an object facing down but i havent tested that).
it's best to make the immobile and apply a sound to slot 0.
as always plenty of options to adjust the script to fit your needs


trap_wall.lua
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 30th Oct 2015 23:52 Edited at: 30th Oct 2015 23:53
absolutely fantastic not only can this work in temples, but

r2 may have to shut down all the garbage crushers on the detention level
an unquenchable thirst for knowledge of game creation!!!
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 31st Oct 2015 08:43
really cool

indiana jones






Harry
PM
Mariokiki
16
Years of Service
User Offline
Joined: 22nd Oct 2008
Location:
Posted: 1st Nov 2015 23:12
Hi smallg,
I would suggest you an idea on your script "Sliding doors" ... if it's possible, of course !
Do you think it could be possible to produce doors "drooping" like in temples for example ?

If you change the variable "X1", "X2", "Z1" or "Z2" with "Y", it can act on the "Y" position of the object ?

example: if directon [i] == "Y" then
SetPosition (e, g_Entity [e] ['x'], g_Entity [e] ['y'] - speed, g_Entity [e] [z '])

-- + speed or - speed depending the Y direction... up or down...

Did you try to make a script with that ?

Thank you very much for all your scripts !!!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Nov 2015 11:10
vertical door
name it "y2" to make it go down (anything else to move up)
i had to adjust the close range a bit to account for the way the GetPlayerDistance(e) call works when moving down so it wont close as quickly compared to moving up but should still close (otherwise the door gets stuck in an opening&closing loop til you move away as the distance check updates between the 2)

also note it wont go through the terrain when moving down, this is because we need to keep collision on until the door is actually open and with collision on it is hitting the terrain and thus not moving (the script will still think it is though and it causes the door to move incorrectly after).

door_vertical.lua


life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 2nd Nov 2015 12:36
Awesome !
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fps/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Mariokiki
16
Years of Service
User Offline
Joined: 22nd Oct 2008
Location:
Posted: 2nd Nov 2015 15:37
MANY THANKS SMALLG !!!

It's exactly what I need for my Egyptian doors with the opening up !

I just have to add the use of a key (or spécific object) and it will be perfect !

Continues to reward us with your scripts !

PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Nov 2015 20:02
Amazing!!!
Thanks smallg.

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
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Nov 2015 21:06
updated page 1 to give working links again, if anyone finds any issues with any of the links or the scripts please let me know and i will be happy to correct them.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 4th Nov 2015 12:40
You rule smallg, 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

3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 4th Nov 2015 17:04
Thanks smallg for keep the bible updated.

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
stascreator
9
Years of Service
User Offline
Joined: 1st Mar 2015
Location: Russia,Novosibirsk
Posted: 4th Nov 2015 22:00
In advance I apologize for bad translation (use google translate)
Smallg, you've created awesome scripts! But I have a question. Can I use the scripts of the topic, for commercial purposes? I want to create a game, and your scripts awesome! I will write a reference to the script in the credits.
OMG,I WRITE OMG!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Nov 2015 22:16
yes all scripts are free to use and modify as you wish
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
TheSourceCode
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 6th Nov 2015 15:40 Edited at: 7th Nov 2015 01:34
Made a edit in my post, sorry.

Great scripts Smallg, but I was curious. Do you think a script is possible, where you can only jump to the next level until after you've killed everyone in the players current level?

Thanks, and keep up this outstanding work.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Nov 2015 14:45 Edited at: 18th Mar 2017 17:05
here's your request, multiple doors are allowed too (for different groups of enemies - see video)

- you need to name the door and the AI (required to be killed, so doesnt need to be everyone in the map if you wish) the same in the editor


to use a different ai script you need to adjust the code with comments in my ai script, so yes you can use any AI script you like.
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
TheSourceCode
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 7th Nov 2015 16:13 Edited at: 7th Nov 2015 17:22
Oh my gosh, that is amazing Smallg! Thank you so very much!

EDIT: Ugh, sorry to be an inconvenience Smallg, but I'm not really sure where I am suppose to attach these scripts. I'm fairly new to this, so pardon my ignorance. But would you mind telling me where I do place them? It'd be very much appreciated. Very sorry for the trouble, and again, keep up the amazing work you're doing here.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Nov 2015 17:48
the original scripts go on the door and the AI characters you wish to kill,
the edited script would go on the zone you want to trigger the end of the game and again the ai script goes on the AI characters you wish to kill
note you need to name every character the same as the door/zone they relate to
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
TheSourceCode
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 7th Nov 2015 18:08
Ah, alright, thank you Smallg! Can't say how happy and thankful I am for this! Once again, keep up the awesome work!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Nov 2015 19:39 Edited at: 19th Aug 2017 12:06
infinite spawn scripts - this 1 was requested and i see it asked about a lot so here it is
note you can change the ai script to use any preset ai script you wish (follow the comments in the script) but i set it for the ai_soldier.lua script by default as this is the most used one)

options to change how fast the bodies are removed and how quickly the enemies respawn are included of course but i set it to a quick respawn for the video (all settings are commented as always)

give this 1 to all ai you want to be able to respawn
ai_respawn.lua

give this script to 1 dynamic (non-static) entity that is set to 'always active = yes'
ai_respawner.lua

if you have any comments please let me know, maybe i should add a check to determine if the player isnt nearby or have them spawn back at their original (start) position rather than their death location?
note the placement of enemies can't really be checked so if you do have them set to spawn in a different location than where they died (xmod etc) then it is possible for them to spawn in bad locations.. set xmod etc to 0 to make them spawn where they died to fix this.

p.s. the prompt is only for the video and is removed from the actual script


edit: quick fix to allow it to work more effectively (no more ignorant AI on respawn) and also allows it to work with zombies (as long as you change the script references in the ai_respawn.lua of course)

edit2: updated 19/08/2017
fixed for latest version of GG.
please note, if you don't have a function in your AI script (init(e), exit(e) etc) then you need to remove the call(s) to it or create an empty one in your AI script.
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
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 20th Nov 2015 00:56
That is really very cool smallg. Nice work.

Endless battles ahead
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 20th Nov 2015 11:02
That is truly awesome.
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 20th Nov 2015 11:15 Edited at: 20th Nov 2015 11:16
Brilliant ! Thanks @Smallg
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fps/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
dimoxinil
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location:
Posted: 23rd Nov 2015 16:35
You you you you... are amazing!!!!

My little APOCALYPSE world My little APOCALYPSE world

stascreator
9
Years of Service
User Offline
Joined: 1st Mar 2015
Location: Russia,Novosibirsk
Posted: 28th Nov 2015 18:34
Greetings to you, the people who give the community scripts! Can you make one for me? I want to make enemies that will attack in waves. For example: after a certain time after the spawning the player on the map, begin to spawn enemies! After all appeared enemies killed by the player spawn so more enemies, but not infinite, it would be better if the number of waves can be set up, and even the number of enemies which spawn in one wave. Thanks in advance! (Translated via google translator)
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Nov 2015 15:14 Edited at: 30th Nov 2015 15:15
the freeze script for any1 interested, 2 versions - 1 which uses a custom AI for soldiers as if you use stock AI and they are firing at you when you freeze time they will continue to fire at you when frozen (it's a very basic script but if there's enough demand i can add waypoint code, it just didn't get added during my tests)
- the second (soldier_script.lua) will allow you to assign a stock ai script (mainly for zombies as they dont have guns so the bug above isn't an issue)

assign freeze.lua to any dynamic object that you set to always active (note it will become invisible)

give all enemies the required script (soldier.lua for soldiers & soldier_script.lua for zombies or if you don't mind the gun bug)


press Q to freeze the enemies
(note you can change the settings in freeze.lua)

video (have made some improvements too, for example psychic counter now updates while you are using the freeze so you can easily see how much you have left)


p.s. although the script can allow for images they arent required, it still works without them
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Nov 2015 16:27 Edited at: 28th Nov 2023 12:25
Quote: "Greetings to you, the people who give the community scripts! Can you make one for me? I want to make enemies that will attack in waves. For example: after a certain time after the spawning the player on the map, begin to spawn enemies! After all appeared enemies killed by the player spawn so more enemies, but not infinite, it would be better if the number of waves can be set up, and even the number of enemies which spawn in one wave. Thanks in advance! (Translated via google translator)"


sure, again you need 1 script to act as the trigger and another for the enemies
wave_timer.lua (always active object)
&
wave_ai.lua (on the AI)

name all enemies in their respective waves i.e. wave1, wave2, wave3 etc (see picture)
*remember to set a delay for each wave in wave_timer.lua*


*edit1* fix for ai scripts that didn't have ai_bot_state by default
*edit2* better to use the new version found here
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
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Nov 2015 17:21 Edited at: 30th Nov 2015 17:51
2 more scripts for the collection
edit: forgot to say, set the platforms immobile if they are floating (like in the video)
vanishing_platform.lua


and moving_platform.lua



life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-12-22 06:39:46
Your offset time is: 2024-12-22 06:39:46