Back to the Vavoom Forum Archives


Forum

[Fixed] Hexen Firestorm not working

Sun, 15 Apr 2007 16:55:06

Durandal

I'm playing Hexen with version 1.22.1, and the Cleric's 3rd weapon doesn't spawn the flames around the base of the target when it hits. It worked fine before I updated to latest version.
Sun, 15 Apr 2007 19:08:26

Firebrand

I really haven't noticed this before myself, there must be some kind of problem with the code there.
Thu, 19 Apr 2007 03:32:15

Durandal

From what I can tell, I believe it to be an issue with the struck object (Actor bmo) not getting set properly. I can't see any issues with it, but I am not 100% versed in C. from ClericFlameMissile.vc:
class ClericFlameMissile : Projectile;

float FlameSpeed;
Actor bmo;

//==========================================================================
//
//	HitMobj
//
//==========================================================================

void HitMobj(Entity Other)
{
	bmo = Actor(Other);
	::HitMobj(Other);
	bmo = none;
}
from Actor.vc:
//==========================================================================
//
//	HitMobj
//
//==========================================================================

void HitMobj(Entity Other)
{
	float angle;

	if (bMissile)
	{
		if (bFloorBounce)
		{
			if (Actor(Other).bReflective || (!Other.bIsPlayer &&
				!Actor(Other).bCountKill))
			{
				float speed;

				angle = AngleMod360(atan2(Origin.y - Other.Origin.y,
					Origin.x - Other.Origin.x) + Random() * 16.0 - 8.0);
				speed = Length(Velocity);
				speed = speed * 0.75;
				Angles.yaw = angle;
				Velocity.x = speed * cos(angle);
				Velocity.y = speed * sin(angle);
				if (SightSound)
				{
					PlaySound(SightSound, CHAN_VOICE);
				}
			}
			else
			{
				// Struck a player/creature
				ExplodeMissile();
			}
			return;
		}
		if (Actor(Other).bReflective)
		{
			angle = Actor(Other).GetReflectedAngle(self);
			if (angle != -1.0)
			{
				// Reflect the missile along angle
				Angles.yaw = angle;
				Velocity.x = (Speed / 2.0) * cos(angle);
				Velocity.y = (Speed / 2.0) * sin(angle);
//				Velocity.z = -Velocity.z;
				if (bSeekerMissile)
				{
					Enemy = Instigator;
				}
				Instigator = Actor(Other);
				return;
			}
		}
		// Explode a missile
		ExplodeMissile();
	}
	else
	{
		if (bSlide)
		{
			// Try to slide along it
			// Slide against mobj
//			if (TryMove(vector(Origin.x, ptryy, Origin.z)))
			if (TryMove(vector(Origin.x, Origin.y + Velocity.y * Level.Game.frametime, Origin.z)))
			{
				Velocity.x = 0.0;
			}
//			else if (TryMove(vector(ptryx, Origin.y, Origin.z)))
			else if (TryMove(vector(Origin.x + Velocity.x * Level.Game.frametime, Origin.y, Origin.z)))
			{
				Velocity.y = 0.0;
			}
			else
			{
				Velocity.x = 0.0;
				Velocity.y = 0.0;
			}
		}
		else
		{
			Velocity.x = 0.0;
			Velocity.y = 0.0;
		}
	}
}
and back to ClericFlameMissile.vc:
//============================================================================
//
//  A_CFlameMissile
//
//============================================================================

void A_CFlameMissile()
{
	int i;
	float an;
	float dist;
	Actor A;

	A_UnHideThing();
	PlaySound('ClericFlameExplode', CHAN_VOICE);
	if (bmo && bmo.bShootable)
	{
		// Hit something, so spawn the flame circle around the thing
		dist = bmo.Radius + 18.0;
		for (i = 0; i < 4; i++)
		{
			an = itof(i) * 45.0;
			A = Spawn(CircleFlame, bmo.Origin +
				vector(dist * cos(an), dist * sin(an), 5.0));
			if (A)
			{
				A.Angles.yaw = an;
				A.Instigator = Instigator;
				A.Velocity.x = FlameSpeed * cos(an);
				A.Velocity.y = FlameSpeed * sin(an);
				A.Special1f = A.Velocity.x;
				A.Special2f = A.Velocity.y;
				A.StateTime -= Random() * 0.1;
			}
			A = Spawn(CircleFlame, bmo.Origin +
				vector(-dist * cos(an), -dist * sin(an), 5.0));
			if (A)
			{
				A.Angles.yaw = AngleMod360(180.0 + an);
				A.Instigator = Instigator;
				A.Velocity.x = -FlameSpeed * cos(an);
				A.Velocity.y = -FlameSpeed * sin(an);
				A.Special1f = A.Velocity.x;
				A.Special2f = A.Velocity.y;
				A.StateTime -= Random() * 0.1;
			}
		}
		SetState(S_FLAMEPUFF2_1);
	}
}
Mon, 23 Apr 2007 09:15:10

scen

This is already fixed in current SVN sources (you've guessed right the solution <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> )
Tue, 24 Apr 2007 12:59:27

Durandal

Thanks! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Thu, 26 Apr 2007 16:10:27

Janis Legzdinsh

Yes, it's fixed.

Back to the Vavoom Forum Archives