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 Models and Media / Importing a weapon into FPSC (tutorial)

Author
Message
Opposing force
18
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 24th Aug 2006 17:23 Edited at: 24th Aug 2006 17:26
I have received a number of requests for a weapon importing tutorial and no one has written one yet. so I decided to write one now. I will be discussing every aspect of importing a weapon and will try to make it easy to understand. So first things first, lets get familiar with the things that a weapon needs...

1)a gunspec file
this is just a text document that explains how the gun operates. I will go into more detail later on in this tutorial. When I import my own weapons into FPSC I just copy a "gunspec.txt" over into the new gun folder and change the attributes to how I want my gun to work.

2.the gun models (obviously)
This is the visual representation of your gun, heck you don't need one but most FPSC games have them. There's two of these. The "HUD.X" file and the "VWEAP.X" file. The HUD is the players gun model and the VWEAP is the enemies gun model, usually low-poly. The model must be in ".X" file format. If your modelling package can't export ".X" get a decent convertor. I use Caligari Gamespace because that can export X format. Your model needs to be rotated the right way on your modelling program. If you test it in FPSC and it's facing the wrong direction go back to your modeller and rotate it again untill it looks right. To get the "VWEAP.X" looking right on the enemy you will have to tweak it, try opening up one of the FPSC guns and use that as a reference or just go through trial and error like me. Guns in FPSC don't have to be animated but they look a lot better if they are. I don't like building a skeleton inside my gun models so I just keyframe the model and move it around to give it some basic animation. You may also want to include two bones inside your model. The FIRESPOT bone which positions the guns muzzleflash (place your bone on the muzzle of the gun) and the BRASS bone which should be positioned near your guns exractor (the bit that the shell casings fly out of when you shoot your gun. Of course you don't need all this a simple gun model will do just fine.

3)a texture
A texture makes the gun look a lot better. You will need to UVWRAP your texture in your modelling package before you export. I use JPEGs most of the time but most people use .DDS. I recommend you use .DDS and save the texture as "gun_D2.dds" If you look in the FPSC stock gun folders there are a lot more textures (gun_d, gun_n, gun_s etc) don't worry about these. The basic texture is just the "gun_d2" because the VWEAP uses it by default and the entity pickup can use it.

4)sounds
These are the shooting, reload and dryfire noises that the gun makes in FPSC. They have to be in WAV format (PCM 22.050 khz, 16 bit mono) the sounds play depending on the "sound frames list" in your gunspec file. So for example, if you have fire animation with frames "32,45" then you will match those up with your gun sounds. I personally, don't bother with changing the sound frames I just use the Gunspec as a template for all my gun models.

5) the crosshair and hud_icon
The hud_icon is the image of your gun in the top right hand corner of the screen. Again, you don't need one for the gun to work but most people use them. Use .DDS as the format and you can make them in paint shop pro, the gimp or Photoshop. The gun image must be on a black background and it needs to have an Alpha channel (the gun image in white so FPSC knows which bits to edit out) The crosshair is the same.

6) entity pickup and ammo pickups
This is like the VWEAP. It should be lower poly then the HUD file. The texture path must point to the gun texture in your gun folder. Use the free entity creator that you can download of the FPSC website. Its free and you can make gun pickups. Ammo pickups are the similiar to the weapon pickup. They just give the player more ammunition for a gun. You must also make the path clear in the FPE file. You can do this in the free entity creator.

So thats about it for what a good weapon needs. I will finish the rest of the tutorial off later, going into a bigger depth with the gunspec file. Keep watching this thread

Opposing Force.

visit http://teammegabasic.proboards59.com. Register and expand our community. Registration is free and only takes a minute.
Zilla
18
Years of Service
User Offline
Joined: 28th Nov 2005
Location: Swiss KGB
Posted: 24th Aug 2006 18:01 Edited at: 24th Aug 2006 18:14
Thank you very much
You're the Best!
MT Inc
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location: If I\'ll tell ya, I\'ll have to kill ya
Posted: 24th Aug 2006 19:29
great tutorial thanks for the contribution. good job Opposing force.
cheers,

M.T.I
FredP
Retired Moderator
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 24th Aug 2006 19:49
I am going to sticky this as it is a question that comes up a lot.
Later on after it has been up for a few days and whoever does the Tutorial city thing puts it in there then one of the mods can unsticky it or something like that.
A very informative tutorial.
A question I have is that is there a difference between a joint and a bone?
I have tried to do the FIRESPOT and SMOKE but haven't had any success yet.

