Page 43 of 59
Re: Mod Question Repository... Questions come in, answers go out
Posted: 16 Sep 2009, 05:48
by bobthedinosaur
2 questions:
1)
CobError: Unknown opcode 0 (in scripts/bluvr.cob:Killed at 210)
What is most likly causing this (btw there is no line 210 it ends before that)
2)
I have vlaunch missile that in the vertical stage its model doesnt show up but once it hits its apex the model becomes visible, anyone have a similar problem or know why this happening?
Re: Mod Question Repository... Questions come in, answers go out
Posted: 16 Sep 2009, 07:29
by yuritch
For the 1) - try to recompile the script. Sometimes Scriptor produces strange code (or maybe the cob just got damaged in some way). If the error persists, then post the bos here.
Re: Mod Question Repository... Questions come in, answers go out
Posted: 16 Sep 2009, 17:11
by bobthedinosaur
error:
CobError: Unknown opcode 0 (in scripts/bluvr.cob:Killed at 210)
Script:
Code: Select all
#define TA // This is a TA script
#include "sfxtype.h"
#include "exptype.h"
piece base, turret, fp1, w1, w2, w3, w4, wspare;
static-var mheading, restore_delay, regview, regspeed;
#ifndef MAX_SPEED
#define MAX_SPEED 75
#endif
#ifndef LOS_RADIUS
#define LOS_RADIUS 85
#endif
// 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;
}
}
turncheck()
{
while( TRUE )
{
mheading = get 82;
if( mheading < <-45> ) // 8910 = 45 degrees times the angular constant of 182, so you don't need the <>'s
{
mheading = <-45>;
turn w1 to y-axis <-30> speed <150.000000>;
turn w2 to y-axis <-30> speed <150.000000>;
}
if( mheading > <45> )
{
mheading = <45>;
turn w1 to y-axis <30> speed <150.000000>;
turn w2 to y-axis <30> speed <150.000000>;
}
if( mheading > <-45> AND mheading < <45> )
{
turn w1 to y-axis <0> speed <150.000000>;
turn w2 to y-axis <0> speed <150.000000>;
}
sleep 1000; //check every second
}
}
StartMoving()
{
signal SIG_MOVE;
set-signal-mask SIG_MOVE;
spin w1 around x-axis speed <400.159341> accelerate <160.00000>;
spin w2 around x-axis speed <400.159341> accelerate <160.00000>;
spin w3 around x-axis speed <400.159341> accelerate <160.00000>;
spin w4 around x-axis speed <400.159341> accelerate <160.00000>;
start-script turncheck();
}
StopMoving()
{
signal SIG_MOVE;
spin w1 around x-axis speed <0> accelerate <-140.00000>;
spin w2 around x-axis speed <0> accelerate <-140.00000>;
spin w3 around x-axis speed <0> accelerate <-140.00000>;
spin w4 around x-axis speed <0> accelerate <-140.00000>;
turn w1 to y-axis <0> speed <150.000000>;
turn w2 to y-axis <0> speed <150.000000>;
}
undeploy()
{
sleep 2000;
set MAX_SPEED to regspeed;
set LOS_RADIUS to regview;
}
deploy()
{
set MAX_SPEED to 1;
sleep 2000;
set LOS_RADIUS to (regview * 2);
}
Toggle(t,value)
{
if(t==1)
{
if(value==1)
{
call-script deploy();
}
if(value==0)
{
call-script undeploy();
}
}
}
Create()
{
regspeed = get MAX_SPEED;
regview = get LOS_RADIUS;
start-script SmokeUnit();
}
SetMaxReloadTime(Func_Var_1)
{
restore_delay = Func_Var_1 * 2;
}
RestoreAfterDelay()
{
sleep restore_delay;
set-signal-mask 0;
turn w1 to y-axis <0.000000> speed <100.000000>;
turn w2 to y-axis <0.000000> speed <100.000000>;
turn turret to y-axis <0> speed <100.071429>;
turn turret 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 turret to x-axis 0 - pitch speed <100.071429>;
wait-for-turn turret around x-axis;
wait-for-turn turret around y-axis;
return (1);
}
FirePrimary()
{
}
AimFromPrimary(piecenum)
{
piecenum = turret;
}
QueryPrimary(piecenum)
{
piecenum = fp1;
}
SweetSpot(piecenum)
{
piecenum = base;
}
Killed(severity, corpsetype)
{
if( severity <= 99 )
{
corpsetype = 3;
explode w1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
explode base type BITMAPONLY | BITMAP2;
explode w2 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
return (0);
}
}
Re: Mod Question Repository... Questions come in, answers go out
Posted: 16 Sep 2009, 19:34
by KDR_11k
Add a return at the end of Killed or something?
Re: Mod Question Repository... Questions come in, answers go out
Posted: 17 Sep 2009, 07:02
by yuritch
Hmm, probably yes. Make the Killed() function be like this:
Code: Select all
Killed(severity, corpsetype)
{
if( severity <= 99 )
{
corpsetype = 3;
explode w1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
explode base type BITMAPONLY | BITMAP2;
explode w2 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
}
return (0);
}
The return in moved out of if, so it's called even if severity>99.
Re: Mod Question Repository... Questions come in, answers go out
Posted: 17 Sep 2009, 16:51
by bobthedinosaur
yah, i got. now why are my vertical missiles invisible the 1st stage?
edit:
ooh even better, now they hover in invisible mode right above the pad, and then come out of no where side ways 10 feet above the ground and explode. this is fucking sweet.
I need to make more weapons like this.
Re: Mod Question Repository... Questions come in, answers go out
Posted: 17 Sep 2009, 17:10
by FLOZi
bobthedinosaur wrote:yah, i got. now why are my vertical missiles invisible the 1st stage?
edit:
ooh even better, now they hover in invisible mode right above the pad, and then come out of no where side ways 10 feet above the ground and explode. this is fucking sweet.
I need to make more weapons like this.
Missing starting velocity?
Re: Mod Question Repository... Questions come in, answers go out
Posted: 17 Sep 2009, 19:08
by bobthedinosaur
that helped the floating missiles, but i can not figure out the missing weapon model.
EDIT: if any one is experiencing this problem, its an engine bug and was fixed in version 80.4.2
Re: Mod Question Repository... Questions come in, answers go out
Posted: 01 Oct 2009, 22:10
by bobthedinosaur
is it possible to find the mass of a unit a transport is carrying?
Re: Mod Question Repository... Questions come in, answers go out
Posted: 02 Oct 2009, 11:00
by Erik
Whats wrong with my particles system? No matter what i do, it always only shows up as a yellow dot following my missile.
Can anyone help?
Code: Select all
[Trail1] {
useDefaultExplosions = 0;
[SMALLFLASH]
{
class=CSimpleParticleSystem;
[properties]
{
alwaysVisible=0;
Texture=smoke01;
sizeGrowth=1.2;
sizeMod=1.0;
pos = 0,0,0; //r-3 r3, 1.5, r-3 r3;
emitVector = 0, 0, 0;
gravity = 0, 0.05, 0;
colorMap = 0.6 0.6 0.6 0.03 0 0 0 0.0; //1.0 0.5 0.0 0.01 0.5 0.4 0.3 1.0
airdrag = 0.7;
particleLife=50;
particleLifeSpread=18;
numParticles=6;
particleSpeed=0.05;
particleSpeedSpread=0.01;
particleSize=2.4;
particleSizeSpread=0.6;
emitRot=90;
emitRotSpread=0;
directional=1;
useAirLos=0;
}
ground=1;
air=1;
count=1;
}
[Grey]
{
class=CSimpleParticleSystem;
[properties]
{
alwaysVisible=0;
Texture=smoke01;
sizeGrowth=1.2;
sizeMod=1.0;
pos = 0,0,0; //r-3 r3, 1.5, r-3 r3;
emitVector = 0, 0, 0;
gravity = 0, 0.05, 0;
colorMap = 0.6 0.6 0.6 0.2 0 0 0 0.0; //1.0 0.5 0.0 0.01 0.5 0.4 0.3 1.0
airdrag = 0.7;
particleLife=400;
particleLifeSpread=80;
numParticles=6;
particleSpeed=0.05;
particleSpeedSpread=0.01;
particleSize=2.4;
particleSizeSpread=0.6;
emitRot=90;
emitRotSpread=0;
directional=1;
useAirLos=0;
}
ground=1;
air=1;
count=1;
}
} //DEF-system
Re: Mod Question Repository... Questions come in, answers go out
Posted: 02 Oct 2009, 11:00
by Erik
Whats wrong with my particles system? No matter what i do, it always only shows up as a yellow dot following my missile.
Can anyone help?
Code: Select all
[Trail1] {
useDefaultExplosions = 0;
[SMALLFLASH]
{
class=CSimpleParticleSystem;
[properties]
{
alwaysVisible=0;
Texture=smoke01;
sizeGrowth=1.2;
sizeMod=1.0;
pos = 0,0,0; //r-3 r3, 1.5, r-3 r3;
emitVector = 0, 0, 0;
gravity = 0, 0.05, 0;
colorMap = 0.6 0.6 0.6 0.03 0 0 0 0.0; //1.0 0.5 0.0 0.01 0.5 0.4 0.3 1.0
airdrag = 0.7;
particleLife=50;
particleLifeSpread=18;
numParticles=6;
particleSpeed=0.05;
particleSpeedSpread=0.01;
particleSize=2.4;
particleSizeSpread=0.6;
emitRot=90;
emitRotSpread=0;
directional=1;
useAirLos=0;
}
ground=1;
air=1;
count=1;
}
[Grey]
{
class=CSimpleParticleSystem;
[properties]
{
alwaysVisible=0;
Texture=smoke01;
sizeGrowth=1.2;
sizeMod=1.0;
pos = 0,0,0; //r-3 r3, 1.5, r-3 r3;
emitVector = 0, 0, 0;
gravity = 0, 0.05, 0;
colorMap = 0.6 0.6 0.6 0.2 0 0 0 0.0; //1.0 0.5 0.0 0.01 0.5 0.4 0.3 1.0
airdrag = 0.7;
particleLife=400;
particleLifeSpread=80;
numParticles=6;
particleSpeed=0.05;
particleSpeedSpread=0.01;
particleSize=2.4;
particleSizeSpread=0.6;
emitRot=90;
emitRotSpread=0;
directional=1;
useAirLos=0;
}
ground=1;
air=1;
count=1;
}
} //DEF-system
Re: Mod Question Repository... Questions come in, answers go out
Posted: 02 Oct 2009, 15:28
by Argh
Use an AirDrag much closer to 1.0, and higher initial velocities- say, 0.5.
Re: Mod Question Repository... Questions come in, answers go out
Posted: 02 Oct 2009, 15:55
by KDR_11k
EmitVector should not be zero, all speeds are relative to the vector and a vector of size 0 means all velocities are 0.
Re: Mod Question Repository... Questions come in, answers go out
Posted: 02 Oct 2009, 17:04
by Erik
is that call right? Im just curious because no matter what i change i always get the same yellow dot D:
Re: Mod Question Repository... Questions come in, answers go out
Posted: 02 Oct 2009, 17:24
by smoth
ceg tag is used for missile trails. Is that what you are trying for?
Re: Mod Question Repository... Questions come in, answers go out
Posted: 02 Oct 2009, 17:48
by Erik
A missile trail. Well it isn't quite trail-ish, its just a yellow dot

