Crash bug on death of a Leman Russ (or varient)

Crash bug on death of a Leman Russ (or varient)

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Crash bug on death of a Leman Russ (or varient)

Post by Guessmyname »

For the record, I haven't a damn clue what's causing this

EDIT: By the way, this is using a dev spring version. I'm going to try in 0.74b3 now

When a Leman Russ tank dies, Spring crashes, without posting anything to infolog.txt (Windows' annoying "Program has encountered a problem" thing takes over Spring's far more useful error message).

The tanks are the same as all the other tanks in my mod, but those tanks are not affected by this bug.

Additional Notes: Leman Russ's that have been self-d'd seem to die okay without crashes. In addition, with further testing, this crash bug doesn't occur every time a Leman Russ dies - the 'Russ has to die in combat and it doesn't always happen (in two-on-two test matches, the first Leman Russ dies fine, the second causes the crash)

Leman Russ script

Code: Select all

piece base, bodyp1, bodyp2, smoke1, smoke2, lascannon, lasfp;
piece turretp1, turretp2, barrel, bcfp;
piece ref, pivot, stubber, hsfp;
piece gunner, head, aim, upperarm1, pad1, lowerarm1, hand1, upperarm2, pad2, lowerarm2, hand2;

static-var restore_delay, unitview, flareuse, bMoving;
#define	SIG_AIM1	2
#define	SIG_AIM2	4
#define	SIG_AIM3	8
#define SMOKEPIECE1 base
#include "smokeunit.h"
#include "exptype.h"
#include "sfxtype.h"

/*RockingScript()
{
	var turnspeed;
	turnspeed=(182*70);
	while(1)
	{
	if(bMoving==1)
		{
		emit-sfx SFXTYPE_BLACKSMOKE from smoke1;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke2;
		turn bodyp1 to x-axis <2> speed turnspeed;
		turn bodyp1 to z-axis <1> speed turnspeed;
		wait-for-turn bodyp1 around x-axis;
		wait-for-turn bodyp1 around x-axis;
		sleep 250;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke1;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke2;
		turn bodyp1 to x-axis <-2> speed turnspeed;
		turn bodyp1 to z-axis <-1> speed turnspeed;
		wait-for-turn bodyp1 around x-axis;
		wait-for-turn bodyp1 around x-axis;
		sleep 250;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke1;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke2;
		turn bodyp1 to x-axis <2> speed turnspeed;
		turn bodyp1 to z-axis <1> speed turnspeed;
		wait-for-turn bodyp1 around x-axis;
		wait-for-turn bodyp1 around x-axis;
		sleep 250;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke1;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke2;
		turn bodyp1 to x-axis <-0.5> speed turnspeed;
		turn bodyp1 to z-axis <0> speed turnspeed;
		wait-for-turn bodyp1 around x-axis;
		wait-for-turn bodyp1 around x-axis;
		sleep 250;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke1;
		emit-sfx SFXTYPE_BLACKSMOKE from smoke2;
		}
	if(bMoving==0)
		{
		sleep 250;
		turn bodyp1 to z-axis <0> speed turnspeed;
		turn bodyp1 to x-axis <0> speed turnspeed;
		}
	}
}*/

Create()
	{
	unitview = FALSE;
	restore_delay = 2000;
	start-script SmokeUnit();
	flareuse=0;
//	Start-script RockingScript();
	bMoving=0;
	}

StartMoving()
{
	bMoving=1;
	set ACTIVATION to 1;
}

StopMoving()
{
	bMoving=0;
	set ACTIVATION to 0;
}

SetMaxReloadTime(time)
	{
	restore_delay = time * 2;
	}

RestoreAfterDelay1()
	{
	sleep restore_delay;
	turn turretp1 to y-axis <0> speed <60>;
	turn barrel to x-axis <0> speed <50>;
	return 0;
	}

RestoreAfterDelay2()
	{
	sleep restore_delay;
	turn lascannon to y-axis <0> speed <60>;
	turn lascannon to x-axis <0> speed <60>;
	return 0;
	}
	
RestoreAfterDelay3()
	{
	sleep restore_delay;
	turn stubber to y-axis <0> speed <60>;
	turn stubber to x-axis <0> speed <60>;
	return 0;
	}

Demo()
	{
	unitview = TRUE;
	}

SweetSpot (piecenum)
	{
	piecenum = bodyp1;
	}

QueryWeapon3(piecenum)
	{piecenum = bcfp;
	}

AimFromWeapon3(piecenum)
	{
	piecenum = barrel;
	}

AimWeapon3(heading, pitch)
	{
	signal SIG_AIM1;
	set-signal-mask SIG_AIM1;
	turn turretp1 to y-axis heading speed <50>;
	turn barrel to x-axis (0-pitch) speed <50>;
	wait-for-turn turretp1 around y-axis;
	wait-for-turn barrel around x-axis;
	start-script RestoreAfterDelay1();
	return(TRUE);
	}

FireWeapon3()
	{	
	move barrel to z-axis [-2] speed [1000000];
	sleep 150;
	move barrel to z-axis [0] speed [100];
	return(0);
	}
	
