A_Jump buggy? Or am I doing this wrong?

Do you have a question about making weapon mods, or do you just need some tutorials and resources? Ask about all of that here.

Moderator: wildweasel

Locked
User avatar
Lazureus
Posts: 15
Joined: Wed Jun 27, 2007 17:12
Location: Florida

A_Jump buggy? Or am I doing this wrong?

Post by Lazureus »

One of the weapons in my project is called the Tar Lobber. I haven't designed it's HUD sprite yet, so it still uses the Pistol. Anyways, I did create projectiles for it. The basic rundown is, the Tar Lobber fires 3 tar-splatter projectiles. One big one (TarDaddy) in the middle, and two smaller versions that shoot out of each side (TarBabies).

At first, they fired at fixed angles. Tarbabies fired at -8 and 8 degrees respectively, and Tardaddy fired at 0 angle (directly ahead). However, I'm trying to mix it up a bit to make it more shotgunny. I'm having problems with that here. Using A_Jump and goto calls, the code should theoretically make it so that it decides to fire at slightly different angles every time. However, instead, it's basically firing at the same angles every time, and occassionally firing at the LAST set of angles here and there. None of the other angle sets are being used AT ALL.

Here's the code:

Code: Select all

actor TarLobber : weapon 30003
{
  obituary "%o was tarred and feathered by %k."
  weapon.selectionorder 1300
  states
  {
  Ready:
    PISG A 1 A_WeaponReady
    loop
  Deselect:
    PISG A 1 A_Lower
    loop
  Select:
    PISG A 1 A_Raise
    loop
  Fire:
    PISG A 0 A_Jump (50,9)
    PISG A 0 A_FireCustomMissile("TarDaddy",0,0,0,0)   // Daddy #1
    PISG A 0 A_FireCustomMissile("TarBaby",8,0,2,0)    // Right #1
    PISG A 0 A_FireCustomMissile("TarBaby",-8,0,-2,0)  // Left #1
    PISG A 4
    PISG B 6
    PISG C 4
    PISG B 20 
    PISG B 1 A_ReFire
    goto Ready
    PISG A 0 A_Jump (50,9)
    PISG A 0 A_FireCustomMissile("TarDaddy",2,0,0,0)   // Daddy #2
    PISG A 0 A_FireCustomMissile("TarBaby",5,0,2,0)    // Right #2
    PISG A 0 A_FireCustomMissile("TarBaby",-4,0,-2,0)  // Left #2
    PISG A 4
    PISG B 6
    PISG C 4
    PISG B 20 
    PISG B 1 A_ReFire
    goto Ready
    PISG A 0 A_Jump (50,9)
    PISG A 0 A_FireCustomMissile("TarDaddy",-2,0,0,0)  // Daddy #3
    PISG A 0 A_FireCustomMissile("TarBaby",9,0,2,0)    // Right #3
    PISG A 0 A_FireCustomMissile("TarBaby",-10,0,-2,0)  // Left #3
    PISG A 4
    PISG B 6
    PISG C 4
    PISG B 20 
    PISG B 1 A_ReFire
    goto Ready
    PISG A 0 A_Jump (50,9)
    PISG A 0 A_FireCustomMissile("TarDaddy",1,0,0,0)  // Daddy #4
    PISG A 0 A_FireCustomMissile("TarBaby",3,0,2,0)    // Right #4
    PISG A 0 A_FireCustomMissile("TarBaby",-4,0,-2,0)  // Left #4
    PISG A 4
    PISG B 6
    PISG C 4
    PISG B 20 
    PISG B 1 A_ReFire
    goto Ready
    //PISG A 0 A_Jump (50,9) 
    PISG A 0 A_FireCustomMissile("TarDaddy",0,0,0,0)  // Daddy #5
    PISG A 0 A_FireCustomMissile("TarBaby",3,0,2,0)    // Right #5
    PISG A 0 A_FireCustomMissile("TarBaby",-5,0,-2,0)  // Left #5
    PISG A 4
    PISG B 6
    PISG C 4
    PISG B 20 
    PISG B 1 A_ReFire
    goto Ready
    
   
  Spawn:
    LAUN A -1
    stop
  }
}
Can anyone help me here? It's not randomizing like it should, and instead is picking the first or last set... mainly the first almost every time.
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

You know that the chance of jumping is out of 256, not 100, right?

Also, a lot of that code is unnecessary, this would more than suffice for what you're looking for:

Code: Select all

actor TarLobber : weapon 30003
{
  obituary "%o was tarred and feathered by %k."
  weapon.selectionorder 1300
  states
  {
  Ready:
    PISG A 1 A_WeaponReady
    loop
  Deselect:
    PISG A 1 A_Lower
    loop
  Select:
    PISG A 1 A_Raise
    loop
  Fire:
    PISG A 0 A_FireCustomMissile("TarDaddy",random(-2,2),0,0,0)   // Daddy #1
    PISG A 0 A_FireCustomMissile("TarBaby",random(4,8),0,2,0)    // Right #1
    PISG A 0 A_FireCustomMissile("TarBaby",-random(-8,-4),0,-2,0)  // Left #1
    PISG A 4
    PISG B 6
    PISG C 4
    PISG B 20 
    PISG B 1 A_ReFire
    goto Ready
  Spawn:
    LAUN A -1
    stop
  }
}
User avatar
Lazureus
Posts: 15
Joined: Wed Jun 27, 2007 17:12
Location: Florida

Post by Lazureus »

woah, really? the zdoom wiki never said anything about being able to do that-_- thanks!
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

Basically, usage of random is:

Code: Select all

random(low,high)
for which a random number between "low" and "high" is generated.
User avatar
Lazureus
Posts: 15
Joined: Wed Jun 27, 2007 17:12
Location: Florida

Post by Lazureus »

any other little undocumented things like this i may not know about cuz zdoom wiki doesn't cover it?

I've been lookin for decorate recreations of heretic weapons too btw :o
User avatar
KeksDose
Stronghold Team
Posts: 319
Joined: Thu Apr 12, 2007 21:35
Location: Germany

Post by KeksDose »

You can recreate them easily, if you want them in other games.

Code: Select all

Actor DragonClaw2 : DragonClaw
{
}
This means it creates a new actor, and the actions/properties will be inherited from the original Heretic Dragon Claw. You can also change some things now (like the fire state, or the tome of power...power). Just make sure you have the original Heretic Graphics, with exact their name, otherwise you have to recreate it from scratch (<---- IGNORE THIS IF YOU USE HIRESTEX!). The same goes for monsters ;) And if you use GZDoom, you can port the Graphics without palette restriction, which make the sprites even nicer.
User avatar
Lazureus
Posts: 15
Joined: Wed Jun 27, 2007 17:12
Location: Florida

Post by Lazureus »

I am producing for the skulltag port, which uses Zdoom 2.1.7 specifications.

The zdoom wiki says there's a gravity property, but skulltag errors out on it though saying it doesn't exist :o.
Locked

Return to “Weapon Modding Help & Resources”