Scripts / Gun turrets anyone?

Author
Message
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Jun 2017 11:07


Four static and completely unrelated models, a bit of scripting and voila.

Next up add some decals and fake the gunfire like I did for the choppers, not sure whether to have them firing shells or go for a more scfi energy weapon look.

Been there, done that, got all the T-Shirts!
PM
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 10th Jun 2017 11:41
scfi energy weapon look Would suit the models better I think.they look like nice models from the quick glance in the vid.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Jun 2017 12:14
The guns I found online (CG trader IIRC), the radar dish is the one from the NASA 3d site (I used it in the moonlander demo) and the base is one of Cosmic Prophet's Sci-Fi Buildings - the 'firestack' one). All are free models.

The movement and positioning of the entities is all done via script (yep, quaternions again ).

I'm currently coding the part that will rotate the guns and point them at the player.
Been there, done that, got all the T-Shirts!
PM
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 10th Jun 2017 12:57
It would be cool if the radar stopped when facing the player then the gun followed to lock onto the player.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Jun 2017 13:31
I figure that the radar should stop scanning when the player is detected, then rotate to the player and then the guns move to the player and finally if player is still visible start shooting. If player moves out of detection range (for example by hiding behind something) then the gun should move back to a neutral position and the radar resumes scanning.

This should enable a canny player to move from hiding place to hiding place whilst the radar is pointing away.

Here is the gun tilting code in action:



Currently rotation and tilting is random just to test it out, next I'll add player detection code.


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: 10th Jun 2017 15:44
This is working out to be quite spooky.

Next up, make them fire at the player but I'm going to take a break and have something to eat first.



Been there, done that, got all the T-Shirts!
PM
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 10th Jun 2017 17:43
Quote: "I figure that the radar should stop scanning when the player is detected, then rotate to the player and then the guns move to the player and finally if player is still visible start shooting. If player moves out of detection range (for example by hiding behind something) then the gun should move back to a neutral position and the radar resumes scanning."


Exactly what i was thinking,nice work .

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Jun 2017 19:06
Getting there, starting to push GG though.

Been there, done that, got all the T-Shirts!
PM
lotgd
3D Media Maker
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 10th Jun 2017 20:38
AmenMoses You are doing a great job, very useful! thank you!

My Pc Specs : Win10pro64bit /Msi z97 / i74770k / gtx1070 / 16gb ram / SSD 850Evo
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 10th Jun 2017 20:48
Most Impressive as usual ..
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Jun 2017 22:10
Final video and scripts:

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

Attachments

Login to view attachments
PM
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 10th Jun 2017 22:23
That's realy cool AmenMoses,thank you.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Jun 2017 22:35
It still has a few rough edges and needs audio adding but it kept me off the streets for a while at least.

Been there, done that, got all the T-Shirts!
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 11th Jun 2017 02:04
Incredible. Nice job.
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.

Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 11th Jun 2017 08:44
Yeah, It sure could use some laser blast sound. Turret movement sound. Hit explosion sound. I don't know how to add them? But I have some sounds that should work? The Scripts are awesome by the way.
Jim C

Attachments

Login to view attachments
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 11th Jun 2017 09:41
awesome work amen roses, thank you. This will be very very useful
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
0Alemar0
17
Years of Service
User Offline
Joined: 25th Jan 2007
Location:
Posted: 11th Jun 2017 15:12
wow AmenMoses thats so nice .thank you very much!
www.alemargames.com
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 11th Jun 2017 16:54
This is fantastic! thank you!
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Jun 2017 17:51
Cool stuff. Nice job once again!


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Jun 2017 18:46
Awesome job!, ty for sharing.

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
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 11th Jun 2017 21:58 Edited at: 11th Jun 2017 21:59
Can I request that anyone who puts this to use post a video showing the result, I have put a ton of scripts up on here for people to use and so far have seen very few results of them being used!
Been there, done that, got all the T-Shirts!
PM
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 12th Jun 2017 10:01
Great work on the turret towers, a great combination of modeling, animation, scripting and that extra step which makes it all come alive within the game world If you would like these turrets to appear in the Scifi DLC pack, let me know as I think they will be a great addition sitting alongside the Drone army, ready to repel any pesky humans from Mars
PC SPECS: Windows 8.1 Pro 64-bit, Intel Core i7-5930K (PASSMARK:13645), NVIDIA Geforce GTX 980 GPU (PASSMARK:9762) , 32GB RAM