QueryWeapon1(piecenum)
	{
	piecenum = lasfp;
	}

AimFromWeapon1(piecenum)
	{
	piecenum = lascannon;
	}

AimWeapon1(heading, pitch)
	{
	signal SIG_AIM2;
	set-signal-mask SIG_AIM2;
	turn lascannon to y-axis heading speed <100>;
	turn lascannon to x-axis (0-pitch) speed <100>;
	wait-for-turn lascannon around y-axis;
	wait-for-turn lascannon around x-axis;
	while(bMoving)
	{
		sleep 250;
	}
	start-script RestoreAfterDelay2();
	return(TRUE);
	}

FireWeapon1()
	{
	return(0);
	}
	
QueryWeapon2 (piecenum)
	{
	piecenum = hsfp;
	}

AimFromWeapon2 (piecenum)
	{
	piecenum = stubber;
	}

AimWeapon2(heading, pitch)
	{
	signal SIG_AIM3;
	set-signal-mask SIG_AIM3;
	turn stubber to y-axis heading - get XZ_ATAN(get PIECE_XZ(ref) - get PIECE_XZ(hsfp)) speed <225>;
	turn stubber to x-axis (0 - pitch) speed <150>;
	wait-for-turn stubber around y-axis;
	wait-for-turn stubber around x-axis;
	return(TRUE);
	}

FireWeapon2()
	{
	return(0);
	}

Killed(severity, corpsetype)
	{
	corpsetype = 1;
	return(0);
	}
Leman Russ fbi

Code: Select all

[UNITINFO]
	{
	CanRestore=0;
	shownanoframe=0;
	shownanospray=0;
	iconType=tank;

	ID=3;
	UnitName=IG_LRuss;
	Version=1;
	Side=ARM;
	Objectname=IG_LRuss;
	Designation=IG_LRuss;
	Name=Alpha Pattern Leman Russ;
	Description=Main Battle Tank;
	FootprintX=2;
	FootprintZ=2;
	BuildCostEnergy=2600;
	BuildCostMetal=2600;
	MaxDamage=7000;
	MaxWaterDepth=15;
	MaxSlope=20;
	EnergyUse=205;
	BuildTime=2200; //700
	WorkerTime=0;
	BMcode=1;
	Builder=0;
	ThreeD=1;
	ZBuffer=1;
	NoAutoFire=0;
	SightDistance=350;
	RadarDistance=0;
	SoundCategory=PSY_VEH;
	ExplodeAs=Medium_Vehicle_Explosion;
	SelfDestructAs=BIG_UNIT;
	Category=TANK NOTAIR ARMOURED;
	TEDClass=TANK;
	Copyright=Copyright 1997 Humongous Entertainment. All rights reserved.;
	Corpse=IG_LRuss_dead;
	mobilestandorders=1;
	StandingMoveOrder=1;
	canmove=1;
	canpatrol=1;
	canstop=1;
	canguard=1;
	MaxVelocity=2;
	BrakeRate=0.1;
	unitnumber=15;
	Acceleration=0.03;
	TurnRate=500;
	SteeringMode=1;
	ShootMe=1;
	EnergyMake=0;
	MetalMake=0;
        CanAttack=1;
	Weapon1=VehLascannon;
		WeaponMainDir1=0 0 1;
		MaxAngleDif1=60;
        	Ovradjust=1;
	Weapon2=VehHeavyStubber;
	Weapon3=Battlecannon;
		WeaponSlaveTo3=2;
	BadTargetCategory=VTOL;
        DefaultMissionType=Standby;
	maneuverleashlength=200;
	MovementClass=Tank2x2;
	firestandorders=1;
	Mass=2000;

//Springy stuff (boing!)
	Buildpic=missingbp.jpg;
      }
Leman Russ corpse

Code: Select all

[IG_LRuss_dead]
	{
	world=All Worlds;
	description=destroyed Leman Russ;
	category=wrecks;
	object=IG_LRuss_dead;
	footprintx=3;
	footprintz=3;
	height=15;
	blocking=1;
	hitdensity=100;
	metal=200;
	damage=10000;
	reclaimable=1;
	featurereclamate=smudge01;
	seqnamereclamate=tree1reclamate;
	}
Leman Russ death Explosion

Code: Select all

[Medium_Vehicle_Explosion]
{
	name=Tank Explosion;
	rendertype=4;
	ballistic=1;
	turret=1;
	range=480;
	reloadtime=1;
	weaponvelocity=250;
	areaofeffect=100;
	soundstart=;
	soundhit=Explosion7;
	shakemagnitude=.1;
	shakeduration=1;
impulsefactor=0;
impulseBoost=0;
craterMult=0;
craterBoost=0;


	[DAMAGE]
	{
		default=500;
	}
}
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I think it's the same bug I discovered in the Lolimod, happens when a unit dies while its projectiles are still in play if the projectiles use an S3O model. It has been fixed already BTW and only happens in some SVN versions.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Yeah, this was the teamcolour .s3o projectile bug you get with older dev versions. *gets the latest dev version*
Post Reply

Return to “Game Development”