Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / FPSC Weapons Holster System

Author
Message
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 16th Jul 2008 03:36 Edited at: 16th Jul 2008 17:23
Well, this system enables the player to only have six weapons at a time, one of each type.

1 melee
2 pistol
3 smg or machine gun
4 sniper
5 shotgun
6 explosives

These can be edited. The best part about it, is that there are only two scripts to worry about, the HUD menu script as well as the gun's script.

How it works In Game:

You can pick up up to 1 of each type of weapon. If you already have a pistol, you cannot pickup another one. By pressing "H", you open the Gun Menu. The HUD serves no function but to tell you wnat number drops what. Be prssing the slot number of your current weapon, you drop it and are able to pick up another weapon.

I origionaly had set up where each gun would have it's own script that when the gun menu was accessed, the gun's hud would pop up as sort of a graphical interface, similar to the gun images in Half life 2. However, I have problems with making seven HUDS appear at once. The engine does not allow two seperate scripts to show huds at the same time, or for that matter, seven. So I had to ditch the graphical way and use a simpler, much easier to set up, neumerical way.

To set up:

Place the guns in your level. Make them always active, and give one of these scripts:

Slot 1



Slot 2



Slot 3



Slot 4



Slot 5



Slot 6



Guns that should be in the same slot should have the same script.

Then, give a dynamic light this script:



That's it. I am sorry that this could not be more. Thiswas really cool, with one weapon, but as I added more, the engine started to fail me.

Anyhow, as you can se, you will need a Menu Hud as stated in the above script. I have attatched the one that I used.

Here is a link to a playable demo of the system in action.
http://files.filefront.com/Gun+Demozip/;11080026;/fileinfo.html

Known issues:

1. you have to exit the menu before you can pickup another gun or drop a gun if you picked it up, dropped it, and picked it up again.

2. you get more ammo thatn you did before. - soluton; set the ammo to 0.

As you can see, you can add more slots, take some out, ect. Feel free to edit the HUD. I just wish that this could be more. If anyone has ideas, please coment.

Attachments

Login to view attachments
Trugar
16
Years of Service
User Offline
Joined: 8th Jun 2008
Location: New York
Posted: 16th Jul 2008 03:45
good job this is nice.
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 16th Jul 2008 17:23
Hmm... Thought this would be more popular.

Roger Wilco
19
Years of Service
User Offline
Joined: 6th Jul 2005
Location: In the Shadow of Chernobyl
Posted: 16th Jul 2008 17:32
Downloading the demo now, too lazy to test it out myself.
The script sounds really nice and useful, will leave feedback when I've run the demo level.

Check out the Gunn3r Games web-site and its growing community, and expand the joy of indie development!
http://www.gunn3rgames.net/
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 17th Jul 2008 02:27
sounds nice but i only have 4 or 5 guns in a level anyway so this really wouldn't work for me other than to prevent people from having two different metal bats.

I know not what WWIII will be fought but I do know that WWIV will be fought with sticks and stones-Albert Einstein
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 17th Jul 2008 04:22
Ok, then this can be edited to that the player can only carry three weapons at a time. Slightly more realistic than being able to carry a minigun and a rocket launcher.

Goodman84
17
Years of Service
User Offline
Joined: 23rd May 2007
Location:
Posted: 17th Jul 2008 06:51
It would be nice if you made a video or somthing because i'm on my mac right now so I cant test it.

hey
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 17th Jul 2008 17:35 Edited at: 17th Jul 2008 17:39
Here

SDIT: it won't let me post this. I will put it on filefront later.

Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 17th Jul 2008 21:16
...very nice addition.

Thanks for sharing this...


Goodman84
17
Years of Service
User Offline
Joined: 23rd May 2007
Location:
Posted: 18th Jul 2008 00:22
www.letsvidz.com Post your video their if you want, its my beta site.

hey
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 18th Jul 2008 00:40 Edited at: 18th Jul 2008 00:49
Posting right now

Here iit is: http://www.letsvidz.com/play.php?vid=152

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Jul 2008 01:07
Very cool. Nice way to handle dropping weapons.

Unfortunately, if you go with this system, you can't let the player pick up any weapons dropped by the enemy, because they wouldn't be able to drop those.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 18th Jul 2008 02:33
Oh, you are right, but stil, I am working out the bugs.

Ply, do you know how one button can activate two seperate scripts(or more) to show two huds at the same time, I cannot.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Jul 2008 07:03
To just show two HUDs at the same time, you can use a single script.




To activate two scripts at once, the two entities holding those scripts would need to either have the same name (To be used with "IfUsed") or you'd have to hard-code the entity names into the script (To be used with "settargetname" and "activatetarget")




The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 19th Jul 2008 00:23
No, the weapons have two seperate scripts. When H is pressed, I need two huds to show up at the same instant, but only one shows, then when the other fades, the next one appears? Weird. I think I have a solution that I would like to try first, using more variables.

Roger Wilco
19
Years of Service
User Offline
Joined: 6th Jul 2005
Location: In the Shadow of Chernobyl
Posted: 19th Jul 2008 00:45
Tried the demo level out. It was a bit buggy at first, but when the weapons finally dropped, it worked very well. A nifty script indeed.

Check out the Gunn3r Games web-site and its growing community, and expand the joy of indie development!
http://www.gunn3rgames.net/
Goodman84
17
Years of Service
User Offline
Joined: 23rd May 2007
Location:
Posted: 19th Jul 2008 07:16
sweet looks great AND I have to give you a MAJOR THANKS for using letsvidz.com lol. THANK YOU!

hey
MadChicken Games
16
Years of Service
User Offline
Joined: 27th Jun 2008
Location:
Posted: 20th Jul 2008 15:09
What would make this good if the hud looked better and instead of saying melle,smg,sniper ect.
But if it said the name of the weapon knife,mini uzi,MP50 ect.

very good excellent
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 20th Jul 2008 18:03
I have already stated that in order to change it, you need to use multiple huds and it is imposible to have that when having multiple scripts trugger them. Also, I did not put a lot of work into the HUD, it was just a demonstration.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 20th Jul 2008 22:17
@Hybrid:

Well, can't you assign a value to each type of weapon type? (That sounds a lil confusing, lol) Like, "Mini Uzi" would be a type of the "SMG" weapon type.

Here's some code for you to ponder over:



Of course, you'd also have to hide the ones NOT being used, but I hope you get the route I'm trying to show here.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 20th Jul 2008 23:29 Edited at: 20th Jul 2008 23:30
That is the route that I am currently on. However, to get them to all dissapear at them same time, and then reapperar.

You see, Each gun needs something loke this in the main script.



Now do the above fifty times.

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 21st Jul 2008 20:19
Nice Scripting Hybrid. Hope you get those bugs fixed. I would help you its just. I completly SUCK when it comes to huds

Login to post a reply

Server time is: 2024-11-24 10:51:50
Your offset time is: 2024-11-24 10:51:50