deepthought Posted July 28, 2010 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? 0 Share this post Link to post
Xaser Posted July 28, 2010 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. 0 Share this post Link to post
deepthought Posted July 28, 2010 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 } } 0 Share this post Link to post
AkiraZXE Posted July 28, 2010 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. 0 Share this post Link to post
Gez Posted July 28, 2010 By the way, you don't need to put "game doom" on them since they have neither editor numbers nor spawnid. 0 Share this post Link to post
Ichor Posted July 28, 2010 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. 0 Share this post Link to post
deepthought Posted July 28, 2010 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. 0 Share this post Link to post
AkiraZXE Posted July 28, 2010 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. 0 Share this post Link to post
Gez Posted July 28, 2010 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. 0 Share this post Link to post
AkiraZXE Posted July 29, 2010 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. 0 Share this post Link to post
deepthought Posted July 29, 2010 YYYYYYYYYYEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSS!!!!!!!!! i put in that snippet of code and it worked! 0 Share this post Link to post