Scripts / [STICKY] Smallg's free scripts

Author
Message
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 11th Jun 2014 17:21
I think it would more beneficial and efficient if we could use just one 'Occlusion Always on' script, I still seem to get random crashes around where I place the occlusion scripts on the map, I think?
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 11th Jun 2014 17:37
It seems like after adding the new init function to the "Occlusion always on" script I am getting these odd crashes
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jun 2014 00:17 Edited at: 12th Jun 2014 00:19
ok so no you can't use multiple zone occlusion right now as it'll count you as always outside the zone - i will fix this at some point but not right now, sorry

added the init call to the occlusion scripts





occlusion.lua (always on version) *****note********** set the "Always On" setting (properties menu inside the editor of the object you apply this script to) to YES and it will cover the entire map



life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 12th Jun 2014 00:28
Again many, many thanx! I'm still new to lua. You are a big help to lots of people...
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 12th Jun 2014 17:34
Is there a way to spawn a bunch of entities after one particular character has bee killed?
almightyhood
11
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 12th Jun 2014 17:46
what like say a key for a gate or more enemies to appear?. or various other items to pick up?, there is a loot corpse script smallg has worked on, not sure if spawning actual models is possible yet? would be nice though

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 12th Jun 2014 17:52
Yea, spawn more enemies?
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jun 2014 19:42
not really because we set the spawn location inside the editor and not inside the Spawn(e) command
but it is possible i just kinda felt the time it would take wasnt worth it when i had a working variable for loot quite easily but i could look into it and let you know if i get it working or not (it might take some time though)

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
tomjscott
User Banned
Posted: 12th Jun 2014 19:57
I'm fairly certain that spawning entities dynamically through scripting is impossible at this time. You need to have these entities already created and placed on the map for them to spawn.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 12th Jun 2014 20:01
It's up to you. Right now I'm having so many melt downs with my competition level, so close but yet so far... Beta fun...
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jun 2014 20:21 Edited at: 12th Jun 2014 20:22
ah yh i have no doubt that the entities will need to also be placed onto the editor - i'm just going to look into the placement issue (getting it to spawn at the dead guy's location)



i'll pm you morph

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
tomjscott
User Banned
Posted: 12th Jun 2014 20:26
Quote: " i'm just going to look into the placement issue (getting it to spawn at the dead guy's location)"


Well, there's unfortunately also no way to place an entity at a specific location in a single command. You can only use MoveForward, MoveUp, etc. So, you can really only do this if you have invisible entities move really fast in the exact correct direction while insuring they end up at the desired location and then spawn them from there. A major hack, but sort of possible with a lot of work.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jun 2014 22:26
indeed, im giving up again for now, i was hoping to get it done using a while statement but it just crashes so i'll rethink it and try again another time

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
unfamillia
Forum Support
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 13th Jun 2014 00:29
Just be careful when using anything that relies on spawning things! I was using a simple script to spawn something behind the player; it works in test game, but, doesn't work in built game! There is a bug with the built game. I have reported it to Scene Commander and it has been noted as an official bug, of which, nothing can be done before competition deadline.

Try to keep the level to a decent size without the need of using the occlusion scripts.

Cheers

Ja.

kehagiat
11
Years of Service
User Offline
Joined: 16th Jul 2013
Location:
Posted: 13th Jun 2014 00:49
@tomjscott

[quote=]Well, there's unfortunately also no way to place an entity at a specific location in a single command. You can only use MoveForward, MoveUp, etc. So, you can really only do this if you have invisible entities move really fast in the
tomjscott
User Banned
Posted: 13th Jun 2014 01:02 Edited at: 13th Jun 2014 01:04
Quote: "Actually I worked out a solution to this. See the attachment in http://fpscrforum.thegamecreators.com/?m=forum_view&t=208976&b=2. It includes a command SetPos(e,x0,z0)"




I took a quick look at that earlier today. Nice work on that. But what you're doing is pretty much exactly what I suggested was the only possible way of accomplishing this. Using MoveForward to get the entity into position over time. It doesn't let you do a SetXYZ type function that would instantly place an entity at that location. That's what I meant. Still, an awesome piece of work. But with the whole RotateToPlayer function now working on non character entities, I'm pretty much good to go with what I need at this point. Your tools would definitely help out others in this thread.



