sciprt move piece is not following hierarchy

sciprt move piece is not following hierarchy

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

sciprt move piece is not following hierarchy

Post by bobthedinosaur »

I have a tank the is told to move barrel back for recoil and its moving the turret back.

The model and script add up piece wise (correct number and spelling) and the hierarchy is turret then under it barrel.

heres the bos

Code: Select all

#define TA			// This is a TA script

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

piece  base, body, turret, barrel, flare, track3, track2, track1;
static-var  bmoving, restore_delay, treadnum;


// Signal definitions
#define SIG_AIM				2
#define SIG_MOVE			4

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;
	}
}

gotracks()
{
while( TRUE ) 
   { 
        if(bMoving) 
           { 
              if(treadnum == 3) 
              {    
              show track3;         
              hide track2; 
              hide track1; 
              } 
            if(treadnum == 2) 
            { 
              show track2;         
              hide track3; 
              hide track1;
			}
            if(treadnum == 1) 
            { 
              show track1;         
              hide track2; 
              hide track3;
			}
            treadnum = treadnum - 1;
            if (treadnum == 0)
            	{ 
            	treadnum = 3;
            	}
         } 
      sleep 90; 
   } 
}

StartMoving()
{

	signal SIG_MOVE;
	set-signal-mask SIG_MOVE;
	bmoving = 1;
	start-script gotracks();
}

StopMoving()
{
	signal SIG_MOVE;
	bmoving = 0;
}


Create()
{
	hide track2;
	hide track1;
	hide flare;
	treadnum = 3;
	bmoving = 0;
	start-script SmokeUnit();
}

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

RestoreAfterDelay()
{
	sleep restore_delay;	
	set-signal-mask 0;
	turn turret to y-axis <0> speed <100.071429>;
	turn barrel to x-axis <0> speed <100.071429>;
}

AimPrimary(heading, pitch)
{
	signal SIG_AIM;
	set-signal-mask SIG_AIM;
	start-script restoreafterdelay();
	turn turret to y-axis heading speed <100.071429>;
	turn barrel to x-axis 0 - pitch speed <100.071429>;
	wait-for-turn barrel around x-axis;
	wait-for-turn turret around y-axis;
	return (1);
}

FirePrimary()
{
emit-sfx 1024 from flare;   //emit sfx

	move barrel to z-axis [-5.000000] speed [200.000000];  //recoil effect
	sleep 150;
	move barrel to z-axis [0.000000] speed [8.000000];   

}

AimFromPrimary(piecenum)
{
	piecenum = turret;
}

QueryPrimary(piecenum)
{
	piecenum = flare;
}

SweetSpot(piecenum)
{
	piecenum = base;
}

Killed(severity, corpsetype)
{
show track3;
hide track2;
hide track1;

	if( severity <= 99 )
	{
		corpsetype = 1;
		explode barrel type BITMAPONLY | BITMAP1;
		explode body type BITMAPONLY | BITMAP2;
		explode track3 type BITMAPONLY | BITMAP3;
		explode turret type BITMAPONLY | BITMAP5;
		return (0);
	}
	corpsetype = 3;
		explode barrel type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
		explode body type BITMAPONLY | BITMAP2;
		explode track3 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
		explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
		return (0);
}
Attachments
pawnheavy_i.zip
and the model
(11.71 KiB) Downloaded 9 times
LordMuffe
Posts: 286
Joined: 13 Mar 2005, 15:39

Re: sciprt move piece is not following hierarchy

Post by LordMuffe »

tried it with the model and your script without changing anything... moved the barrel not the turret.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: sciprt move piece is not following hierarchy

Post by bobthedinosaur »

thanks for the feed back muffe.

i guess it may be something effecting it mod wise?

edit:
also what spring version are you using?
LordMuffe
Posts: 286
Joined: 13 Mar 2005, 15:39

Re: sciprt move piece is not following hierarchy

Post by LordMuffe »

i was using 0.81.1.3 . Don┬┤t know about a way that other files in your mod could change the way the script animates the recoil-animation. Well, besides some LUA maybe ;)
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: sciprt move piece is not following hierarchy

Post by SeanHeron »

Ah shit - I must have not made it clear recently: I recently was under the impression that that unit is loading the lua animation file (even though that's been moved to a subfolder). Sorry I didn't convey that well enough (or fix it up myself) :( .

Thanks from me as well for testing, LordMuffe!

Edit: Durr - just checked the unitdef, and we're not referring to the animation (which has not only been moved, but also renamed). Why the hell would it still be loaded ? I'm commenting out the whole lua animation file bob, I reckon that should switch it off for sure...
Post Reply

Return to “Help & Bugs”