Hexen and Heretic (Tome of power) weapons

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Anakin S. wrote:
Graf Zahl wrote:LWM:

Bouncy:

Just to show, here's a small example (If you ever played Caverns of Darkness you might recognize it)

Code: Select all

AMMO Faith
{
	Max 100
	Backpack 0
	Icon CRSSA0
}
Can you change the pickup message for the ammo, as well as the pickup sound?

AMMO is not a pickup. It's just an abstract definition required to create a new ammo type internally. (Don't worry. The reason behind this will become clear when I update the Wiki.)

I already have done some work to enable pickup definitions that do predefined actions but this has to wait until after the next version is released. Until then the only way to give a player ammo of a new type is either with the weapon itself or with GiveInventory.
User avatar
ellmo
Posts: 429
Joined: Thu Mar 04, 2004 9:21 am
Location: Poland - Poznan
Contact:

Post by ellmo »

Oh, and one more thing. How do I make all heretic-type weapons use "Tome of Power" fire?

I don't think I'm interested in using them without Tome.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

To accomplish that you have to fake the presence of the powerup all the time. You can do that with SetPlayerProperty. Of course that might affect all other weapons as well if they have a powered up state.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

Graf Zahl wrote:But the Wraithverge is another matter. It's by far the most complicated stuff at all in all of Doom, Heretic, Hexen and Strife combined, not to mention one of the best (if not the best) weapon I have ever seen in a 3D-shooter. Unless Doomscript or something similar exists it won't be possible to do stuff like this. It just won't work without new code (and it would require a skilled programmer to do it.)
It doesn't seem like a terribly complex action. A projectile that spawns a few actors who choose targets and fly toward them (lost soul), which also have a limited turning ability (homing missiles), and pass through walls (no clipping). This is certainly more complex than most weapons, but not nearly difficult-to-impossible. If you added the bloodscourge pointer above, it would seem nearly emulatable through decorate. There must be some other behavior that I'm not seeing. What exactly makes it so complicated?
Graf Zahl wrote:projectiles itselves
Sorry... You fail it! :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Risen wrote:
Graf Zahl wrote:projectiles itselves
Sorry... You fail it! :)

Hey, do I make fun of people making such errors just because English isn't their first language? ;)
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Post by LilWhiteMouse »

Graf Zahl wrote:To accomplish that you have to fake the presence of the powerup all the time. You can do that with SetPlayerProperty. Of course that might affect all other weapons as well if they have a powered up state.
One of my personal mods toggles the tome effect depending on weapon, as I use both the dragon's claw (un tomed), and phoenix rod (tomed) in it. From memory, looked something like this:

Code: Select all

script 1 ENTER {
while(1)
{
SetPlayerProperty(0, 0, 11);
while (CheckWeapon("PhoenixRod") == 0){delay(const:4);}
SetPlayerProperty(0, 1, 11);
while (CheckWeapon("PhoenixRod" != 0){delay(const:4);}
}
}
Risen wrote:What exactly makes it so complicated?
Without being a programmer/understanding code myself, I'd guess because it's a special case hack of sorts. I thought I'd be clever and make a duplicate of the MinotaurFriend, just giving it my own Missile state. I summoned it only to have it behave like a normal enemy, and not very friendly at all.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

LilWhiteMouse wrote:
Without being a programmer/understanding code myself, I'd guess because it's a special case hack of sorts. I thought I'd be clever and make a duplicate of the MinotaurFriend, just giving it my own Missile state. I summoned it only to have it behave like a normal enemy, and not very friendly at all.

That's a problem of the way ZDoom implements its internal actors. It totally prevents inheriting any hard coded behavior and there's a lot of it.
I know it's unfortunate but that's something that can't be changed without rewriting huge chunks of the game code (most importantly anything that uses virtual functions or hard coded class references.) It certainly can be done but rest assured that I won't do it. ;)
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Post by LilWhiteMouse »

Graf Zahl wrote:...that's something that can't be changed without rewriting huge chunks of the game code (most importantly anything that uses virtual functions or hard coded class references.)
I assumed as much, which is why I never brought it up before.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

I think it's time to change a forumism...

WFDS (Wait for DoomScript)

to

WNDS (Who needs DoomScript)!!!

when the next version comes out.
Graf Zahl wrote:example of new weapon
So my railgun would look like this then:

Code: Select all

