Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Note: I highly doubt most of these methods will work in Skulltag. If I've tried it in ST and it works, I'll mark it as such.
Full 3D Recoil (Decorate)
A_Recoil rather sucks because it applies horizontal force only. You can use this Pitch-aware method instead. Great for powerful weapons!
Replace each force with your desired velocity. If you want to push forward rather than back, switch the negative sign (-) from first force to the second.
Projectile Spawners (Decorate)
This has two uses: One, it helps keep FastProjectiles from spawning inside walls. Two, it can be used to fire a random projectile while keeping the weapon itself simple.
Actor RocketShooter Replaces Rocket
{
Radius 11
Height 8
Mass 0
Speed 4
Damage (0)
Projectile
+NOINTERACTION
+NOTIMEFREEZE
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx ("FastRocket", 0, 0, 0, VelX * 8, VelY * 8, VelZ * 8, 0, SXF_NOCHECKPOSITION|SXF_ABSOLUTEVELOCITY|SXF_TRANSFERPOINTERS)
Stop
}
}
Actor FastRocket : FastProjectile
{
Game Doom
SpawnID 127
Radius 11
Height 8
Speed 20
Damage 20
Projectile
+RANDOMIZE
+DEHEXPLOSION
+ROCKETTRAIL
DeathSound "weapons/rocklx"
Obituary "$OB_MPROCKET"
States
{
Spawn:
MISL A 0
MISL A 0 A_PlaySound ("weapons/rocklf")
Spawn1:
MISL A 1 Bright
Loop
Death:
MISL B 8 Bright A_Explode
MISL C 6 Bright
MISL D 4 Bright
Stop
}
}
Enjoy those 4x speed Rockets. (Yes, have fun fighting Cyberdemons. )
An important thing here is that the spawner is given the same radius as the missile it'll fire, and its Speed should not exceed the Player's Radius (which is typically 16). Since the point is to not spawn a missile inside a wall. (I've never noted a loss of accuracy using this multiplication method.)
Yes, I had to copy a lot of the Rocket's code, since it's now inheriting from FastProjectile. I also had to "hack in" the shoot sound, but oh well. Also note that I left the Speed alone and let the shooter do the work: ZDoom uses a projectile's Speed to determine how far away it must be before the Player can see it. Weird, I know.
Now, to make your spawner fire a random projectile. Let's change up the States a bit...
Actor BigDamnRocket : FastRocket
{
Scale 1.25
Damage 40
States
{
Death:
MISL B 8 Bright A_Explode (256, 128)
MISL C 6 Bright
MISL D 4 Bright
Stop
}
}
Now there's a 50% chance to fire a rocket with normal speed but 2x power. Yes it's a silly example, but there you go.
Melee Attack "Arc Scans" (Decorate)
This somewhat replicates the melee weapons from Hexen. The scan will span outward in an arc, trying to find an enemy to hit. This has a couple interesting quirks:
Instead of turning to face the enemy dead-center, you'll only turn as far as needed to strike its hitbox.
Near the max range of the attack (based on the target's radius), the distance check and thus the scan will fail. This isn't so bad in practice.
Actor WhateverMissile
{
Args 10, 0, 0, 0, 0 // Set initial minimum Damage to 10. The extra zeroes aren't strictly necessary, but make it clearer which Args you're changing.
Damage ( Random[Dmg](Args[0], Args[0] * 2) ) // Use whatever max multiplier you want. This will make it 10~20.
// [Other Properties go here.]
States
{
Spawn:
// Normal "Spawn" animation goes here.
NOOB A 35
Loop
DamageBoost:
TNT1 A 0 A_SetArg (0, Args[0] + 5) // Set new Damage to 15~30. (You could set an absolute value, instead.)
Goto Spawn
}
}
Want to use a "vanilla" damage spread instead? Change the Damage property like this:
Note: You probably won't have another use for your missile's Args[]. If that's the case, you can skip the rest of this. But just in case you do need an alternative, you can use User Vars instead. The code becomes a bit more messy, however...
Actor WhatevarMissile
{
Var Int User_DamageMin; // Note that you can't set the initial value here. This will get messy indeed...
Damage ( Random[Dmg](User_DamageMin, User_DamageMin * 2) ) // Use whatever max multiplier you want.
// [Other Properties go here.]
States
{
Spawn:
TNT1 A 0 NoDelay A_SetUserVar ("User_DamageMin", 10) // Set initial minimum Damage to 10. That is, 10~20.
Spawn1:
// Normal "Spawn" animation goes here. Make sure you always jump back to here, not Spawn.
NOOB A 35
Loop
DamageBoost:
TNT1 A 0 A_SetUserVar ("User_DamageMin", User_DamageMin + 5) // Set new Damage to 15~30.
Goto Spawn1 // Don't forget to jump to the correct state.
}
}
I just tested your code, NeuralStunner, and it seems you have the x-velocity backwards: it needs to be a negative value to thrust the player backwards. The z-velocity is correct though! You can pull off some interesting effects with this.
Technology becomes obsolete moments after it's released, isn't that how it works?
Edit: Heh, so I tried that method and the chosen projectiles are being fired horizontally (rather than inheriting the direction of the RandomSpawner). So I'm not dead yet!
This fast projectile spawner, I'm not sure I understand the need for the multiplication of velocity, I assume that works into the speed of the projectile it spawns, so I want to make sure my projectiles are going at the speeds I want them to
Is this the equivalent of A_SkullAttack w/o the damage (may include A_FaceTarget)? If so, I can finally make a rampaging stampede of demons to (eventually) climb over ledges w/o infighting each other.