Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
D2Jk

Railgun ammo usage

Recommended Posts

Hi all,

I'm trying to add a secondary fire to railgun, which consumes less ammo but doesn't pierce. The problem is, I can't get the alt-fire to actually consume ammo, for some reason. Here's the code I'm using:

ACTOR Railgunx : Weapon 1234
{
Weapon.AmmoType1 "Cell"
Weapon.AmmoUse 10
Weapon.SlotNumber 9
States
{
Ready:
RAIL A 8 A_WeaponReady
Loop
Deselect:
RAIL A 0 A_Lower
Loop
Select:
RAIL A 0 A_Raise
Loop

Fire:
RAIL A 0 A_Light2
RAIL B 3 Bright A_RailAttack(225,0,1,NONE,"EE EE EE",8)
RAIL CD 3 Bright A_Light1
RAIL E 3 A_Light0
RAIL F 10
RAIL F 0 A_CheckReload
RAIL F 50 A_PlaySound("weapons/railcharge")
RAIL F 0 A_Refire
goto Ready

AltFire:
RAIL A 0 A_Light2
RAIL B 3 Bright A_RailAttack(225,0,1,NONE,"00 00 FF",10)
RAIL B 0 A_PlaySound("weapons/railcharge")
RAIL CD 3 Bright A_Light1
RAIL E 3 A_Light0
RAIL F 0 A_CheckReload
RAIL F 40 
RAIL F 0 A_Refire
goto Ready
}}
As you can see, the "use ammo" boolean is properly set to "1". Why doesn't it work?

Another thing I'm wondering is that I don't see a setting which controls the ammo usage of the secondary fire. Would it be possible to work around this by making the weapon consume "1" ammo, and then making it shoot several weak beams simultaneously? The player shouldn't actually see multiple beams in that case, just a single one, but increased number of particles would be ok.

Share this post


Link to post

Thank you, that did it. :)


I was aware of those weapon properties, but I was assuming they were meant only for weapons using multiple ammo types.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×