Edit: I take that back. I guess you're calculating the exact distance needing to be moved and applying it in a single command. That definitely would do the trick. Except, aren't you going to have issues with blocking entities and terrain?

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
tomjscott
User Banned
Posted: 13th Jun 2014 01:06
Or does the massive move amount simply eliminate the possibility of anything blocking it?

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007
kehagiat
11
Years of Service
User Offline
Joined: 16th Jul 2013
Location:
Posted: 13th Jun 2014 06:43 Edited at: 13th Jun 2014 07:33
@tomjscott



Quote: "

Except, aren't you going to have issues with blocking entities and terrain?

...

Or does the massive move amount simply eliminate the possibility of anything blocking it?

"


Good points ... and I cannot give a compl
Gtox
3D Media Maker
10
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 13th Jun 2014 08:38
Beginner questions - where do all these code snippets go? Into the global.lua file, or do you create a new .lua file and then replace the script the entity was using?
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 13th Jun 2014 19:38 Edited at: 13th Jun 2014 19:42
I was trying to use your simple quest1 script. Nice work, but when I tried to return the stolen items to get my reward I get an error: "error running function: attempt to perform arithmetic on global 'money' (a nil value)

So I just added a money global, and also the init function, now it works great. Thanks for the script
Volga
10
Years of Service
User Offline
Joined: 31st May 2014
Location: Turkey
Posted: 13th Jun 2014 21:23
I know this is simple but I don't know how to use these codes. After adding them into scriptbank what should I do? For kill quest code or day-night code. Where should I put them? A trigger or a different thing? Sorry for asking this but I'm new to kind of these things.

Vertigo
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Jun 2014 23:25
kill quest hasnt been updated yet, sorry, if you want to try it add


