Page 1 of 3

Error could not create cob

Posted: 27 Sep 2006, 03:55
by MrSpontaneous
The title is of this post is the most useless error message I have ever encountered. Now my code probably sucks, but I am still inexpiernced with Bos/Cob. In any case, if some one could tell me what is causing this excessively descriptive error, I would greatly appriciate it.

Thanks

Here is the code:

Code: Select all

#define TA			// This is a TA script

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

piece  base, arm1, arm2, arm3, arm4, point1, point2, point3, point4;

static-var  nano_changer, zap_changer, is_building;


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

MotionControl(moving, aiming, justmoved)
{
}

Create()
{
	nano_changer = 0;
	zap_changer = 0;
	is_building = 0;
	start-script SmokeUnit();
}

SetMaxReloadTime()
{
}

StartMoving()
{
}

StopMoving()
{
}

WhenBuilding()
{
  While(is_building == 1)
  {
  sleep 10;
  }
}

SweetSpot(piecenum)
{
	piecenum = base;
}

RestoreAfterDelay()
{
}

AimFromPrimary(piecenum)
{
	piecenum = base;
}

QueryPrimary(piecenum)
{
    start-script WhenBuilding();

    if(zap_changer == 0)
    {
	piecenum = point1;
	}
    if(zap_changer == 1)
    {
	piecenum = point2;
	}	
	if(zap_changer == 2)
    {
	piecenum = point3;
	}
	if(zap_changer == 3)
    {
	piecenum = point4;
	}
	
	zap_changer = zap_changer + 1;
	
	if(zap_changer == 4)
	{
	  zap_changer = 0;
    }
	
	
}

AimPrimary(heading, pitch)
{
	signal 4;
	set-signal-mask 4;
	turn base to y-axis heading speed <1.>;
	turn base to x-axis pitch speed <1.>;
	return (1);
}

FirePrimary()
{
}

QueryNanoPiece(piecenum)
{
	if( nano_changer == 0 )
	{
		piecenum = point1;
	}
	if( nano_changer == 1 )
	{
		piecenum = point2;
	}
	if( nano_changer == 2 )
	{
		piecenum = point3;
	}
	if( nano_changer == 3 )
	{
		piecenum = point4;
	}
	nano_changer = nano_changer + 1;
	
	if(nano_changer == 4)
	  {
	  nano_changer = 0;
	  }
	
}

StartBuilding(heading, pitch)
{
    is_building = 1;
	turn base to y-axis heading speed <200>;
	turn base to X-axis pitch speed <200>;
	wait-for-turn base around y-axis;
	set INBUILDSTANCE to 1;
}

StopBuilding()
{
	set INBUILDSTANCE to 0;
    turn base to y-axis <0> speed <200>;
    turn base to X-axis <0> speed <200>;
    is_building = 0;

	signal 8;
	set-signal-mask 8;
}

Killed(severity, corpsetype)
{
	if( severity <= 25 )
	{
		corpsetype = 1;
		explode base type BITMAPONLY | BITMAP1;
		explode arm1 type SHATTER;
		explode arm3 type SHATTER;
		explode arm4 type SHATTER;
		explode arm2 type SHATTER;
		return (0);
	}
	if( severity <= 50 )
	{
		corpsetype = 2;
		explode base type BITMAPONLY | BITMAP1;
		explode arm1 type SHATTER;
		explode arm3 type SHATTER;
		explode arm4 type SHATTER;
		explode arm2 type SHATTER;
		return (0);
	}
	if( severity <= 99 )
	{
		corpsetype = 3;
		explode base type BITMAPONLY | BITMAP1;
		explode arm1 type SHATTER;
		explode arm3 type SHATTER;
		explode arm4 type SHATTER;
		explode arm2 type SHATTER;
		return (0);
	}
	corpsetype = 3;
	explode base type BITMAPONLY | BITMAP1;
}

Posted: 27 Sep 2006, 04:06
by rattle
The entire error message please. Restart Scriptor and try again. Still happenening?

Posted: 27 Sep 2006, 04:14
by MrSpontaneous
Here is the entire error message. . .

Compiling Bos...
Compiling sfxtype.h
Compiling exptype.h

