PDA

View Full Version : A question from a Newbie: Weapon Fire



legacy-Macster_beta
08-18-2004, 04:37 PM
I have been slowly working my way through the Unreal Script tutorials and, after successfully completely the Concussion Rifle, I wanted to try something on my own. Naturally a ridiculously overpowerd weapon was on my mind:

THE MINI-GUN/ROCKETLAUNCHER!!

Combining the best of both worlds, the mini-gun/rocketlauncher has the primary fire of the mini-gun and the secondary fire as a rocket launcher. It was totally kickass.

I was on my merry way scripting, laughing, and skipping in a happy place existing only in my head. Until I came to part where I was to actually script what the weapons fired.

My world collapsed.

See, I needed to extend the minigun fire, but I didn't know what it was called. In the concussion rifle I extended the ShockRifle and for the weapon fire the ShockRifle was ShockBeamFire.

So I listened intently to what Logan had to say on the most troubling matter and he said that I was supposed to go under Actors to weaponFire.

Where do I find that? It's not in the unreal ed actors. I need to find out where the weapon fire names are.

Thank you for your help.

-- M.A.C. "Macster" Vogt

legacy-aardvarkk
08-18-2004, 04:49 PM
i've never dealt with weapons, but i sure do like your post! if nobody answers, then i'll do some research myself just because your post deserves it. good luck!

legacy-the Adster
08-18-2004, 05:19 PM
Macster_beta: check this thread out: weapon stuff (http://www.ataricommunity.com/forums/showthread.php?s=&threadid=398642) , it should tell you most of what you want to know.  I also have the code for the DestroyerX project if you want it.

legacy-Macster_beta
08-18-2004, 05:50 PM
I understand about how to extend bioglob and shockbeam, but how would one find out that the projectile for the BioRifle was, in fact, the bioglob? Is there some list hidden away in my computer?

My problem is I want to extend the mini-guns primary fire, but where can I find the name for this?

Sorry if all this sounds confusing :bulb:

legacy-the Adster
08-18-2004, 06:20 PM
I thought that thread would have given you a good place to start, it should have done, but I'll show you how to find out the information anyway.

The MiniGun lives in xWeapons\Classes, in its defaultproperties you'll find this code:
FireModeClass(0)=MinigunFire
FireModeClass(1)=MinigunAltFire

These two lines define what happens when the player fires the weapon (either primary or secondary fire).  MinigunFire also lives in xWeapons\Classes, and by opening it with WordPad you'll find that it extends InstantFire.  Surprise, surprise; InstantFire can be found in xWeapons\Classes too.

As a start to UScripting you should have d/loaded the official Epic source code, which is available for the current patch of 3270.  Just by looking at what's contained in the UC files you'll see how the original game was constructed, it may be confusing at first, but that's all part of the learning-curve.

To get the new weapon to fire rockets in the secondary fire-mode simply change its FireModeClass(1) to RocketFire, you may have to do some extra coding to get the results you want but in a nut-shell that's all it's going to take.

Hope that helps.

legacy-Macster_beta
08-18-2004, 08:10 PM
Ahhahh! Thank you!

BTW, I did read over the thread and I thought it missed my question. I kept on trying to find the xWeapons inside Unreal ed in the actors browser... where I couldn't find it. However, I dled the sourse code, and BAM! There it lay, xWeapons.

Thanks again for outlining the answer in detail so I could understand.

legacy--GSF-JohnDoe
08-18-2004, 08:59 PM
if you dont have it already, download the an editor such as the UDE or WOTGreal (do a google for em). this has syntax highlighting, class browsing, and much much more!

legacy-the Adster
08-19-2004, 03:35 AM
Originally posted by the Adster
Define your own weapon class (extend any existing weapon, like the Link Gun for example), in the defaultproperties of it define the FireModeClass(0) as a custom one (we'll extend this from an existing one in a moment).  So far you should have been able to follow that (I hope so, as I've just got back from the gym so might be a little confusing).

Extend one of the weapon fire classes (like BioFire for example).  At this point you should have a custom Link Gun that fires Bio Blobs, you can stop reading now if that's all you want to do.


Originally posted by the Adster
I wasn't going to explain this project in any great detail as the code should speak for itself, but since you've asked I'll do it:

No, you define the weapon's FireModeClasses in the main class (Destroyer.uc), this allows you to set how the weapon acts when you press the relevant fire button on the mouse (or keyboard/joystick/whatever).  This is how you get single or multiple projectiles to fire (check the original FireModeClasses to see how Epic did it).

You define what projectiles are used in the FireModeClasses themselves (DestroyerFire.uc and DestroyerAltFire.uc), as these are called when the weapon is actually used.  It's a little confusing because each FireModeClass actually calls a function in the weapon (either SpawnProjectile, or SpawnAltProjectile) which really does the creation of the projectile, even though the ProjectileClass isn't defined in the weapon (it took me a while to get my head round this, even though I've been programming/scripting for years now).


Originally posted by Macster_beta
BTW, I did read over the thread and I thought it missed my question. I kept on trying to find the xWeapons inside Unreal ed in the actors browser... where I couldn't find it. However, I dled the sourse code, and BAM! There it lay, xWeapons.

No, it completly hit the point of your question, as it detailed how to modify a weapon so you could redefine what projectiles it fires (by dint, it also gave you hints on how to trace which classes were used).  I pointed you to that other thread as it outlined so much more about modifying weapons, which will probably come in handy later on.  I didn't want to 'spoon feed' you the answers as you would not have learned anything from this, as in the old McDonalds training adage: I hear, I forget.  I see, I remember.  I do, I understand.

Before you ask; I did used to work for McDonalds (many years ago now), and was actually heavily involved in training people, both on-the-job and in classroom situations.

legacy-Macster_beta
08-19-2004, 09:22 AM
sorry :(

The one question I asked, however, did more than hear and forget... d/ling the source code has done wonders; I didn't know that I needed to download it and in the end it's helped me a lot.

As for the hints you dropped, I had no idea it was referenced to the source, and I thought I already knew how to code the alternate fire. Turns out I was wrong: seems as though the rocket launcher needs rockets, something which the mini-gun doesn't pick up without extra coding, something I am definitely not up too.

See, I thought this little experiment would be a walk in the park, a piece of cake, and like taking candy from a baby. Although I didn't get my end product, I do appreciate the help, and in end, I did learn a lot.

*Clicks on the next VTM and watches patiently*

legacy-the Adster
08-19-2004, 10:17 AM
Don't give up fella, as Martin Brundle says: 'Percy Verence may not be a fast driver, but he gets to the end of the race'.

Without looking at any code I'd say you'd have to do the following:
Extend both MinigunAmmo and RocketAmmo, tell them to add their ammo to your weapon
Replace both these ammo types in-game
Extend the weapon fire modes you want to use and assign them to your weapon
Replace Miniguns in-game with your version


All this can be done by following the code for DestroyerX, which I can mail to you if you want.

Remember, the only thing you gain from giving up is more time on your hands.