WEAPON Railgun 4997 
{ 
   DoomEdNum 20040
   SpawnNum 170
   PickupSound "misc/w_pkup" 
   PickupMsg "Railgun!" 
   FireSound "weapons/railgf" 
   AmmoType Cell 
   PerShot 10 
   GiveAmmo 40 
   States 
   { 
   Spawn: 
      RAIL A -1 BRIGHT 
      Loop 
   Ready: 
      RAIL A 1 A_WeaponReady 
      Loop 
   Deselect: 
      RAIL A 1 A_Lower 
      Loop 
   Select: 
      RAIL A 1 A_Raise 
      Loop 
   Fire: 
      RAIL A 10 A_FireRailgunRight
      RAIL B 40 
      Goto Ready 
   } 
} 
One question though: what does the 4997 mean after the actor name? I've seen it in monster definitions too, so it must mean something.
User avatar
Giest118
Posts: 2914
Joined: Fri Dec 05, 2003 11:02 pm

Post by Giest118 »

Graf Zahl wrote:Yet another utterly useles 'contibution' by you. For a time I thought you'd gotten it. But recently you are showing yourself more and more like a total idiot. Please stop it!
I might... and I might not...

... let's see, methinks I should make you a boss in st00pid.wad... and your projectile sprites are the words "anti-spam" or "anti-funiness"... and the text that appears when you die is "Graf Zahl took all the humor out of whoever"....

Methinks that is a good idea!

/me goes and edits the DECORATE lump
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Why do you have to poison decent threads with this? Is this some kind of obsessive compulsive behavior or what? IMHO you should visit a psychiatrist instead on getting on everybody's nerves.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

giest118 wrote:/me goes and edits the DECORATE lump
Which you wouldn't be able to do if it wasn't for him.
Graf Zahl wrote:It certainly can be done but rest assured that I won't do it.
You don't have to, and it's not such a big change. :-) I've already gotten rid of CustomActor, so new actors can truly inherit from existing classes instead of pretending to do so. Now if LWM makes something based off of MinotaurFriend, it really will be based off of it (but A_MinotaurLook, A_MinotaurRoam, and A_MinotaurChase will need to be made available to anything based off of Minotaur so that the friendly AI works).
User avatar
Giest118
Posts: 2914
Joined: Fri Dec 05, 2003 11:02 pm

Post by Giest118 »

randy wrote:
giest118 wrote:/me goes and edits the DECORATE lump
Which you wouldn't be able to do if it wasn't for him.
... Which basically means it's his own fault that he's going to be made fun of in st00pid.wad?

... Which also means I should be thanking him for st00pid's existence in the first place...

... Which in turn means that it's wrong of me to be making fun of him...

... Which means...

/goes and changes Graf Zahl's projectile sprites
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

randy wrote: You don't have to, and it's not such a big change. :-) I've already gotten rid of CustomActor, so new actors can truly inherit from existing classes instead of pretending to do so.
Does that mean that we can use player weapon codepointers in monsters? (instead of pretending to be them like the scripted marines did)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

The Ultimate DooMer wrote:I think it's time to change a forumism...

WFDS (Wait for DoomScript)

to

WNDS (Who needs DoomScript)!!!

when the next version comes out.
Graf Zahl wrote:example of new weapon
So my railgun would look like this then:

Code: Select all

WEAPON Railgun 4997 
{ 
   DoomEdNum 20040
   SpawnNum 170
   PickupSound "misc/w_pkup" 
   PickupMsg "Railgun!" 
   FireSound "weapons/railgf" 
   AmmoType Cell 
   PerShot 10 
   GiveAmmo 40 
   States 
   { 
   Spawn: 
      RAIL A -1 BRIGHT 
      Loop 
   Ready: 
      RAIL A 1 A_WeaponReady 
      Loop 
   Deselect: 
      RAIL A 1 A_Lower 
      Loop 
   Select: 
      RAIL A 1 A_Raise 
      Loop 
   Fire: 
      RAIL A 10 A_FireRailgunRight
      RAIL B 40 
      Goto Ready 
   } 
} 
One question though: what does the 4997 mean after the actor name? I've seen it in monster definitions too, so it must mean something.

Almost. I didn't export A_FireRailGunRight. The reason for this is the internal handling of the flash animation. For robustness I only exported functions that do not start a flash animation, except A_GunFlash which is explicitly there to do exactly that.
The omitted functions are all of a kind that can be easily emulated by the generic ones.
To use the railgun there's a new function called A_RailAttack which is much more versatile than the old ones.

One bug: Never use the same sprite for the spawn state and for the rest.
The spawn state defines the sprite of the pickup item, not the weapon itself.

The 4997 behind the actor's name is the editor number - i.e the thing you place in a map. For consistency this should have been put inside the braces but that's something I simply forgot when I prepared the code and now it's too late. ;)
Locked

Return to “Editing (Archive)”