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

KEYCONF lump: Change weapon

Recommended Posts

What I write in KEYCONF lump, so I switch and start the game the gun number 1 Heretic "Staff" to the gun installed in the game? for example "Staff2".

I tried this way but does not start with "Staff2" weapon:

weaponsection MyNewWeapon1
setslot 1 "Staff"
addslotdefault Staff
setslot 1 "Staff2"

Share this post


Link to post

In case of starting weapons - the weapons which are already in player's inventory when starting a new game / pistol starting a level - it's required to use the custom player class method, Weapon.SlotNumber wouldn't be sufficient.

Share this post


Link to post

I GOT THAT WAY!
- I made the KEYCONF lump "call" a new actor:

clearplayerclasses
addplayerclass "CORVUSPlayer"

-And so I put the reference to the "actor" in my DECORATE lump:

ACTOR CORVUSPlayer : HereticPlayer replaces HereticPlayer
{
Health 100
Radius 16
Height 56
Mass 100
PainChance 255
Speed 1
Player.DisplayName "Corvus"
Player.StartItem "GoldWand"
Player.StartItem "Staff2"
Player.StartItem "GoldWandAmmo", 50

}

ACTOR Staff2 : staff replaces staff
{
Game Heretic
Weapon.SelectionOrder 3800
+THRUGHOST
+WIMPY_WEAPON
+MELEEWEAPON

States
{
Spawn:
STIK A -1
Stop
Ready:
STFF A 1 A_WeaponReady
Loop
Deselect:
STFF A 1 A_Lower
Loop
Select:
STFF A 1 A_Raise
Loop
Fire:
STFF A 0 A_Jump(128,"AltFire")
STFF B 2 A_PlayWeaponSound("weapons/wiff")
STFF C 2
STFF I 2 A_CustomPunch(4,0,0,"StaffPuff")
STFF J 3
STFF K 2 A_PlayWeaponSound("weapons/wiff")
STFF P 2 A_CustomPunch(4,0,0,"StaffPuff")
STFF QR 2
STFF S 2 A_ReFire
Goto Ready
AltFire:
STFF L 2 A_PlayWeaponSound("weapons/wiff")
STFF M 2
STFF N 2 A_CustomPunch(10,0,0,"StaffPuff")
STFF O 2
TNT1 A 4
STFF T 2
STFF T 0 A_ReFire
Goto Ready
}
}

From here ... I could not make the new "Powered StaffAtack". I did everything: added "sprites", added "decorate action" and etc...

But the only thing that stopped me was the "attack mode" which is called "A_StaffAtack" where GZDoom insisted NOT to turn the game.

So I gave up: I got the "weaponpowered" normal and 2 Substitutes new attack sprites (as the only attack of original sprites are 2: STFF H and STFF G). Then I settled!

Share this post


Link to post

I haven't understood what you were talking about in the last 3 paragraphs at all, but looking at the code, I see that "Staff2" doesn't have assigned a weapon slot either in its own DECORATE or in the player class's DECORATE.

Share this post


Link to post

The "GZDoom.exe" did not play the game because he does not know the parameters, "A_StaffAtack":

Ready:
STFF DEF 4 A_WeaponReady
Loop
Deselect:
STFF D 1 A_Lower
Loop
Select:
STFF D 1 A_Raise
Loop
Fire:
STFF G 6
STFF H 8 A_StaffAttack(random[StaffAttack](18, 81), "StaffPuff2")
STFF G 8 A_ReFire
Goto Ready
}
}

Then delete this script up and then the "GZDoom.exe" accepted to play but the downside is that I can not decorate the new script to use the gun powered but be conformed to the original already decrepted the wad.

I am satisfied, thank you!

Share this post


Link to post
Kassildes said:

A_StaffAttack(random[StaffAttack](18, 81), "StaffPuff2")

The "[StaffAttack]" after "random" has no place in there.

EDIT: Hmmm... Looks like it might be a valid expression after all (though, I admit, I don't get it), but I still don't think you need it there. Maybe, if you're not using the latest version of GZDoom, it doesn't know that syntax.

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
×