Page 1 of 1

Wings 3D/Upspring question

Posted: 08 Jul 2007, 02:26
by littleryanc
I have a quick question of wings 3D/Upsring . Thus far I have managed to read various tutorials to model my unit, partially texture it, and im working on the scripting my reading guides and tearing apart all sorts of units, :lol:
But I ran into a bump; i'm messing around with a turret that fires a large laser at planes, it includes a spinning turret to aim at the planes on the x/z axis while a arm extending from it aims with the y axis. The problem is the arms pivot point is weirdly off and i'm not quite sure how to force the arm to move only up and down pivoting on my imaginary point.

So in conclusion, I would like to know how to replace the pivot point, and force the arm to move the way i want it too.

Here is the neccasary section of the modified script i stole from a flakker, :?


#define TA // This is a TA script

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

piece flare1, base, Xturret, barrel1, firepoint, Yturret;

static-var Static_Var_1;

// Signal definitions
#define SIG_AIM 2


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 flare1;
dont-cache flare1;
dont-cache barrel1;
dont-cache Yturret;
dont-cache Xturret;
dont-shade flare1;
dont-shade barrel1;
dont-shade Yturret;
dont-shade Xturret;
Static_Var_1 = 0;
start-script SmokeUnit();
}

AimPrimary(heading, pitch)
{
signal SIG_AIM;
set-signal-mask SIG_AIM;
turn Xturret to y-axis heading speed <700.000000>;
turn Yturret to x-axis <0.000000> - pitch speed <550.000000>;
wait-for-turn Xturret around y-axis;
wait-for-turn Yturret around x-axis;
return (1);
}

FirePrimary()
{
show flare1;
sleep 150;
hide flare1;
}

QueryPrimary(piecenum)
{
piecenum = firepoint;
}

AimFromPrimary(piecenum)
{
piecenum = firepoint;
}

SweetSpot(piecenum)
{
piecenum = base;
}

Posted: 08 Jul 2007, 04:57
by Snipawolf
Might want to check your objects origins. The object rotates around that...

Posted: 08 Jul 2007, 05:43
by ironized
i love the "quick" bit XD

well i would help, but i have no clue at all

Posted: 08 Jul 2007, 08:33
by KDR_11k
Open Upspring, look around.