The Storyteller 01
14
Years of Service
User Offline
Joined: 11th May 2009
Playing: around
Posted: 12th Jun 2017 11:12
That is awesome work and you are very generous to share it.

Thanks!
In case you find my grammar and spelling weird ---> native German speaker ^^
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 12th Jun 2017 11:23
Quote: "Great work on the turret towers, a great combination of modeling, animation, scripting and that extra step which makes it all come alive within the game world If you would like these turrets to appear in the Scifi DLC pack, let me know as I think they will be a great addition sitting alongside the Drone army, ready to repel any pesky humans from Mars "


Well you don't get much more recognition for your work than that ... That's as high as it goes
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Preben
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 12th Jun 2017 11:57
Super scripting, looks fantastic
best regards Preben Eriksen,
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 12th Jun 2017 12:31
Quote: "If you would like these turrets to appear in the Scifi DLC pack, let me know "


Cool idea .

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
yrkoon
20
Years of Service
User Offline
Joined: 14th Jan 2004
Location:
Posted: 12th Jun 2017 14:43
Impressive, as always, Amen Moses.

I think they would look even more menacing when - in "search phase" - the guns would NOT sway smoothly but would give the radar a "headstart" until it has turned between 90° and 120° and then jolt instantly into the new position, aligned with the radar for a moment, which - of course - keeps rotating smoothly. After the radar passes the next random angle between 90 and 120 of the radar, the guns jolt again, and so on.

In "detect/logon phase", they of course should follow the target smoothly.
Lives of great men all remind us we may make our lives sublime
PM
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 12th Jun 2017 17:39
these are brilliant AmenMoses thank you
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Jun 2017 19:34
@Lee, the models are not mine and it is all done with scripting, no animation here at all!

The tower part is from the Cosmic Prophet Sci-Fi buildings pack, the radar dish from the NASA 3d models website and the gun turret bit is a royalty free model from CG trader.

The shots are from the base GG decal pack so that's not a problem.

I could easily adapt the scripts to any similar models so if you have any that are appropriate that might be a better option.

@yrkoon, the current behaviour is very simple to make the code a little easier to understand (and simpler to debug). Plus it only took a day to make.
Been there, done that, got all the T-Shirts!
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 13th Jun 2017 19:26
Quote: " I have put a ton of scripts up on here for people to use and so far have seen very few results of them being used!"

At least you get feedbacks.

I'm thinking to make my own models, so I'll can to test it when done.

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
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Jun 2017 19:38
I have found a better dish to use (see attached pic), again from the NASA site I'm sure CP would probably be ok with using the tower itself but the guns themselves would be tricky getting permission for distribution so if they could be replace with something 'locally' made then Lee could probably add them to the Sci-Fi pack without any legal ramifications.

I'm playing around with more decals, adding some sort of indication on the tower that the player has been detected and making them look more 'alive'.


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

Attachments

Login to view attachments
PM
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 13th Jun 2017 19:43
It's always one of the trickiest parts of assembling a game maker product, in that all the assets should not only be free to use, but allows the end user to sell them as part of their game. Not many asset licenses out there allow sub-licensing of any kind, so we often had to commission all our own art, or create packs from third parties with a special license to create a contract between the original artist and the game author. If the turrets ever get remodeled as assets that have no sub-license restrictions, I would look forward to adding them and the script(s) to the Scifi Pack, and of course, I am always freeing up a little resource for artwork each month so there may still be a method to get them in one day In the meantime, it's great that they are available right now from this thread and means everyone who finds themselves here will benefit from some pretty vicious scenery weapons for their next futuristic game project!
PC SPECS: Windows 8.1 Pro 64-bit, Intel Core i7-5930K (PASSMARK:13645), NVIDIA Geforce GTX 980 GPU (PASSMARK:9762) , 32GB RAM

AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Jun 2017 21:30 Edited at: 13th Jun 2017 21:31
Unfortunately I can't model for toffee but I can make other peoples models dance (literally in some cases ).