at the very top (or kill_quest? can't remember how i named it exactly right now, i will update it soon)

just place any entity (a table / building / tree etc) and link the script into it's main field

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Jun 2014 22:32 Edited at: 14th Jun 2014 22:34
updated killquest to now just include all enemies on the map (you just set the number to kill at the top of the script)

note this will only allow 1 quest per map (rename the script each time if u want multiple quests for now)







to use it place something to give out the quest (a stock character for example) and then set the script into his "main" field in the right click menu

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Jun 2014 12:38 Edited at: 16th Jun 2014 12:53
new script for landslide (rock fall) effect



it's done on player distance right now, apply the script to the rocks you want to fall and when you get near they will fall

some notes;

- rocks will automatically be set to a certain height from the script (you can change it at the top settings) so you can simply place all rocks at ground level in the editor

- rocks start hidden by default (cos it looks better) and finish up the correct way up by default

- rocks wont go through flat terrain (600 height) but it you have changed the height of your terrain you will need to adjust the setting

- each rock will only hit the player once (if he is in range of that rock) so if you want to kill the player set the damage high

- you can adjust the speed of the fall but it will also add a random speed (based on the speed you set) so that rocks fall at different speeds so it looks better



landslide.lua











*also updated the original post with links to the replies containing the scripts so it's easier to find them*

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 16th Jun 2014 15:31
Smallg, this is a very cool script. Thanks for this! The falling rocks look very believable. Great work!
almightyhood
11
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 16th Jun 2014 23:34
yeah it does make it look good, we used them in u mazin me crazy works a treat

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
science boy
16
Years of Service
User Offline
Joined: 3rd Oct 2008
Location: Up the creek
Posted: 16th Jun 2014 23:49 Edited at: 16th Jun 2014 23:54
How about a hud that flashes up in certain radius like a enemy with the name come up at 200 yards. And when killed it is removed. I spent 3 months working on that one.I had it work once and my pc burnt out and lost it. Was in fpi But I lost will to live. It was written into the enemy script. An added part. Which when enemy spotted you it pulled up a hud. Then attacked but then I could not lose the hud when destroyed or he went out of range or went to way point return

an unquenchable thirst for knowledge of game creation!!!
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 17th Jun 2014 15:33
Is it possible to stop certain entities, like characters, from occluding within the script? I say this because when AI is occluded it looks like it loads a different script or something strange, and wonders away from where they are supposed to be standing as part of the story line.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Jun 2014 19:24 Edited at: 17th Jun 2014 19:24
Quote: "Is it possible to stop certain entities, like characters, from occluding within the script? I say this because when AI is occluded it looks like it loads a different script or something strange, and wonders away from where they are supposed to be standing as part of the story line. "




did a quick test and this should do what you require (dont forget to turn it always on )



occlusion_minus_enemies.lua



life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
morphtactic
13
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 17th Jun 2014 20:21 Edited at: 17th Jun 2014 20:36
Thanks again smallg, I'm sure learning a lot from your genius. Script looks excellent. I'll try it out...
Volga
10
Years of Service
User Offline
Joined: 31st May 2014
Location: Turkey
Posted: 18th Jun 2014 15:58
Thank you mate.

Vertigo
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 19th Jun 2014 00:44
You are the scripting king. Thanks again.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 4gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 19th Jun 2014 01:39
I got a nil value on hurt player Small, what did I do wrong? Surely copy paste and add your name to the script cant be that hard right?

[img]http://files.enjin.com/191696/UA Members Banners/Imchasinyou.jpg[/img]
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Jun 2014 20:15
Quote: "I got a nil value on hurt player Small, what did I do wrong? Surely copy paste and add your name to the script cant be that hard right?"


what do u mean on hurt player? which script?

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 19th Jun 2014 23:10 Edited at: 20th Jun 2014 00:02
My fault there, I was thinking it was its own thread. THIS is why you dont work and look at scripts and copy paste and then email stuff to yourself from work. Any how, I think when I first tried the script, I sprayed too may rocks into the map. But yes, it does work fine. Now with this script in mind, can you place an entity at a specified height value and then make it move across the screen for flight yet?



Any how, after further testing, If there are too many rocks placed with this script, here is the error that pops up on me.







Oh ya, I also got this when i was under them

[img]http://files.enjin.com/191696/UA Members Banners/Imchasinyou.jpg[/img]
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Jun 2014 00:04 Edited at: 20th Jun 2014 00:17
oh the landslide script? well it just relates to the actual object running the script (the hurt command in this case i mean - as im using e) so should definitely exist... otherwise how would the script be running? oO



glad you got it working anyway



and yes you can make stuff "fly" but you need to also use MoveUp(e,v) along with MoveForward(e,v) (note moveup can just be a constant value if u want a set height, it's just to stop it reseting back to terrain height when moved)



e.g







edit can u give me an idea of how many u are using cos i tested and it's working fine with this many (getting hit / not getting hit or dying all worked as expected)



also it's working correctly with a few rocks? you can take damage?





(did notice a bug where the HUD still displays the blood splatter even though im actually in the editor in this screen shot... )

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 20th Jun 2014 01:51
Jeesh, I diodnt have nearly that many. Im running your script untouched as I dount know scripting. I placed a rock, assigned the script, entered spray mode and then placed my marker under it to play with getting stoned. . . . (see what i did there) lol. and when i hit test, I got that error. I knwo it works for em with a few rocks that i have to get near but not if Im directly under them at the start. Im not sure why I even care its not like the game would start that way anyhow. . . . . its a great script and Ill continue to mess about with it.

[img]http://files.enjin.com/191696/UA Members Banners/Imchasinyou.jpg[/img]
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Jun 2014 10:30
lol
well i can't seem to reproduce it even setting the start marker under them and / or using spray
the only thing i can think of is check you have

in your global file (it's second from bottom - was added with 1.0071)

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 20th Jun 2014 12:55
suprisingly enough, I did not.

[img]http://files.enjin.com/191696/UA Members Banners/Imchasinyou.jpg[/img]
PM
Sparrowhawk
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 12th Apr 2011
Location: Planet Magrathea
Posted: 22nd Jun 2014 16:37
Is it possible to add a bit of(/bit more) random rotation to the falling rocks?

Either way it looks very good, I know exactly where I'm going to use it

Now all we need is dust cloud decals (Do decals work in reloaded?) and particles!

Custom Mac Pro (2014): OSX 10.9 (Mavericks) and Windows 8.1 Pro: Octa-threaded Xeon E5 v2 @ 3.7Ghz [9775]; Dual AMD FirePro D500 (3GB VRAM Each) [3769]; 12GB RAM [2517]; 512GB SSD [9074];

At the detected score [passmark 9074], my SSD is ranked 3rd of all SSD's in the charts
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd Jun 2014 18:19 Edited at: 22nd Jun 2014 18:38
Quote: "Is it possible to add a bit of(/bit more) random rotation to the falling rocks?"




edit ok so apparently randoming it didn't work as they all used the same random number so you can use this new code

so i changed the spin variable and added a some new settings for randoming spin - see comments in script





Quote: "Now all we need is dust cloud decals (Do decals work in reloaded?) and particles!"




not yet as standard, i think rolfy and tom had to adjust the shader to get it working?

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Jun 2014 11:49 Edited at: 23rd Jun 2014 11:53
new soundinzone to better allow 3D sound (once triggered from zone it'll fade in and out (using the inbuilt 3D volume) until your distance is reached

to change how far you can exit the zone change the line

max_distance[e] = 400



soundinzone2.lua







life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Jun 2014 15:02 Edited at: 23rd Jun 2014 18:16
a teaser of what is currently being worked on

this was quite a headache to get working, so many arrays

but it's looking very solid right now



the actual scripts are in use in the competition right now but once it's over i shall release them



all moving at random speeds





all moving in formation





edit; 2 new videos as i'm having some fun testing them

endless tank racing





and a zig-zag type movement - this one took quite a lot of coding (as i had to path the 2 "outer" tanks seperately but really i can't see you wanting to move like this in a real game but it shows that true/advanced pathing is possible





basically with just a few (depending on number of vehicles and how specific i want to be at least) i can make them do a lot

if only i knew how to code a waypoint system... that would be amazing XD



p.s. this is just 2 scripts, 1 to trigger (and actually carry out the pathing) and 1 to store the settings onto the vehicles

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 23rd Jun 2014 15:28
That's some awesome work! I can't wait for that ability to be has by every one! Way to raise the bar for FPSCR!

[img]http://files.enjin.com/191696/UA Members Banners/Imchasinyou.jpg[/img]
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Jun 2014 20:13 Edited at: 26th Jun 2014 00:23
new video and script from a little test i was doing with rotations - made a little game of trying to outrun the tank but it was very difficult to film (as i was too busy running), so i filmed the basic idea instead



just 1 script for this deals with all the trees, the speed adjustments (tank gets briefly slower when hitting the trees so you can set up a kind of "road block") and of course the rotations - just apply it to the tank (or whatever you want to chase you)



tank_des.lua







life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
The Tall Man
10
Years of Service
User Offline
Joined: 24th May 2014
Location: Earth
Posted: 25th Jun 2014 21:52
What you could do is you could also move the tree up the Y axis toward the tree's radius - as it's falling, such that their final resting place is ~on~ the ground Or it you could let the physics engine handle that (assuming that's possible). Then if there's some way to semi-flatten the side of the tree that's on the ground

With gravity, its speed of rotation would increase as its angle changes. You could scale the rotation speed by the sin of the angle. You might add a slight bias to get it started, since standing tall (0 degrees) would scale to 0.
PM
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 25th Jun 2014 22:48
Are you kidding me? I think it time you joint the FPSCR team and show em how to. . . . lol

[img]http://files.enjin.com/191696/UA Members Banners/Imchasinyou.jpg[/img]
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Jun 2014 23:21 Edited at: 26th Jun 2014 00:27
Quote: "What you could do is you could also move the tree up the Y axis toward the tree's radius - as it's falling, such that their final resting place is ~on~ the ground Or it you could let the physics engine handle that (assuming that's possible). Then if there's some way to semi-flatten the side of the tree that's on the ground



With gravity, its speed of rotation would increase as its angle changes. You could scale the rotation speed by the sin of the angle. You might add a slight bias to get it started, since standing tall (0 degrees) would scale to 0. "




first part i think you ask too much



second part, will do that

edit ok had a go at making speed "fall at a dynamic speed but it's very difficult to see if it works very well as they fall so fast at normal fps - was trying to test with fraps (which limits the fps a little) but honestly i didnt see much difference between this and the original (at 60fps anyway, at 100fps it's a huge difference - much too fast)

really wish we could limit fps

also fixed a few things and tried to limit the wacky tree rotations if the tank only 1/2 ran 1 over and then ran it over again



Quote: "Are you kidding me? I think it time you joint the FPSCR team and show em how to. . . . lol"




lol im sure they could do this stuff in their sleep

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
almightyhood
11
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 26th Jun 2014 01:32
loving the vids running tree's over smallg m8 very impressive .. the other vids also are good

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Jun 2014 15:39
ever wanted to be a giant? now you can!



haha ok it's just an edited lift script, here's the actual script to create a lift (note you need to press E twice to activate the lift but it's ok otherwise)


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-12-22 02:33:59
Your offset time is: 2024-12-22 02:33:59