Unit problem

Unit problem

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
.MJJNL.
Posts: 105
Joined: 18 Apr 2006, 18:14

Unit problem

Post by .MJJNL. »

well we are working on TLS maby you have seen the old tread but now we have a whole new idea its now getting a TC with whole new units commanders and other stuff well we starting the work.... ok we maked a ALIEN WEAPON for the alien race well ive scripted it and now when its aiming it does left in place of right and so on... well heres the script

Code: Select all

define TA			// This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece  base, flare, turret, sleeve;

// Signal definitions
#define SIG_AIM				1


SmokeUnit(healthpercent, sleeptime, smoketype)
{
	while( get BUILD_PERCENT_LEFT )
	{
		sleep 400;
	}
	while( TRUE )
	{
		healthpercent = get HEALTH;
		if( healthpercent < 66 )
		{
			smoketype = 256 | 2;
			if( Rand( 1, 66 ) < healthpercent )
			{
				smoketype = 256 | 1;
			}
			emit-sfx smoketype from base;
		}
		sleeptime = healthpercent * 50;
		if( sleeptime < 200 )
		{
			sleeptime = 200;
		}
		sleep sleeptime;
	}
}

Create()
{
	hide flare;
	dont-cache flare;
	dont-cache sleeve;
	dont-cache turret;
	start-script SmokeUnit();
}

AimPrimary(heading, pitch)
{
	signal SIG_AIM;
	set-signal-mask 0;
	set-signal-mask SIG_AIM;
	turn sleeve to y-axis heading speed <5.000000>;
	wait-for-turn sleeve around y-axis;
	return (1);
}

FirePrimary()
{
	show flare;
	sleep 250;
	hide flare;
}

QueryPrimary(piecenum)
{
	piecenum = flare;
}

AimFromPrimary(piecenum)
{
	piecenum = sleeve;
}

SweetSpot(piecenum)
{
	piecenum = base;
}

Killed(severity, corpsetype)
{
	hide flare;
	if( severity <= 25 )
	{
		corpsetype = 1;
		explode base type BITMAPONLY | BITMAP1;
		explode turret type BITMAPONLY | BITMAP2;
		explode sleeve type BITMAPONLY | BITMAP4;
		return (0);
	}
	if( severity <= 50 )
	{
		corpsetype = 2;
		explode base type BITMAPONLY | BITMAP1;
		explode turret type FALL | BITMAP2;
		explode sleeve type SHATTER | BITMAP4;
		return (0);
	}
	if( severity <= 99 )
	{
		corpsetype = 3;
		explode base type BITMAPONLY | BITMAP1;
		explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
		explode sleeve type SHATTER | BITMAP4;
		return (0);
	}
	corpsetype = 3;
	explode base type BITMAPONLY | BITMAP1;
	explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
	explode sleeve type SHATTER | EXPLODE_ON_HIT | BITMAP4;
}
any bugs? or just a wrong script?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

The script looks fine. I have a feeling, though, that if we could see the model, we'd see mis-placed origins. Just my $0.2.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Remove that "set-signal-mask 0;". But I don't think it's the problem.
Post Reply

Return to “Game Development”