Page 1 of 1

[Question]: How do i replace the pistol and the fists?

Posted: Thu Jan 12, 2006 14:00
by DuduKrazy
is there a way to replace the pistol and the fists with decorate weapons?

Posted: Thu Jan 12, 2006 14:30
by wildweasel
If you're using GZDoom, you can use an FSGLOBAL lump, the contents of which would look somewhat like this:

Code: Select all

[scripts]

script 1
{
   if (!checkinventory(0, "QuestItem1",1))
   {
      takeinventory(0, "Pistol");
      takeinventory(0, "Fist");
      giveinventory(0, "MartialArts");
      giveinventory(0, "Glock");
      setweapon(0, "Glock");
      giveinventory(0, "QuestItem1");
   }
}
startscript(1);
This code first checks for the presence of a dummy item (you don't need to define it in Decorate), and if it's not found in the player's inventory (i.e. if he has just started the game) the game takes away the default Pistol and Fist so that the game does not autoselect them. Then it gives the player two different weapons and selects the new pistol. It finishes by giving the player the dummy item, so the script doesn't repeat every level.

There is currently no equivalent to this in ZDoom 96x.

Posted: Thu Jan 12, 2006 16:46
by DuduKrazy
thanks for the help.

Posted: Thu Jan 12, 2006 22:44
by DuduKrazy
oh yeah. one more thing. how do i do to make the decorate fists get affected by the Berzerk power-up?

Posted: Thu Jan 12, 2006 22:52
by TheDarkArchon
A_JumpIfInventory and check for "PowerStrength" which makes a jump to alternate set of frames that are more powerful (Normal fists get powered-up 10x)

Posted: Thu Jan 12, 2006 23:05
by DuduKrazy
some like this? A_JumpIfInventory("PowerStrength",1,0)

Posted: Thu Jan 12, 2006 23:09
by TheDarkArchon
Yes.

Posted: Thu Jan 12, 2006 23:26
by DuduKrazy
i added the state to the first frame Punga0 but nothing changed. i tried to make this syntax check for Berserk but i've seen nothing different. i still don't know what does these numbers on the syntax do.

Posted: Fri Jan 13, 2006 11:16
by TheDarkArchon
Post your DECORATE so I can have a look at it.

Posted: Fri Jan 13, 2006 13:05
by DuduKrazy

Code: Select all

//********W3@p0n$**********

ACTOR Fists2 : Weapon
{
   Weapon.Ammouse 0
   Weapon.SelectionOrder 180
   +MELEEWEAPON
   +NOALERT
   AttackSound "weapons/fist"
   States
   {
   Spawn:
      WHAT A -1
      LOOP
   Ready: 
      PUNG A 1 A_WeaponReady
      LOOP
   Deselect: 
      PUNG A 1 A_Lower
      LOOP
   Select:
      PUNG A 0 A_JumpIfInventory("PowerStrength",1,0)
      PUNG A 1 A_Raise
      LOOP
   Fire:
      PUNG BC 1
      PUNG DEF 1
      PUNG G 1 A_CustomPunch(3, 0, 1)
      PUNG H 1
      PUNG I 0 A_PlaySound("weapons/punchswing")
      PUNG I 1
      PUNG JKL 2
      PUNG MN 1
      PUNG O 1 A_CustomPunch(3, 0, 1)
      PUNG P 1
      PUNG Q 0 A_PlaySound("weapons/punchswing")
      PUNG Q 1      
      PUNG RS 2
      PUNG T 2
      PUNG A 2 A_ReFire
      Goto Ready
    Hold:
      PUNG DEF 1
      PUNG GH 1 A_CustomPunch(3, 0, 1)
      PUNG I 0 A_PlaySound("weapons/punchswing")
      PUNG I 1
      PUNG JKL 2
      PUNG MN 1
      PUNG O 1 A_CustomPunch(3, 0, 1)
      PUNG P 1
      PUNG Q 0 A_PlaySound("weapons/punchswing")
      PUNG Q 1
      PUNG RS 2
      PUNG T 2
      PUNG A 2 A_ReFire
      Goto Ready
   Altfire:
      KICK A 3
      KICK B 3
      KICK C 3 A_CustomPunch(6, 0, 1)
      KICK B 5
      KICK A 5 A_ReFire
      Goto Ready
   } 
} 

Posted: Fri Jan 13, 2006 13:23
by TheDarkArchon

Code: Select all

//********W3@p0n$**********

ACTOR Fists2 : Weapon
{
   Weapon.Ammouse 0
   Weapon.SelectionOrder 180
   +MELEEWEAPON
   +NOALERT
   AttackSound "weapons/fist"
   States
   {
   Spawn:
      WHAT A -1
      LOOP
   Ready: 
      PUNG A 1 A_WeaponReady
      LOOP
   Deselect: 
      PUNG A 1 A_Lower
      LOOP
   Select:
      PUNG A 1 A_Raise
      LOOP
   Fire:
      PUNG BC 1
   Hold:
      PUNG A 0 A_JumpIfInventory("PowerStrength",1,21)
      PUNG DEF 1
      PUNG G 1 A_CustomPunch(3, 0, 1)
      PUNG H 1
      PUNG I 0 A_PlaySound("weapons/punchswing")
      PUNG I 1
      PUNG JKL 2
      PUNG MN 1
      PUNG O 1 A_CustomPunch(3, 0, 1)
      PUNG P 1
      PUNG Q 0 A_PlaySound("weapons/punchswing")
      PUNG Q 1      
      PUNG RS 2
      PUNG T 2
      PUNG A 2 A_ReFire
      Goto Ready
      PUNG BC 1
      PUNG DEF 1
      PUNG G 1 A_CustomPunch(30, 0, 1)
      PUNG H 1
      PUNG I 0 A_PlaySound("weapons/punchswing")
      PUNG I 1
      PUNG JKL 2
      PUNG MN 1
      PUNG O 1 A_CustomPunch(30, 0, 1)
      PUNG P 1
      PUNG Q 0 A_PlaySound("weapons/punchswing")
      PUNG Q 1      
      PUNG RS 2
      PUNG T 2
      PUNG A 2 A_ReFire
      Goto Ready
   Altfire:
      KICK A 0 A_JumpIfInventory("PowerStrength",1,6)
      KICK A 3
      KICK B 3
      KICK C 3 A_CustomPunch(6, 0, 1)
      KICK B 5
      KICK A 5 A_ReFire
      Goto Ready
      KICK A 3
      KICK B 3
      KICK C 3 A_CustomPunch(60, 0, 1)
      KICK B 5
      KICK A 5 A_ReFire
      Goto Ready
   } 
} 
There you go.

Posted: Fri Jan 13, 2006 14:38
by DuduKrazy
oh. thanks a lot for the help!