Scripts / [STICKY] Smallg's free scripts

Author
Message
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 5th Apr 2015 15:53
Great Job, on cutting the zombie in half.
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

smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 5th Apr 2015 18:46
Quote: "Great Job, on cutting the zombie in half."

pretty good considering it's not an animation but just uses what's available from the stock models though i think

new script to use adrenaline shots to turn the tables on your attackers....
shield yourself and reflect that damage back at your enemies with the new formula

notes
- there is a toggle setting so you can use these purely as temporary shields if you wish to give mercy on the enemy and not return the damage
- the key to pick up is e as it's kinda standard action key from before but you can change the actual key to 'activate' the shield in the script (default as v)



needs some sort of visual effect i know but the basic idea is there, feel free to expand it as you wish.

apply it to the syringe (or whichever entity you choose and it'll automatically change state from pick up to shield etc
absorb_damage.lua
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 9th Apr 2015 14:10 Edited at: 9th Apr 2015 14:12
new teleporter with 9 possible target locations

setup does require some entity number changes but worth it i hope.

instructions:
1. place a pad to use as the movable target location (this works best as a decal) - you can hide it if you wish
1.a. rename it
1.b. insert it's entity number into script here
Quote: "local port_pad = ?"

2. place a teleporter device (to use as the screen/control panel) and attach the script to it
2.a. input the name of the pad (placed at step 1) into the 'ifused' field of teleporter
2.b. optional* apply sound at slot 0 for porting sound effect
3. place (up to 9) entities at each of the target destinations (again these are best if decals) - you can hide and turn off physics for those if you wish
3.a. input the entity number inside the script for each location
Quote: "--input entity number of area's here
dest_number[1] = ?
dest_number[2] = ?
dest_number[3] = ?
dest_number[4] = ?
dest_number[5] = ?
dest_number[6] = ?
dest_number[7] = ?
dest_number[8] = ?
dest_number[9] = ?"

3.b change the name (in the script) of each location to whatever you like
3.c. it's very important that you change
Quote: "local max_dest = ?"
to match however many destinations you have placed - 3 destinations = 3, 6 = 6 etc


note, in my video i also placed a teleporter at each target location to allow porting from every location (only need to repeat steps 2.a/b. - copy paste the teleporter), if you do not wish to allow this then simply dont place a teleporter at that location or place one without a script

in game use the input key to activate (set in script - default is "e") and numbers 1 ~ 9 to select a destination.

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 9th Apr 2015 15:43
Excellent, Now I am wondering if this can be applied to a winzone and choose levels instead.
Got me thinking, going try.

Thanks Smallg
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
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th Apr 2015 18:35
Simply amazing!, thanks a lot smallg.
I'll try tonight.
I always think than threads like this one, should be sticky, since it is a big scripts library that can help everybody.
Just my thoughts.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Apr 2015 18:14
new tech from the enemy, stealth suits
allows them to phase in and out of the natural realm, these troops are immune to damage and invisible to the naked eye - however they must return to fire so use your time wisely and kill them before they kill you

-waypoint paths are on (they will also return to patrolling if you manage to avoid them long enough)
*note they wont phase while patrolling or when below 30 HP*

no settings for this 1, just attach script to a character.





if you spot any issues please let me know.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 11th Apr 2015 23:40
Brilliant. Love the particles attached to them. Thank you again for the script.
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: 12th Apr 2015 08:13
amazing That is really great.
Thanks for this...

Cheers
harry
Harry
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 12th Apr 2015 11:23
Amazing troops! this open new doors, and gives most power to the scene, not time for think anything, you has to kill or die, is so simple.
Thanks for share it.
Another one for my smallg's folder on my desk.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 12th Apr 2015 18:29
how do you find out the entity number for the teleporter script... I'm having a few problems
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Apr 2015 19:09 Edited at: 12th Apr 2015 19:10
thanks

Quote: "Brilliant. Love the particles attached to them. Thank you again for the script."


the idea was to show a kind of cloud in their place but no way to position the smoke (without using a new object at least) so that's the best i could do, still gives a general idea of where they are while hidden so it serves it's purpose i guess
I was actually quite surprised they cant be hurt while hidden so the phasing had to be much briefer than i was originally intending anyway so the smoke became much less of an issue.

Quote: "@3com"
did you get the teleporter working and did it suit your request for your level?

Quote: "how do you find out the entity number for the teleporter script... I'm having a few problems"

you need to place an entity in the editor (as i said before decals are best) then hover the mouse over it (should turn green/red) then you will see at the bottom status bar a number like this
Entity : [1 {70002}]
it is the first number you need - in this case 1
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Mariokiki
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location:
Posted: 13th Apr 2015 17:52
Thanks Smallg for your teleporter script !

I tested it , works fine ! Easy to set up, as I like !

PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 13th Apr 2015 19:58 Edited at: 13th Apr 2015 19:59
Quote: "did you get the teleporter working and did it suit your request for your level?"


My apologies for the delay.
My first idea was to use an elevator, so I made a hole in my mesh, then I changed my thought and decided to use the teleporter, then my mesh did not need the hole, so I've been working again in my mesh, a space launcher.
Is still WIP, the texture is provisional, say that is still under construction.



Thanks again for helping me.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
TheSourceCode
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 14th Apr 2015 00:51
Hey SmallG, might remember me, I am the script newb that knows very little about Lua, and works day and night to get better. But anyways, I was wondering (if you are still taking script requests) if you could wip up a small script for me, (or if you are to busy, give me a little guidance on how to make it myself) that allows... That can.... Humm, let me word this differently:

Here is what I wanna do:
I would like to make it if the player presses the 'E' key behind an enemy, the player that performs this action is allowed to gain a certain amount of health, and kills the enemy you did this on, once the player presses 'E' behind the enemy.

Also, to make it where the enemies can't see you while you are behind them, but can if you walk in their sight.

Would be awesome if you could help me out out SmallG, I have been looking through your works, and your scripts are awesome!

(Also, sorry for my bad grammer/english)
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Apr 2015 18:51
Quote: "Here is what I wanna do:
I would like to make it if the player presses the 'E' key behind an enemy, the player that performs this action is allowed to gain a certain amount of health, and kills the enemy you did this on, once the player presses 'E' behind the enemy.

Also, to make it where the enemies can't see you while you are behind them, but can if you walk in their sight."


you would indeed need some custom AI as right now if you get close enough they will just turn around and attack you before you get anywhere near a stealth kill type range
i could do it but i'm already doing a script for harry's tank and so don't have time right now, i will try get to it in few days if no1 else offers to help

for guidance you would need the new AI script to:
-check for player being visible (along with his proximity range if you wish)

- do whatever if you can see him (rotate and attack i guess)

if you cant see him then check his range for the sneak attack

and also include any waypoint code you wish to make the character move while player isnt visible - this can be found in the fantasy character ai.

obviously that's only a general idea of the script, not a complete solution

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Apr 2015 18:55 Edited at: 14th Apr 2015 18:59
made this with gtox's new velociraptor
basically the babies follow the mother around unless you shoot at them or get too close, the mother attacks you while the babies will run for their lives
(if the mother dies the babies will obviously stop following and start kinda walking in large circles - if not under threat - originally i wanted them to kinda circle their dead mother but it was causing issues when the entity got "cleaned up" by the engine for being dead
)
it's pretty easy to set up for 1 parent and her children but slightly more complicated once you add another parent (you need to enter a few more entity numbers), however if anyone is interested i would be happy to release the code



life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 14th Apr 2015 19:30
Hi smallg

Id be interested in seeing the code.
Im only new to GG and .lua,
I like trying to follow the code to understand how things work
This code would also be good for birds as well.

I also might be able to adapt it to another idea I have.

I have gtox's fish pack, and I want the fish to scatter away from you when you enter the water and then return after you go away after a delay, and also a fishing script to catch the fish.

Thanks
perelect
I may be old, but at least my memory still ....mmm
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 14th Apr 2015 19:45
thats a amazing script smallg.

Real good.

Harry
Harry
PM
TheSourceCode
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 14th Apr 2015 20:35 Edited at: 14th Apr 2015 20:37
No problem, I can see you being busy with all of these amazing scripts!

But thanks for the help!
PM
Gtox
3D Media Maker
9
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 15th Apr 2015 18:11
Now that's just cruel
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th Apr 2015 18:48 Edited at: 15th Apr 2015 18:49
for the adult/mother you can use the standard velociraptor script

for the baby you need to create a new .fpe file with this info (basically just assigns the script and scales it correctly so it appears on the floor while moving - if you want smaller babies you will need to adjust the offy value or they will float)


you will also want to duplicate the bmp so you have a thumbnail for the model

once you have placed the mother you will need to get it's entity number and then input that into the baby script here (in place of the '?')
Quote: "--entity number of mum to follow
mum[e] = ?"


if you want to place more than 1 parent you need to specify which baby goes with which parent e.g.
Quote: "mum[6] = 5
mum[7] = 5
mum[8] = 5"

means babies with entity numbers 6 ,7 & 8 are following mum with entity number 5

there's no limit to the number of babies but it gets a bit crowded

now the script is here
velo_baby.lua


not my cleanest script ever but it works
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Sacalac
9
Years of Service
User Offline
Joined: 3rd Sep 2014
Location: Detroit, MI
Posted: 15th Apr 2015 20:23
Trying to add plr_money to a charactor when killed
I am trying to add script to zombies when killed that will give the player money. this to be used with Acid's Pay for open the doors script. Any help please?
Sacalac
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Apr 2015 17:37 Edited at: 16th Apr 2015 20:09
took a quick break to check out the steampunk models from the community packs created by members in the old forums originally FPSC X9. - apparently i missed them before somehow
got a quick AI script working - for some reason the death refused to work correctly but i got it working in the end with a bit of a workaround.

the script should work for any AI character with similar animations so it's a good start for basic AI - you just change the frames at the top of the script to match your own (if you dont have a specifc animation then you can use 1 that is similar)
they have accuracy (slightly lowered while running), bullet count & reload, fire delay (slightly higher while running) and damage

*the last trooper has slightly different stock frames but it's using the same script so same settings, still looks ok for a quick test*

the models are from here *** full thanks to the creators and Sparrowhawk for releasing them here! ***
https://forum.game-guru.com/thread/208967#msg2490363
edit* forgot to say you will also need to change the fpe file for the models so that fixnewy = 0 or they will be facing the wrong way



custom_character.lua
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
TheSourceCode
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 16th Apr 2015 17:41
Says the video couldn't be found for me.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Apr 2015 18:10
probably still uploading, it's there now
i also have your request done - apply the script to all characters you want to be able to stealth kill
(just put it together quickly so it may have a few flaws but the basic concept works)




stealth_kill.lua
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
TheSourceCode
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 16th Apr 2015 18:12 Edited at: 16th Apr 2015 18:29
Wow, thanks a bunch SmallG!

EDIT: Tested, and works perfectly! Only thing is, it doesn't play a sound when I press E, and can't find where in the script that I can. Still an awesome script though!
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 16th Apr 2015 23:39
Nice stuff again smallg.
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

Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 17th Apr 2015 11:42
awesome script, every script you make is so useful smallg, thanks.
Old Larry
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 17th Apr 2015 11:56
And here another two great scripts by smallg: darkzone.lua combined with nightvision.lua in game:
darkzone


nightvision (can be change the omegacore key with the new GG function key)


And one short video example here:
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"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."
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Apr 2015 20:59
always good to see your videos larry, the dual wield guns are cool

Quote: "Tested, and works perfectly! Only thing is, it doesn't play a sound when I press E, and can't find where in the script that I can. Still an awesome script though!"




updated to allow sound at slot 1 (need to assign the sound to each character though)

the bit you were looking for is this
Quote: "if g_InKey == input and pressed == 0 then
SetEntityHealth(e,0)
PlaySound(e,1) <-- new line here
SetPlayerHealth(g_PlayerHealth + kill_health_gain)
pressed = 1
end"
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 18th Apr 2015 12:05
@ smallg
Entities are not safe with you mate.
Thanks for share it, great job as usual!

Think it can be adapted to kill entities with ie: chemical product bomb, acid, or something like that.
Of course you've to assure one mask before run the bomb, so you can kill bunch of them, at once.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 18th Apr 2015 16:09 Edited at: 26th May 2015 21:29
so i have been meaning to write this little function for quite some time but finally got around to it
detect if player is looking at an object

you have 3 variables to pass in (it'll work even if you don't supply the second 2 though - defaults to a small 0.5 angle window and a long 3000 range - about cut-off point for scripts)

Quote: "PlayerLooking(e,dis,v)"

'e' is the standard entity number to check
'dis' for how far away the player is before he can be considered looking at the object
'v' for variance in the angle - for wider objects you can allow this to be bigger

meaning you can now simply call my command instead of the GetPlayerDistance(e) for things like collectibles and it'll check distance and facing in one call.

so
Quote: "if PlayerLooking(e,200,10) == 1 then"

will check if the object is within 10 degrees either side of the players facing and also within 200 distance of him
*returns 1 if true and 0 if not*
however you can also use
Quote: "if PlayerLooking(e,300) == 1 then"

and the command will still work but only the distance value is adjusted (in this case 300) and the angle variance will remain default (0.5)
and finally you can use
Quote: "if PlayerLooking(e) == 1 then"

to check the object compared to the default values

you place the above code in your global (or below the exit(e) part of any script) and then use the call like my examples above in your scripts same as any others

*note this only works for Y angle to keep it simple, you can still look above or below the object and it'll count as looking at it - as long as you're in range*

to get the example in this video you need a very basic script like this

as you can see it'll show the prompt for any object within 500 distance & 4 (2+2) degrees of the player's angle
if you have put the above function inside your global.lua that's all you need
if not then you can simply place it at the bottom of the script like so


life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 18th Apr 2015 18:46
Nice these 3 variables working as param array, so means we now have a new way to get distance+angle, thanks to you.

Your script prompt about it in your video, but I can not see this piece of code in it.

3om

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 18th Apr 2015 23:31
You wouldn't want the prompt in the function or it'd always show, you can create the prompt easily as I did with a script to check if the result is 1 and then prompt... Its just to show it works, what you do with the check is up to you; collectibles, open a door, speak to NPC... Etc
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 19th Apr 2015 07:14 Edited at: 19th Apr 2015 07:16
Hi , I clicked on the script links at the beginning of this thread and they just take me to the forum home page. Are these broken links now?
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Apr 2015 08:43
Yes this thread started pre GameGuru so the links are for the old name, they are all in the thread however - though I can't say with any certainty if the old scripts will still work either, they should but may require small changes to bring them up to date (I haven't got around to testing them so I haven't updated the post yet), if there's something specific you're looking for or find any issues let me know and I'll try help
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 19th Apr 2015 14:12
Has anyone done a script for a moving platform so that when a players jumps onto it he is carried along on it, and if so can the platform move up and down or left and right.... thanks
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 19th Apr 2015 14:21
also for the steampunk pack, there is no lua files, are they still able to be downloaded.....
TheSourceCode
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location:
Posted: 19th Apr 2015 16:28 Edited at: 19th Apr 2015 16:31
Tarkus, a script like that was made by SmallG, go to page 6 and ctrl + f and type in "lift"

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Apr 2015 16:40
lift only goes up and down, if you want to move forward you may need to use some trial and error as there's not really a decent way to do it yet - if you simply moved the object forward the player wouldn't move with it.
you could maybe make a hollow box and turn collision on when the player is inside... that might work for slow speeds
otherwise i combination of TransportToIfUse(e) and moving the object is the only way to do it - this wont allow for mouse looking and such though

i think the steampunk models were originally for FPSC? that used fpi so there wouldn't be any lua scripts
you can use my script above to make them perform the basic animations though
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 20th Apr 2015 03:55
Hi smallg,

RE: PlayerLooking function

I am trying to get your player looking function to work.
I not sure what code to put where..

Id like to do the same as you have done in your video, with the text on the barrels you are looking at.

Could you help me when you get a chance.

thanks




I may be old, but at least my memory still ....hmmm

Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 4 GB Ram, Radeon (TM) HD 6490M, 2789 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Apr 2015 10:59
Quote: "Hi smallg,

RE: PlayerLooking function

I am trying to get your player looking function to work.
I not sure what code to put where..

Id like to do the same as you have done in your video, with the text on the barrels you are looking at.

Could you help me when you get a chance.

thanks"


updated the above post with the code used for the video
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Apr 2015 10:30 Edited at: 25th Oct 2017 18:35
jump scare script
- apply script to entity you want to appear
- rename entity & set it to spawn at start = no
(optional - give it a sound effect at slot 1)
- place trigger zone & set ifused field to name of entity above
(optional - remove sound effect from zone)

jumpscare.lua


lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 25th Apr 2015 11:07
fantastic script smallg, thank you very much.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Apr 2015 11:31
would anybody be interested in using this? i figure it might make a nice biometric type reader effect if you expand it some more
it's a little bit long to explain the set up and requires a minor change to the stock scripts but basically you need to change the ai code so it will return the name of the entity
so it looks something like this
Quote: "function ai_soldier_init_name(e,name)
weapon_name[e] = name"


then apply this script to an entity (always active)
*note it doesnt actually make the scene red, that's set by me in the game - you can however set it in the script yourself if you wish*
biometrics.lua


life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 25th Apr 2015 11:41
yes, yes and yes, could use an existing entity as a scanner and once picked will enable the biometrics, a bit like mr spocks tricorder, fascinating!, good one smallg
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 25th Apr 2015 18:44 Edited at: 25th Apr 2015 19:37
Just made some small changes to jumpscare.lua, hope youe don't mind smallg

* added a light which emits when you enter the trigger zone, find the entity number of the dynamic light and enter that as the local variable ln
so if entity 6 is your light, just put local ln = 6

Place the light just in front and above the entity that will appear when you trigger the zone.

Looks great in a dark scene.

jumpscare2.lua


---------------------------------------------

Here is the video on the first chapter of my game with the new added jumpscare.





Eteponge
9
Years of Service
User Offline
Joined: 1st Mar 2015
Location:
Posted: 28th Apr 2015 21:26 Edited at: 28th Apr 2015 22:07
smallg: I really enjoyed the Shop script for setting up a Merchant! I was able to create a zombie merchant (who grunts a zombie moan when you purchase a weapon as confirmation) using your script!

https://www.youtube.com/watch?v=LaMmREx-27k - A zombie merchant I created using GameGuru. Simply as a test. LUA Script used: Shop by smallg. Song used: Datsik - Nuke Em (Protohype Remix).

I have some questions though. I was able to make a shop merchant who sells a pistol, pistol ammo, and a med kit, but the ammo and med kit do not pick up when purchased, despite using the correct item numbers. (I successfully changed the 002 and 003 images in the image folder to an image of Ammo and of the Med Kit however, and it worked!)

I used this ...



*Sometimes* the Ammo would work the first time you tried to purchase it, but most of the time it would do nothing. I'm very very new to LUA Scripting, total beginner. Maybe the AddPlayerWeapon needs to be changed to something else for the Ammo and Med Kit for them to work?

Also, I plan on having multiple shops, not just all using one script. I tried to make a shop1, shop2, shop3 variant all of which gave LUA errors (I even tried to change the "shop" commands in the script to "shop1" "shop2" "shop3" but it still gave errors.)

The biggest thing though, is how to make the money system in your shop script global? So zombies can drop cash and it stack (I already have your script line for making zombies drop cash, but it's not global, so it script crashes when I put it in their ai).

EDIT: How on earth do you get YouTube videos to work on here?!? I used the YouTube Video code on the forum with my url link, and it did absolutely nothing! It won't even hypertext link.
PM
Eteponge
9
Years of Service
User Offline
Joined: 1st Mar 2015
Location:
Posted: 28th Apr 2015 22:39
Update: I was able to make the Ammo and Med Kits work in the Shop by adding AddPlayerAmmo(item_number[item]) and AddPlayerHealth(item_number[item]) after AddPlayerWeapon(item_number[item]).

One minor problem though. For some reason, now when I buy Ammo at the Shop (which grants 8 ammo each) it for some reason adds 8 health to me in addition to the 8 ammo. The amount of ammo on the gun I buy does the same thing now. The health kit seems to be working fine though, you can buy it and it works too.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 28th Apr 2015 22:48 Edited at: 28th Apr 2015 23:01
can you post your entire modified script so i can have a look and see what's happening when you buy the ammo etc
edit: ok see you got it working yourself
the issue is that they all read the quantity setting and it doesnt check if it's health or ammo or what so it adds for each call of add health/ammo (weapon doesnt count because it doesnt use quantity for that).
i.e. you buy 8 ammo but you get 8 ammo and 8 health - it's not something you did but just the way the calls work, you would need to set a check in your code to compensate for this, i remember having to do it for my supply box script a while back.
i'm not sure if there's a quicker way, maybe you could rename them "ammo" and "health" and do a check for the name.
or simply have 1 shop soley for HP and another for ammo only, then remove the 'add' calls you no longer need for each script.

for the global money remove the word "local" before it
then when you kill a zombie you need to put something like
money = money + 200
(just change the amount to whatever)

for multiple scripts you need to rename each 'function' part to match the new name
ie.
function shop1_init(e)
function shop1_main(e)

function shop2_init(e)
function shop2_main(e)
etc

for youtube videos you need to only put the code given into the tags rather than the whole address (in your case LaMmREx-27k)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-03-28 18:13:23
Your offset time is: 2024-03-28 18:13:23