Making Cob...
Error (209): Could not create cob [ C:\Documents and Settings\DoomOfAges\My Documents\Ideas\mod idea\Nightmare\Scripts\AgoSeed.bos ]

One or more errors occured while compiling the script.

yes, the error persists after restarting scriptor

209 is the last line of the script (last line with code any way :roll: )

Posted: 27 Sep 2006, 04:45
by rattle
No idea if NTFS could fuck this up but try it on a non NTFS partition...

Posted: 27 Sep 2006, 04:56
by MrSpontaneous
NTFS? I have succesfully compiled other units before, so I don't see why this one would suffer from some sort of opperating system problem.

Posted: 27 Sep 2006, 05:09
by rattle
Try putting Create() at the bottom. It's actually always a good idea to do that because it lacks prototypes...

Other than that, no idea. Couldn't see anything it should compile... still this looks like insufficient rights to create or write files in that directory.

Posted: 27 Sep 2006, 05:29
by MrSpontaneous
I don't know what permission I would be missing. . .Do you know which it would be (name etc.) and what it would be located under?

Posted: 27 Sep 2006, 05:39
by rattle
Eh no I don't use NTFS but for 2k itself (for a reason) nor WinXP (obvious)...

Try compiling a different script in the same directory to rule out if it's the filesystem. NTFS options can be found in that directory's attribute page... I'd rather not explain now how to find the user rights right now :P
Hum take a working script and reinsert functions from one to the other until you notice what's broken, although I doesn't look broken.

Anyway it's late, 5:35 am (again), gotta catch some Zzzs... :)

Posted: 27 Sep 2006, 05:44
by Caydr
Your best bet is probably as he said, remove sections until it works, then reinsert them til it doesn't.

Posted: 27 Sep 2006, 06:58
by MrSpontaneous
Looks like its the stupid file system. . .probably reset its self because I had to wipe my harddrive recently. . .

thanks

Edit: still cannot find were to set the permisions. . . :(

Posted: 27 Sep 2006, 08:23
by MrSpontaneous
help? I would rather not sift through all the buggerred windows permissions and administrative info just to compile my lousy unit :| .

Posted: 27 Sep 2006, 08:46
by Archangel of Death
Perhaps there is a bit of rogue data that slipped into the file, scriptor might not show it because it wouldn't know how to interpret it into characters, but it would still have to try to compile it. I think I've had that happen a couple times before.

Try just copy pasting it into a new file.

Posted: 27 Sep 2006, 09:06
by MrSpontaneous
nope, its not that . . .

Posted: 27 Sep 2006, 12:29
by Argh
Erm... almost always, an error like that indicates something that isn't closed properly.

Posted: 27 Sep 2006, 13:09
by rattle
You mean like there's a another "broken" instance of scriptor in the background which got the file rw+ opened?

Posted: 27 Sep 2006, 14:06
by KDR_11k
Compiles just fine here. Is your harddrive full?

Posted: 27 Sep 2006, 16:27
by Caydr
rattle wrote:You mean like there's a another "broken" instance of scriptor in the background which got the file rw+ opened?
Nah, he means a closing bracket might be missing. A "}". But KDR says he can compile fine so that must not be the case.

Posted: 27 Sep 2006, 18:13
by rattle
I suspected that as well but there wasn't anything missing...

Posted: 27 Sep 2006, 22:41
by MrSpontaneous
My hard drive has plenty of space, I think its what rattle said and for some reason I don't have permission to compile. . .as I tried another script and it would not compile either (that one was already finished, and compiled) and got the same error.

It being most likly that I am lacking the nessiceary permissions, does any one know which one I would be missing and were I can locate it?

Posted: 28 Sep 2006, 00:17
by PauloMorfeo
MrSpontaneous wrote:Looks like its the stupid file system. . .probably reset its self because I had to wipe my harddrive recently. . .

thanks

Edit: still cannot find were to set the permisions. . . :(
- Right click on a folder or file.
- Select "Properties"
- You should have a tab named "permissions" or something!? Post here which tabs it has. I'm not on a Win right now. Also, WinXP has a nasty tendency to change behaviour of things for ways more *newbie-firendly* which just end up beeing more confusing.

Anyway, try striping a script of everything but the essential and build it. If you can build that but not the one you've shown, it's not permission issues.