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

weaponlevel2 problems

Recommended Posts

I am trying to make a fist that changes to force lightning when you use an inventory item that among other things, gives you the power weaponlevel2. it works if you switch to the fist and then press use, but if you switch to something else and switch back, or use it and then switch, it just uses the normal fist. what's up with that?

Share this post


Link to post

There's not much we can do to isolate the problem without seeing your actual weapon code. Put it up on pastebin or somewhere -- it'll help.

Share this post


Link to post

ACTOR Fist : Weapon
{
Game Doom
Weapon.SelectionOrder 3800

+WIMPY_WEAPON
+MELEEWEAPON
Weapon.sisterweapon "forcelightning"


States
{
Ready:
PUNG A 1 A_WeaponReady
loop
Deselect:
PUNG A 1 A_Lower
loop
Select:
PUNG A 1 A_Raise
loop
Fire:
PUNG B 4
PUNG C 4 A_Punch
PUNG D 5
PUNG C 4
PUNG B 5 A_ReFire
goto Ready
}
}


ACTOR forcelightning : Fist
{
Game Doom
Weapon.sisterweapon "Fist"
+WEAPON.POWERED_UP
states
{

Fire:
LTNG ABCD 3
Hold:
LTNG EF 2
LTNG F 0 A_FireCustomMissile("lightning",0,false,-2,0,0)

Goto Ready

}
}

Share this post


Link to post

There actually isn't anything wrong with that particular piece of DECORATE, I just tested that exactly as you posted it, and it work's fine. The problem could be in the powerup, not the weapon. You should post that, and if it runs any scripts, post them too.

Share this post


Link to post

By the way, you don't need to put "game doom" on them since they have neither editor numbers nor spawnid.

Share this post


Link to post

Try calling it something other than "Fist", because that's what the Doom weapon is called. It's possible that there may be some kind of conflict, and I'm certain that you're seeing a "Tried to register 'Fist' more than once" warning when you're starting up the game.

Share this post


Link to post

actor PowerQuartDamage : PowerProtection
{
damagefactor"normal",0.25
Powerup.duration 5000
}

actor DoubleDamage : PowerDamage
{
damagefactor "normal",2
Powerup.color "ff 00 00",.4
Powerup.duration 5000
}

actor superspeed:PowerSpeed
{
Powerup.duration 5000
Speed 2.2

}

actor longhighjump:PowerHighJump
{
Powerup.duration 5000
}

actor DARKFORCE:CustomInventory replaces Berserk
{
-AUTOACTIVATE
+INVENTORY.INVBAR
+INVENTORY.ALWAYSPICKUP

states
{
Spawn:
PSTR ABCD 6 bright
Goto Spawn
Use:
TNT1 A 0 A_GiveInventory("PowerQuartDamage")
TNT1 A 0 A_GiveInventory("longhighjump")
TNT1 A 0 A_GiveInventory("DoubleDamage")
TNT1 A 0 A_GiveInventory("superspeed")
TNT1 A 0 A_GiveInventory("superweapon")
}
}

actor superweapon:POwerWeaponLevel2
{
Powerup.Duration 5000
}

How should i make sure the player gets the modified fist, though? i've tried a custom player class and keyconf, but it failed epicly.

Share this post


Link to post

Your powerups should be derived from the class "PowerupGiver" and not the power up type. For example:

actor superweapon:PowerupGiver
{
+AUTOACTIVATE
Powerup.Type WeaponLevel2
Powerup.Duration 5000
}

That should be what the "superweapon" class looks like. You should probably fix your other powerups to be like this, too. I'm not sure if it really matters, since apparently the rest work, but you never know. The ZDoom wiki should have all the information you need to do it.

Share this post


Link to post
Akira_98 said:

Your powerups should be derived from the class "PowerupGiver" and not the power up type. For example:

No, what he posted should work -- it's perfectly acceptable to give powerups through a custom inventory or a script rather than through a powerup giver. See the Berserk item for an example.


@deepthought: post your keyconf and custom class.

Share this post


Link to post

I don't understand then. I tested it both ways, and inheriting from PowerupGiver rather than the powerup type itself made it work, where as the other way just breaks it as he says it does.

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
×