Opposing force
18
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 24th Aug 2006 20:12 Edited at: 24th Aug 2006 20:17
Hey, thanks Fred, this is my first sticky About the bones FIRESPOT and SMOKE so far I have successfully made a FIRESPOT bone in my weapon models. I just add a bone anywhere in the model and attach that object to the bone. In the GUNSPEC file I just change the muzzle flash position and keep testing it ingame untill it looks right. About the bones and joints. Gamespace states in the contents the following...

Bone - The most basic part of a skeleton, bones control the deformation of surrounding skin.

Joint - Joints connect bones together and control how they move in relation to each other

when I make a new weapon for FPSC I always use the same code in the X file. You know when you open it in notepad you see the obects code well at the end of the code I just dump my FIRESPOT bone there. It's a bit messy but it works, I find that method easier then adding bones in my modelling package.

visit http://teammegabasic.proboards59.com. Register and expand our community. Registration is free and only takes a minute.
FredP
Retired Moderator
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 24th Aug 2006 21:18
Thanks for the info.

Opposing force
18
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 25th Aug 2006 18:04
Part 2: The gunspec in more detail.

Ok, so now you should be familiar with what an FPSC weapons should have. The next part if the tutorial will cover the "Gunspec.txt" file. This is important, it controls everything about your gun, the animation frames to the damage it gives out, so if you want to import your own gun then you should definitely read this.

Ok, so from the top, I will go through all the variables and how they effect the behaviour of your weapon.


first one

;GUN Settings

Muzzleflash:
There are seven muzzle flashes that come with FPSC. They are all in a folder 1 to 7. If you create your own muzzle flash they must be in .DDS format and be included in the muzzeflash directory. The muzzle flash is positioned on an object by a bone called "FIRESPOT" that you should include at the end of the barrel when you come to model your gun. The "FIRESPOT" bone also makes the yellow light appear around the gun when you fire.

muzzlesize:
This is simple. It just tells FPSC how big to make your muzzleflash. Standard size is around 35 but any size will work as long as it is sensible.

