Scripts / Gun turrets anyone?

Author
Message
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 21st Jul 2017 09:44
@PCSKILLER - thank you for looking and your comments, I'm afraid my scripting skills are very limited but as Amenmoses said look at his Helicopter script

@F l a t l a n d e r - I have attached a quick video on how to setup the turrets with a stock Decal (you can use any decal) I have not added any gunfire sound or any sfx that part is pretty standard for any entity
hope this clears any confusion and helps

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: 21st Jul 2017 10:29
In the gun_shot_init there is a line to scale the decal, if the shots look to big or too small change it till you get the look right.

Also you don't need to locate the parts, you can just dump them on the map and they will be located at run time, the only part that needs to be positioned is the part you attach the main turret_base script to.

Also make sure all the entities are 'always active', the bullet decals are shared amongst all turrets so if you have lots of them you will need to add more decals, I add at least 4 decals per turret.

See attached pic from the level editor and the video to see what I mean:

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: 21st Jul 2017 10:34
Quote: "See attached pic from the level editor and the video to see what I mean:"


LOL the proper way to do it thanks Amenmoses
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: 21st Jul 2017 10:52 Edited at: 21st Jul 2017 10:56
Assuming the nasty aliens are script driven simply create a list in the aliens script and store something in it, e.g.

g_nasty_aliens[e] = 'shoot me'


In the turret_base_dual script to target other entities change this line in 'main':

local PX, PY, PZ = g_PlayerPosX, g_PlayerPosY, g_PlayerPosZ

something like this:


In addition you will probably need to change the detectRange variable at the top of the script.

In the gun_shot script you will need to replace the part that hurts the player with code to hurt the alien instead.

That's about the simplest way of doing it but to make it really good you should find the nearest nasty alien to shoot at and if they are moving at a reasonable speed you need to target ahead of them, I'll leave that bit to the reader to figure out, hopefully you'll do a better job than the engineers of the Bismark.
Been there, done that, got all the T-Shirts!
PM
Flatlander
GameGuru Master
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 21st Jul 2017 21:09 Edited at: 21st Jul 2017 21:21
Thank you so very much GraPhiX and OmaineMoshe ( AmenMoses ). This community is blessed having a person such as AM who is quite the mathematician. I had only went as far as advanced algebra, trigonometry, and something called 'Finite Math'. That last one I could never figure out; why was it named that since, for me, math was never finite. . Also Trig was not a favorite of mine with all those sines, cosines and tangents. I dreamed of right-angled triangles through that whole semester. So, I absolutely appreciate someone who can do all that math to find the positions of three dimensional space. All I want is to remember the x, y, z axes.

I will put up a video of how I will be using the gun turret. It will not be a complete part of the level, however. I have attached five images of that part of the map. The first image is the gun turret and its decals. I noticed that it will use all of them and of course randomly. So, I have different colors being shot just for the fun of it. I probably will use just one of them in the final version. The second image is a damage turret with bunker and its location to the working one. You will see an RPG and rockets inside the bunker of the damaged turret. GraPhix maybe a damaged bunker could be added? Just thinking. The fourth image shows that this is part of a terraforming site and the fifth image shows a bird's eye view of the site. It's not finished yet and I might re-arrange the models and add some more. I just plopped the models down randomly. Images are from left to right.

AmenMoses wrote: "Also you don't need to locate the parts, you can just dump them on the map and they will be located at run time, the only part that needs to be positioned is the part you attach the main turret_base script to."


I tried that but I didn't get the result I was expecting. I have my thoughts of what I might have done wrong and will play around with that some more. The models and scripts definitely should be a special extra from TGC for all those who have GG.
When in doubt -- C4 :heh, heh, heh:

-Jamie Hyneman

Attachments

Login to view attachments
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 21st Jul 2017 21:42
@-F l a t l a n d e r - thank you for the kind words
yes I will do a damaged bunker for you no problem is there a specific design or size you would like ? or just the same one damaged
Welcome to the real world!
Windows 10 Pro x64 - Core i7-2600K @3.40GHz - 32.0GB RAM - GeForce GTX 950 2GB - 4x500GB SSD Striped
Flatlander
GameGuru Master
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 22nd Jul 2017 00:32
Just the same one damaged. It would go good with the rest as a 'pack'. I think I forgot to say that the demo video was extremely helpful. Thanks for that.
When in doubt -- C4 :heh, heh, heh:

-Jamie Hyneman
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 25th Jul 2017 14:24
@ F l a t l a n d e r - Damaged Bunker now in pack, you can download it from this thread https://forum.game-guru.com/thread/217932

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

Login to post a reply

Server time is: 2024-03-28 09:53:45
Your offset time is: 2024-03-28 09:53:45