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

Railgun Autoaim/Getting into pk3 editing

Question

Hi,

 

The question that I'm about to ask has been asked before but not necessarily for the same purpose. 

I play Doom on my phone exclusively via OpenTouch. Because of this I always have freelook off and autoaim on. Now, if I use a weapons mod that has a railgun type weapon (like Karnage Legacy or Zagemod - a few classes have railgun/laser/beam style weapons), there is no vertical autoaim. This results in situations that become unbeatable - for example - only having ammo for a railgun type weapon and loads of enemies at elevated places.

 

So my question is - is there a way for a complete novice to open up a weapons mod in Slade and add a line of code that would enable vertical autoaim easily?

 

I've only recently even begun to experiment with Slade, and I am a total novice with no experience. Most I've done so far is change weapon damage numbers.

 

If that's not an option - is there anything else I should do/try? I play on my phone due to how portable it is. Doom/Doom 2 is one of my favourite games and I've played it many times on a proper PC many times before. I just don't have this luxury at the moment.

 

TL;DR - Can I make railgun weapons auto aim via Slade?

 

Thanks

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0

Yes, there's a way that I know that's very easy even though it is just a hacky way to do that.

You have to replace the A_RailAttack (which is usually the correct one for weapons) with the one that monsters use, A_CustomRailgun.

 

That's it. One issue is that the attack won't spawn puffs or decals on walls, so you might want to also call A_FireBullets in the exact same frame setting all of the arguments to 0 (unless you want to spawn a custom puff of course).

 

So you'll end up having something like this:

RAIL A 6 {
	A_FireBullets(0, 0, 0, 0);
	A_CustomRailgun("stuff that you want");
}

 

Also, remember to remove any WEAPON.NOAUTOAIM flag if present

Share this post


Link to post
  • 0
On 1/4/2024 at 6:32 PM, Kan3 said:

Yes, there's a way that I know that's very easy even though it is just a hacky way to do that.

You have to replace the A_RailAttack (which is usually the correct one for weapons) with the one that monsters use, A_CustomRailgun.

 

That's it. One issue is that the attack won't spawn puffs or decals on walls, so you might want to also call A_FireBullets in the exact same frame setting all of the arguments to 0 (unless you want to spawn a custom puff of course).

 

So you'll end up having something like this:


RAIL A 6 {
	A_FireBullets(0, 0, 0, 0);
	A_CustomRailgun("stuff that you want");
}

 

Also, remember to remove any WEAPON.NOAUTOAIM flag if present

 

Hi, thanks for responding. I tried replacing a_railattack with a_customrailgun and now I'm getting an error message like this in GZDoom:

 

Execution could not continue.

Script error, "zagemod.pk3:decorate.txt" line 18922:
Invalid parameter 'a_customrailgun'

 

What it looks like in Slade:

 

TNT1 A 0 A_ CustomRailgun(100, 0, 1, "00 00 FF", "FF FF FF",RGF_SILENT,0,"RailPuff2",0,0,0,35)

 

it seems like it's not recognising the name. What have I done wrong here?

Share this post


Link to post
  • 0

Just checking the obvious, do you have a space between A_ and CustomRailgun like in your pasted text above? You should not.

Share this post


Link to post
  • 0
Posted (edited)

yep - absolutely right, I left a space there and didn't see it. Thanks for the sanity check.

 

While this works, I noticed that all railgun type weapons do little to no damage now. I think the a_railattack function could be tied to something else that I didn't amend alongside changing it to a_customrailgun.

 

*edit* I also noticed that while the attack targets monsters when I use a_customrailgun, it doesn't use the projectile beam alongside not doing damage. Weapon goes through it's firing animation but there's no projectile. Does a_customrailgun need to be somehow referred to the projectile in Slade? I'll post the code here:

 

Fire:
            RLGN F 0
            RLGN G 0 A_GunFlash
            // RLGN G 0 A_Recoil(1)
            RLGN G 1 A_PlaySound("weapons/railgunfire", CHAN_WEAPON, 0.1, 0, ATTN_NORM)
            RLGN G 0 A_FireCustomMissile("DummyProjectile3", 0, 0, 0, 0, 0, 0)
            RLGN G 1 A_FireCustomMissile("RailGunPlasmaHit", 0, 0, 0, 0, 0, 0)
            RLGN G 4 a_customrailgun(200, 0, 1, "AD FF 2F", "98 FB 98", RGF_FULLBRIGHT)
            RLGN H 3
            RLGN F 0 A_PlaySound("weapons/railcharge", CHAN_BODY, 0.8, 0, ATTN_NORM)
            RLGN FEDCBA 3
            RLGN BCDEF 2
            RLGN F 0 A_ReFire
            RLGN F 0 A_PlaySound("weapons/railready", CHAN_BODY, 1, 0, ATTN_NORM)
            Goto Ready
        Flash:
            TNT1 A 2 BRIGHT A_Light2
            TNT1 A 2 BRIGHT A_Light1
            TNT1 A 2 BRIGHT A_Light0
            Goto LightDone
    }
}

ACTOR RailGunPlasmaHit : FastProjectile 9915
{
    Projectile
    Radius 4
    Height 4
    Damage 0
    Speed 250
    RenderStyle Add
    Alpha 0.75
    Scale 1.10
    SeeSound "Null"
    DeathSound "Null"
    +NOINTERACTION
    +NONSHOOTABLE
    +NODAMAGETHRUST
    +RANDOMIZE
    +DONTSPLASH
    
    States
    {
        Spawn:
            TNT1 A 1
            Loop
        Death:
            RLGX ABCDE 3 BRIGHT
            Stop

Edited by Doman

Share this post


Link to post
  • 0
On 1/7/2024 at 11:57 PM, Doman said:

I think the a_railattack function could be tied to something else that I didn't amend alongside changing it to a_customrailgun.

Nope, you just used an argument that the function doesn't have (I don't know why this doesn't give you an error) because you just replaced A_RailAttack with A_CustomRailgun. When using new functions you need to look what they do and what they require, that's why I left the link.

Remove the 3rd argument and it should fix something.

 

Quote

when I use a_customrailgun, it doesn't use the projectile beam

Quote

Weapon goes through it's firing animation but there's no projectile

What you mean by that?

The weapon doesn't fire the rail attack, it doesn't spawn the first 2 dummy projectiles, it doesn't consume ammo?

Share this post


Link to post
  • 0
On 1/9/2024 at 9:01 AM, Kan3 said:

Nope, you just used an argument that the function doesn't have (I don't know why this doesn't give you an error) because you just replaced A_RailAttack with A_CustomRailgun. When using new functions you need to look what they do and what they require, that's why I left the link.

Remove the 3rd argument and it should fix something.

 

What you mean by that?

The weapon doesn't fire the rail attack, it doesn't spawn the first 2 dummy projectiles, it doesn't consume ammo?

 

I'll attach a screenshot of a_railattack and a_customrailgun to illustrate what I mean. Image 2 is with a_customrailgun on, it doesn't fire the helix beam at all, also doesn't consume ammo and doesn't do damage, also I think it's not playing the attack sound correctly. It does autoaim though. 

1.png

2.png

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
×