Re: Mod Question Repository... Questions come in, answers go out
Posted: 13 Oct 2009, 19:46
by bobthedinosaur
I was wondering if any one has measured all the units of scale thrown around in the game, to see what they relate to each other? such as weapon range vs speed, vs map size, vs building XZ, vs upspring script scale, vs hitsphere size
one i noticed is shield weapon size and hit sphere are the same but other weapon ranges are kind of funky when compare to shield size.
Re: Mod Question Repository... Questions come in, answers go out
Posted: 14 Oct 2009, 02:28
by Saktoth
There is a page on the CA wiki with a lot of the conversion ratios for distances etc in Spring that zerg made up, dunno if it includes everything.
http://trac.caspring.org/wiki/UnitsOfMeasurement
CA site is being a spaz atm though so forgive it if it borks.
Re: Mod Question Repository... Questions come in, answers go out
Posted: 17 Oct 2009, 02:16
by PTSnoop
Are there any simple examples of the Lua unit scripting system? So far, all I've found is the
spring1944 GerTiger example, which is better than nothing but is still a bit complicated and intimidating, especially when I've not really done any Lua coding before.
What I could really do with is an example brick (no animation, just drives around), a brick with a rotating firing turret, an brick builder with a rotating building turret, and a building that can build other units. Basically 1, 3, 12, and 6 from
http://springrts.com/wiki/Animation-CobExamples .
Or if someone could point me to any mods around that actually use Lua instead of BOS/COB (I've not found any), that'd be great either.
Re: Mod Question Repository... Questions come in, answers go out
Posted: 17 Oct 2009, 02:30
by FLOZi
Here is the Arm stumpy script converted to lua:
http://pastebin.com/f7fc0a0dc
Which should equate to 3 on that list.
AFAIK there are no mods that use lua unit scripts yet, it was only released in the latest engine version afterall.