The great thing about using Lua in this way is that the models themselves can be really simple, no complicate rigging or animating needed as Lua script is doing all the heavy lifting. The downside is that the user needs to do a bit more work making sure all various components are added to the scene as the overall effect only works if all the elements are present and in the right quantity (for example in the demo I have about 50 'green flare' decals in the map!).

Here is the decal effect I mentioned in action, might be a bit too subtle though:

Been there, done that, got all the T-Shirts!
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 13th Jun 2017 21:34
Just keeps getting better. I can model, but cant script to save my life. Everyone has their specific talent.
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.

AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Jun 2017 21:43
If I was able to model I would make several different gun turrets, pristine ones, slightly damaged ones, and a completely destroyed ones, then I could add explosions, smoke etc, effects when the player hits them and switch the models as appropriate. Same for the dish.


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: 13th Jun 2017 22:13
How about this? Too much?



btw, I've changed the gun rotation to always take the shortest route to the player.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 13th Jun 2017 22:30
Hi AmenMoses, my modelling skills have a lot to be desired but I have started to make a dish for you should have it ready by morning, I will have ago at the turrets too bear with me
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped

Attachments

Login to view attachments
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 14th Jun 2017 06:55
That decal is cool also. Guess the point would be, is that one could change them to any decal they had in the library.
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.

GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 14th Jun 2017 10:15 Edited at: 14th Jun 2017 17:45
here is a basic dish, I have almost finished the turrets too sorry if its not very good I am still learning
UPDATED - NEW DISH
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped

Attachments

Login to view attachments
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 14th Jun 2017 11:45
Quote: "sorry if its not very good I am still learning"

Nothing wrong with that thanks for taking the time.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 14th Jun 2017 12:06
does this look ok ?
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped

Attachments

Login to view attachments
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 14th Jun 2017 12:09
lol sorry I forgot to put the dish on
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped

Attachments

Login to view attachments
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 14th Jun 2017 12:42
Thumbs up from me .

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 14th Jun 2017 13:11 Edited at: 15th Jun 2017 17:36
thanks Dave

here is the complete turret, can someone do the whizz bang thingy with the LUA see if it works lol

if these are suitable I can rough them up a bit so they looked damaged

UPDATE - Turret Pack Updated Added damaged turret
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped

Attachments

Login to view attachments
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 14th Jun 2017 13:53 Edited at: 14th Jun 2017 14:45
I love Sci Fi Turrets/Vehicles so had to have a go at this this morning here's the new turret and dish mounted on Cosmic's APC. All files included .obj, .x, FPE and textures edit, adjust and use it as you wish just drop it straight into your entities folder hope its of some use. Cosmic's APC not included. Loving yours as well Graphix



Edit : now with a base all modular so lower guns are separate and should be able to be scripted to move again all files included for you to play about with resize etc

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Attachments

Login to view attachments
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 14th Jun 2017 14:46 Edited at: 14th Jun 2017 14:47
If its any help Cosmic Prophet has already made his Sci Fi pack freely available so anything used should be ok to distribute.
In fact a lot are already on " GameGuru files "
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 14th Jun 2017 16:19 Edited at: 14th Jun 2017 16:31
Aye thanks synchromesh just didn't want anyone to think it was mine ok last part for now the base at the bottom of the large turret and Cosmic Prophets APC in the pic I've changed the textures to match the turrets, Thanks to Cosmic for the model the front of the base looks cool with the sci fi model pack doors and was built with those in mind. Ive tested the turrets with my he turret script so Knowing Amen Moses he'll get the doing all sorts if he has a mind to pic shows a quick rattle together of using the turrets in different ways .
@ Amen Moses thanks for the scripts m8, what would be cool is enter able turrets maybe something using that rocket hud you made would be very cool = enter battlefield turrets and use them

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Attachments

Login to view attachments
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 14th Jun 2017 16:44 Edited at: 15th Jun 2017 17:38
very nice Honkeyboy I have created a little bunker for my guns I suppose a little less futuristic
UPDATE - added metal bunker to pack
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped

Attachments

Login to view attachments
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 14th Jun 2017 16:47
Looks good to me Graphix your texturing looks far neater btw
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 14th Jun 2017 16:52
thank you I'm not happy with the dish working on better textures atm
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped

Login to post a reply

Server time is: 2024-04-16 22:33:39
Your offset time is: 2024-04-16 22:33:39