brass:
Like the muzzleflash brass relies on a bone called "BRASS". In real life the cartridge contains the powder and the projectile, so when you shoot a gun (if it's semi/fully automatic) after the bullet is fired the "empty" shell casing will be extracted. Again, you don't need to have brass but shell casings flying out of a gun makes it fun to shoot. FPSC contains shell casing models for a pistol, rifle and shotgun (1, 2, 3)

smoke:
If your gun will have smoke then give it a 1 for yes. I think smoke needs a bone "SMOKE" in the gun model but I'm not sure.

second: (MORE INFO COMING SOON)

Damage:
this is how much damage the gun will dish out after each shot. An objects strength or an enemy's health will be subtracted by the damage that a certain gun gives out. Adjust to suit your type of weapon (pistol=low damage, shotgun+high damage)

Damagetype:
What type of damage does this weapon cause? Say shotgun will force the enemy to fall down if shot once, before he gets back up, well this is how you define that.

scorchtype: (MORE INFO COMING SOON)

reloadqty:
self-explanatory. This is how many rounds the gun will fire untill you have to reload, i.e how many rounds the magazine contains. 0 will give the gun unlimited ammunition.

iterate:
This tells the gun how many "bullets" to fire per shot. A shotgun for example in real life would shoot a lot of tiny pellets as opposed to a single 5.56 mm bullet.

accuracy:
This sets the default accuracy of the gun. Most of the gunspec values can be changed within FPSC by right clicking the gun pickup entity. 0 means deadly accurate (sniper rifle perhaps) and the higher the value the less accurate it becomes (shotgun)

zoommode:
certain weapons will have a scope like a sniper rifle for instance. just give this a value of 1 and it will use the "scope1.dds" file as a scope image when you right click, mid-game.

range:
If you ever wanted to have a melee weapon for FPSC then this is the closest you will get. If you set the range as 50 then the weapon will behave similiar to a melee weapon. As always, the higher the value the further (farther?) the projectile will be able to go.


I'm feeling like a lazy sod at the moment so I'll do the rest later.

visit http://teammegabasic.proboards59.com. Register and expand our community. Registration is free and only takes a minute.
MT Inc
18
Years of Service
User Offline
Joined: 29th Apr 2006
Location: If I\'ll tell ya, I\'ll have to kill ya
Posted: 25th Aug 2006 18:24
good job Opposing force. i sended you an email so can you please chck it out and reply through the email thanks, great job again.

cheers,

M.T.I
Screwed Over
17
Years of Service
User Offline
Joined: 9th Jul 2006
Location: nowhere and everywhere
Posted: 26th Aug 2006 02:49 Edited at: 8th Sep 2006 20:20
yay, thnks opposing ive been looking for a weapons importing/making tut for ages!!!


The Day will come when humanity ends.
from gspace to FPSC
17
Years of Service
User Offline
Joined: 21st Jun 2006
Location:
Posted: 3rd Sep 2006 06:09
THank you very much Opposing force!!!

Great help!!!

What about a character(made in GSPACE) for the next?

Daniel
Opposing force
18
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 3rd Sep 2006 13:16
Thanks "from gspace to FPSC". I have't made a character for FPSC using Gamespace yet. I don't think there is an FPSC skeleton that is compatible with Gamespace.

visit http://teammegabasic.proboards59.com.
Talk about anyhting (gaming, game making, general chat)
Predator boy
17
Years of Service
User Offline
Joined: 14th May 2006
Location: Up your butt and around the corner
Posted: 3rd Sep 2006 15:16
um were do you getb the gamespace thing?

"I'm a lean mean speed thingy!" "What about my womanly needs?" "Send the kids to the neighbors cuz i'm coming back loaded!"
Errant AI
17
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 3rd Sep 2006 23:15
Thanks for this. It's been very helpful!

Is there a way to manually position and scale SMOKE or BRASS like can be done with FIRESPOT?
SUICID3
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location: UK,England. where else.
Posted: 4th Sep 2006 14:44 Edited at: 4th Sep 2006 14:45
You can get gamespace from caligari.com.
Good job opposing force this is quite a helpfull tut.
In the next part if possible could you explain how to animate a weapon.
But anyway you have a good tutorial there thanks.
Opposing force
18
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 4th Sep 2006 15:04
Thanks for the comments, I will elaborate the tutorial in the future. I'm quite busy right now with a few things.

@Errant AI: There doesn't seem to be a way to scale SMOKE and BRASS. That's quite annoying because it means trial and error and that can take a long time. Also, I think SMOKE and BRASS is the same thing meaning where ever the BRASS is positioned the SMOKE will be there as well.

visit http://teammegabasic.proboards59.com.
Talk about anyhting (gaming, game making, general chat)
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 5th Sep 2006 05:43
You can use custom smoke and custom brass by creating a new decal folder with the name smoke# where # is a number. you type that number in the smoke field of the gunspec.

Fpsc scales the smoke from small to big as it leaves the gun, so no, you cannot resize it. also your right opposing force. If you create a brass bone, smoke will appear there, even if you turn smoke off!

Damagetype:
Just to add, there is a field called weapon type, from which you choose how the enemy will hold the weapon. 1=pistol, 2=SMG 3=shotgun etc. The values for the damage type are the same as the values for the weapon type. So if you want to do shotgun style damage use the value 3.

iterate:
If you make your weapon iterate 3 shots, and set the damage to 30, bear in mind that the gun will do 90 damage on a direct hit, as opposed to 10 damage for each shot.

accuracy:
this kinda sucks, because this isn't really the accuracy of the weapon. E.g. when you fire a shotgun, it is deadly at close range because all the pellets are close together. As it goes further the spread out and become less accurate. In FPSC, shots don't become less accurate the further they go. try setting a weapon at accuracy=50 and shoot a wall at point blanc range, you'll notice the shots still (impossibly) hit all over the wall.

oh and just to add, you can also use samples in ogg format, (it's a bit smaller size than wav.)

Screwed Over
17
Years of Service
User Offline
Joined: 9th Jul 2006
Location: nowhere and everywhere
Posted: 7th Sep 2006 18:35 Edited at: 8th Sep 2006 20:20
one thing that bugs me is what animations we need and how do we apply them???


The Day will come when humanity ends.
Errant AI
17
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 8th Sep 2006 04:41 Edited at: 27th Sep 2006 17:29
@screwed over: The needed animations depend on what kind of weapon you're making. It helps if you start out by making a copy of a similar weapon that is allready in the game.

------

ex: (from commando gunspec)

;HUD animation frames list

keyframe ratio = 1

select = 0,9
Idle = 10,38
Move = 39,53
Start fire = 54,56
automatic fire = 57,64
end fire = 65,70
reload = 71,107
cock = 108,123
putaway = 124,133

------

select: Anim played when drawing out the weapon.

idle: Breathe/idle anim.

move: Anim played when walking/running.

start fire: The very beginning of the fire sequence. Muzzleflash is rendered and bullet leaves player position on the last frame.

automatic fire: Short, looping anim that plays when you hold down the fire button. Muzzleflash will render and a bullet wil be shot last frame, same as "start fire".

end fire: End of the firing sequence. Played after "start fire" or automatic fire". This is the recoil/ realign animation.

reload: Reload anim.

cock: Cocking/chambering animation that plays after "reload"

putaway: Holstering animation played when switching to another weapon.

There are more anim ranges than what I've listed, it's only an example.

BTW, All the keyframe ranges can be edited.

You can delete some of the anim refrences from the gunspec file if the weapon doesn't need it or you don't want it (ex: automatic fire and cock).

Some anim references are unique to different weapons allready in FPSC... I know you can safely delete them but I don't know if you can add ones used on other weapons (ex: discard).
Screwed Over
17
Years of Service
User Offline
Joined: 9th Jul 2006
Location: nowhere and everywhere
Posted: 8th Sep 2006 19:36
k thx, thats gonna help me loads.


The Day will come when humanity ends.
SunnyKatt
17
Years of Service
User Offline
Joined: 16th Sep 2006
Location: USA
Posted: 17th Sep 2006 02:58
Thank U sooo much this is a big help!

Rock on, everyone
FPSCn00b
17
Years of Service
User Offline
Joined: 17th Sep 2006
Location:
Posted: 17th Sep 2006 09:52
i think i got everything right that you've mentioned in the tutorial...the only prob i have is the animation..i tried making a melee weap and it doesn't show up on screen. i used gameSpace Light. I used the gunspec.txt from the guy who made 'pole' and the damage, effects etc work on screen...also, the .x file that was generated from gameSpace, i renamed it to HUD.x and VWEAP.x (copy and pasted the same file)
is there most likely something wrong with my animation? i made the path a big square/plane that went thru all 4 quadrants..
Errant AI
17
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 27th Sep 2006 17:37 Edited at: 27th Sep 2006 22:31
Any knowledge out there for using multiple textures on a HUD weapon the same way the stock "commando" does?

I'm using one multi-sub material and do not have a texture specified in the gunspec, yet only the _D/D2 map shows up.

Forum searching has turned up info only for entities and DBPro

edit: nevermind.
stormboy
18
Years of Service
User Offline
Joined: 8th May 2005
Location:
Posted: 28th Sep 2006 11:32
Very useful detail about the gunspec file and the bones
for correctly setting up a model.

I'd like specific info about the Keyframe ratio, is it about having padding frames or what?

Also, how many animation frames run a second?
Errant AI
17
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 28th Sep 2006 12:04
Keyframe ratio acts as a multiplier for the anims. If you set it to 2, the animations will play twice as fast. However, if you do that, you will need to alter the keyframe ranges accordingly or the states will be out of synch.

FPS is just that. At least in my experiences so far. The whole game actually seems to be framerate bound (vs. CPU tick bound). I've had bugs occur where the framerate went over 100 and the game was three times as fast. If you have a laggy level, the anims will play slow.

Someone correct me if I am wrong on that.
stormboy
18
Years of Service
User Offline
Joined: 8th May 2005
Location:
Posted: 28th Sep 2006 14:14
thanx for that info Errant AI
Saker
18
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Egypt
Posted: 30th Sep 2006 12:09
very good tutorial >>> it helps me alot
but I have problem in RPG weapon Because there are two Cases to walk >one appear with the ammo ,and anthor with out ammo
i hope u get it
Errant AI
17
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 2nd Oct 2006 22:14 Edited at: 3rd Oct 2006 19:14
Saker, as far as I know, FPSC is very limited on the states it can handle.

I would suggest messing around with the "discard" state. You might be able to put something together with that that seems logical to the player. "discard" triggers when the weapon is empty but I think it only plays once then stops on the last frame and freezes animation but I could be wrong because I haven't messed with it in creative ways. It won't give you an empty launcher to walk around with that moves around but it would help you to keep from displaying the launcher with an grenade in it when there is no ammo.

If you want, start another thread for RPGs and I'll be happy to help figure out something that looks decent because I too need to figure out a good way to show weapons where the projectile is visible when idle. IE: RPGs, WWII-style rifle launched grenades, crossbows, etc.

edit: discard is bad news for reloadable weapons. Demo vid and info on an RPG test I did here:

http://forum.thegamecreators.com/?m=forum_view&t=90303&b=24
Saker
18
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Egypt
Posted: 3rd Oct 2006 15:22
Quote: "Saker, as far as I know, FPSC is very limited on the states it can handle.

I would suggest messing around with the "discard" state. You might be able to put something together with that that seems logical to the player. "discard" triggers when the weapon is empty but I think it only plays once then stops on the last frame and freezes animation but I could be wrong because I haven't messed with it in creative ways. It won't give you an empty launcher to walk around with that moves around but it would help you to keep from displaying the launcher with an grenade in it when there is no ammo.

If you want, start another thread for RPGs and I'll be happy to help figure out something that looks decent because I too need to figure out a good way to show weapons where the projectile is visible when idle. IE: RPGs, WWII-style rifle launched grenades, crossbows, etc."

i was thinking on this way too>>but its not agood way....may be it will be the last Solution >> i will put another thread
Cut scenes
17
Years of Service
User Offline
Joined: 12th Jul 2006
Location: Never leave your back to a door...
Posted: 9th Oct 2006 15:30
Can you set the damage of the gun with a number like every shot will do 10 damage o an enemy or does it have to be like 1 for pistol 2 for smg ect. I want to set up a game where you will die from 10 shots from any weapon is that possible like each chaar has 100 health and each shot does 10 damage or is that just out of reach?

"People are easier to search when they're dead."--Captain Barbosa
Errant AI
17
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 9th Oct 2006 17:45
Cutscenes, read the posts. Have you ever even looked at a gunspec file?
Cut scenes
17
Years of Service
User Offline
Joined: 12th Jul 2006
Location: Never leave your back to a door...
Posted: 10th Oct 2006 03:32
Ok I'm sorry I read the post and it wasn't very clear, sorry. And I havent looked at a gunspec in a while because I a still learning to make guns and haven't had any finished projects to import.

"People are easier to search when they're dead."--Captain Barbosa
Cut scenes
17
Years of Service
User Offline
Joined: 12th Jul 2006
Location: Never leave your back to a door...
Posted: 15th Nov 2006 01:44 Edited at: 15th Nov 2006 01:46
Ok I finally have a gun good enough for an import, but it has multiple textures. WHAT DO I DO?? Also it does not appear on the enemy.

"People are easier to search when they're dead."--Captain Barbosa
Errant AI
17
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 15th Nov 2006 02:07
Cut scenes, I'm psyched that you're finally doing this!

You need a VWEAP model to get it to show up on enemies.

For multiple textures, leave the texture field in gunspec blank. You need to have one multi-sub material (or whatever they call it in Maya) and make sure your material IDs all match up.

What are you using to export? Does Panda work with Maya?

I found that in Max, exporting as .3ds then using DB converter did NOT work with multiple textures but Panda worked fine.
Cut scenes
17
Years of Service
User Offline
Joined: 12th Jul 2006
Location: Never leave your back to a door...
Posted: 15th Nov 2006 02:22
Im using the sdk exporter for maya. I do have a vweap, it still does not show up?? I will try to fix the gunspec, thanks.

"People are easier to search when they're dead."--Captain Barbosa
Shadow heart
17
Years of Service
User Offline
Joined: 2nd Dec 2006
Location: US
Posted: 3rd Dec 2006 04:26
ThanXs so much, especially with import of 3d objects and audio

Attachments

Login to view attachments
Black Bullet
17
Years of Service
User Offline
Joined: 6th Jan 2007
Location:
Posted: 1st Feb 2007 12:47 Edited at: 1st Feb 2007 16:06
Guys i'm having some real trouble i converted my gun to .x and all it comes up with is this

xof 0303txt 0032 Header {1;0;1;}

i copied another guns folder and just changed the things i needed , i dont get it the folder wont even show up in fpsc, some1 please help

Login to post a reply

Server time is: 2024-05-06 10:44:15
Your offset time is: 2024-05-06 10:44:15