

Moderator: Moderators
I started from scratch. wrote and rewrote my scripts ad nausium because I hate copy pasted code. The only copy pasted was shit that I thought I had to have... like the stupid restoretime functions.Pxtl wrote:Egarwaen wrote:Yes, so the engine is free. The problem is that nearly every script in every mod is a modified copy/paste of a TA script, or a descent thereof. The only one I'm not sure about is Xect Vs. Mynn, which was made specifically to be Cavedogless (since the developer originally sold the Mynn as a retail product).
Code: Select all
// rx-79 ground-type(machinegun)
piece GP,head,base,left,right,l_arm,l_forearm,r_arm,r_forearm,gun,flare,
sheild,cod,right_l,left_l,flank,hip_l,hip_r,backunit,
shin_l,shin_r,foot_r,foot_l,ankle_l,ankle_r;
// State variables
//static-var ;
static-var restore_delay, bMoving, bAiming, bCanAim,shooting_num;
// Signal definitions
#define SIG_AIM 2
#define SIG_MOVE 16
#define ANIM_VARIABLE bMoving
#include "\79gm\2_4_walk.bos"
#undef ANIM_VARIABLE
#include "exptype.h"
#include "StateChg.h"
/*------------------------------------------------------
/ Sheild loss smoke unit funct
/-----------------------------------------------------*/
static-var HASSHIELD;
HASSHIELD = TRUE;
SmokeUnit(healthpercent, sleeptime, smoketype)
{
while( get BUILD_PERCENT_LEFT )
{ sleep 400; }
while( TRUE )
{
healthpercent = get HEALTH;
if( healthpercent < 66 )
{
smoketype = 256 | 2;
if( healthpercent > Rand( 1, 66 ) )
{ smoketype = 256 | 1; }
emit-sfx smoketype from base;
if(HASSHIELD)
{
HASSHIELD = FALSE;
hide sheild;
explode sheild type FALL | BITMAP1;
}
}
if( healthpercent == 100 )
{
show sheild;
HASSHIELD = TRUE;
}
sleeptime = healthpercent * 50;
if( sleeptime < 200 )
{ sleeptime = 200; }
sleep sleeptime;
}
}
/*------------------------------------------------------
/ motion function copied from the core commander
/-----------------------------------------------------*/
StartMoving()
{ bMoving = TRUE; }
StopMoving()
{ bMoving = FALSE; }
MotionControl(pheh)
{
pheh = 1;
/*spring has an issue with THIS block of code.*/
while (pheh)
{
//ugly workaround to peculiar bug in spring
sleep 120;
IF (bmoving)
{
IF (baiming == TRUE)
{
bCanAim = TRUE;
CALL-SCRIPT shootwalk();
}
IF (!baiming)
{
bCanAim = FALSE;
CALL-SCRIPT walk();
}
}
IF (!bmoving)
{
bCanAim = TRUE;
CALL-SCRIPT stopwalk();
}
}
}
//------------------------------------------------------
//start ups :)
//------------------------------------------------------
Create()
{
// Initial State
bMoving = FALSE;
bAiming = FALSE;
bCanAim = TRUE;
shooting_num=1;
hide flare;
restore_delay=1000;
start-script MotionControl();
start-script SmokeUnit();
}
SweetSpot(piecenum)
{ piecenum=GP; }
AimFromPrimary(piecenum)
{ piecenum=head; }
QueryPrimary(piecenum)
{ piecenum=flare; }
//---------------------------------------------------------------------
//gun functions;
//---------------------------------------------------------------------
RestoreAfterDelay()
{
sleep restore_delay;
turn head to y-axis <0> speed <135>;
turn r_arm to x-axis <0> speed <130>;
turn left to x-axis <0> speed <250>;
turn l_forearm to x-axis <0> speed <150>;
turn l_forearm to z-axis <0> speed <150>;
turn sheild to x-axis <0> speed <250>;
bAiming = FALSE;
}
AimPrimary(heading,pitch)
{
signal SIG_AIM;
set-signal-mask SIG_AIM;
// Announce that we would like to aim, and wait until we can
bAiming = TRUE;
while (NOT bCanAim)
{
sleep 100;
}
if(!HASSHIELD)
{
turn head to y-axis heading speed <105>;
turn r_arm to x-axis (<-90>-pitch) speed <190>;
wait-for-turn head around y-axis;
wait-for-turn r_arm around x-axis;
}
else
{
turn head to y-axis heading speed <105>;
turn r_arm to x-axis (<-90>-pitch) speed <290>;
turn left to x-axis (<-90>-pitch) speed <250>;
turn l_forearm to z-axis <70> speed <190>;
turn l_forearm to x-axis <-35> speed <190>;
turn sheild to x-axis <90> speed <250>;
wait-for-turn head around y-axis;
wait-for-turn r_arm around x-axis;
wait-for-turn left around x-axis;
wait-for-turn l_forearm around z-axis;
wait-for-turn l_forearm around x-axis;
wait-for-turn sheild around x-axis;
}
start-script RestoreAfterDelay();
return(TRUE);
}
FirePrimary()
{
move right to z-axis [-1.5] now;
move left to z-axis [-1.0] now;
show flare;
sleep 120;
hide flare;
move right to z-axis [0] speed [3];
move left to z-axis [0] speed [3];
}
Killed( severity, corpsetype )
{
if (severity <= 25)
{
corpsetype = 1;
explode cod type BITMAPONLY | BITMAP2;
explode head type FALL | BITMAP5;
explode left type FALL | BITMAP5;
explode right type FALL | BITMAP5;
explode l_arm type FALL | BITMAP5;
explode l_forearm type FALL | BITMAP5;
explode r_arm type FALL | BITMAP5;
explode r_forearm type FALL | BITMAP5;
explode gun type FALL | BITMAP5;
return( 0 );
}
if (severity <= 50)
{
corpsetype = 2;
explode left type FALL | BITMAP5;
explode right type FALL | BITMAP5;
explode l_arm type FALL | BITMAP5;
explode l_forearm type FALL | BITMAP5;
explode r_arm type FALL | BITMAP5;
explode r_forearm type FALL | BITMAP5;
explode gun type FALL | BITMAP5;
explode cod type FALL | BITMAP2;
explode head type FALL | BITMAP5;
return( 0 );
}
if (severity <= 99)
{
corpsetype = 3;
explode left type FALL | BITMAP5;
explode right type FALL | BITMAP5;
explode l_arm type FALL | BITMAP5;
explode l_forearm type FALL | BITMAP5;
explode r_arm type FALL | BITMAP5;
explode r_forearm type FALL | BITMAP5;
explode gun type FALL | BITMAP5;
explode cod type BITMAPONLY | BITMAP2;
explode head type BITMAPONLY | BITMAP5;
return( 0 );
}
corpsetype = 3;
explode left type FALL | BITMAP5;
explode right type FALL | BITMAP5;
explode l_arm type FALL | BITMAP5;
explode l_forearm type FALL | BITMAP5;
explode r_arm type FALL | BITMAP5;
explode r_forearm type FALL | BITMAP5;
explode gun type FALL | BITMAP5;
explode cod type BITMAPONLY | BITMAP2;
explode head type FALL | BITMAP5;
return( 0 );
}
do you have any idea how ignorant that sounds?Felix the Cat wrote: Regardless, this is not a scripting language discussion, but a legal discussion. The legal reality is that if you copied it without permission, they can sue you, regardless of what you copied. The clean room/Chinese wall method is necessary to ensure that you are in the legal zone. Even if there's only one way to do something, you have to develop it independently in order for it to be legal.
Code: Select all
OpenYard()
{
set YARD_OPEN to 1;
while( !get YARD_OPEN )
{
set BUGGER_OFF to 1;
sleep 1500;
set YARD_OPEN to 1;
}
set BUGGER_OFF to 0;
}
CloseYard()
{
set YARD_OPEN to 0;
while( get YARD_OPEN )
{
set BUGGER_OFF to 1;
sleep 1500;
set YARD_OPEN to 0;
}
set BUGGER_OFF to 0;
}
Code: Select all
RequestState(requestedstate, currentstate)
{
if( statechg_StateChanging )
{
statechg_DesiredState = requestedstate;
return (FALSE);
}
statechg_StateChanging =TRUE;
currentstate = statechg_DesiredState;
statechg_DesiredState = requestedstate;
while( statechg_DesiredState != currentstate )
{
if( statechg_DesiredState ==FALSE )
{
call-script Go();
currentstate = FALSE;
}
if( statechg_DesiredState ==TRUE )
{
call-script Stop();
currentstate = TRUE;
}
}
statechg_StateChanging = FALSE;
}
It seems to me that there are Innumerable Post About This because it is both Difficult and Important.Min3mat wrote:CHRIST FFS STOP IT WE HAVE HAD INNUMERABLE POSTS ABOUT THIS.
This could be the case - I haven't looked at the ota scripts. I'll check it out this evening, and thanks for the heads up.smoth wrote:xect vs mynn...I looked at the xect comm and he has more stolen code then you want to admit. I have read the OTA scripts many times and I know what is pasted right from ota scripts.
Code: Select all
MotionControl(pheh)
{
pheh = 1;
/*spring has an issue with THIS block of code.*/
while (pheh)
{
//ugly workaround to peculiar bug in spring
sleep 120;
IF (bmoving)
{
IF (baiming == TRUE)
{
bCanAim = TRUE;
CALL-SCRIPT shootwalk();
}
else
{
bCanAim = FALSE;
CALL-SCRIPT walk();
}
}
else
{
bCanAim = TRUE;
CALL-SCRIPT stopwalk();
}
}
}
Code: Select all
MotionControl(Func_Var_1)
{
Func_Var_1 = 1;
while( Func_Var_1 )
{
sleep 120;
if( Static_Var_2 )
{
if( Static_Var_3 == 1 )
{
Static_Var_4 = 1;
call-script shootwalk();
}
else
{
Static_Var_4 = 0;
call-script walk();
}
}
else
{
Static_Var_4 = 1;
call-script stopwalk();
}
}
return (0);
}
I've reviewed the source files, and I don't find them troubling. Obviously, all the animation code is completely different. Braces are handled differently throughout, and function names are different.smoth wrote: Fang could have not included his .bos file but then noone could learn from it. I'd almost bet that if the origonal created of xect gave you guys his real code it would be mostly borrowed. That is why this area is sooo exaspertating. There has to be a way to get a clear go ahead on this understanding.
If your argument was true, the only legal workaround would be a new scripting language.smoth wrote:do you have any idea how ignorant that sounds?Felix the Cat wrote: Regardless, this is not a scripting language discussion, but a legal discussion. The legal reality is that if you copied it without permission, they can sue you, regardless of what you copied. The clean room/Chinese wall method is necessary to ensure that you are in the legal zone. Even if there's only one way to do something, you have to develop it independently in order for it to be legal.
The code discussion is important especially because the TA scripting language requires certain hooks in it. You go and figure them out without knowing them...
See it would be easy if there was just sending signals like with fire scripts etc, that is fine. However, factories are weird like that. Learn scripting for ta/spring and come back repeating those words.
You want us to effectively make api calls by writing our own from scratch without examples... let's just get more ludicrous and write it all in hex. Maybe I should spend months of my time learning the structure of a cob and just write it in hex.
simply put.... there is no getting around it. THERE is NO CLEAN ROOM method for ta scripting because it doesn't make sense we have some hacked together scriptor program that uses pseudo C... peh.
err, thanks, but I wouldn't know what to do with them.smoth wrote:interesting. I have already re-written many parts of the code from scratch. If you want once I get the code re-writes done I will give them to you.