Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → COG (possibly) crashing game, need snappy respons
COG (possibly) crashing game, need snappy respons
2004-04-05, 5:40 AM #1
Hi!
Code:
#Level master COG
#Generated by JED 0.951 beta
# Edited by Edward

symbols
message   startup
message timer
message	entered
thing	cam
thing	pivot
thing	light
surface	land
surface	water
material	brick
sound		close
sound		open
sound		yikes
int       player    local
end

code

startup:
  // Register COG as master COG
  SetMasterCOG(GetSelfCOG());
  player = GetLocalPlayerThing();
  // Initialise Goals
  // Give player weapons and ammo
  SetInv(player, 1, 1);   // fists
  SetInv(player, 3, 1);   // ST Rifle
  SetInv(player, 4, 1);   // TD
  // Initialize weapon.
  SetFireWait(player, -1);
  SetMountWait(player, 0);
  SetCurInvWeapon(player, 0);
  SelectWeapon(player, AutoSelectWeapon(player, 1));
SetTimer(15);
SetActorFlags(player,0xA00000);		// Freeze player
	AttachThingToThing(cam,pivot);	// Attach cam to pivot so when pivot moves, cam will follow
	SetCameraFocus(0,cam);		// Make camera see through cam
	SetCurrentCamera(0);		// Make sure it is internal camera
	sleep(0.1);
	// PlaySoundThing(open,light,1,-1,10,0x80);	// Play opening sound
	SetThingLight(light,1,1);			// And add light.
	Rotate(pivot,'0 20 0');		// Make the pivot thing rotate at 20° per second on the yaw axis
	Rotate(cam,'10 20 0');		// Do the same with cam and add a little pitch so it looks down on the player.
	sleep(3.5);
	StopThing(pivot);		// Stop them after 3.5.
	StopThing(cam);			// That way we have turned the pivot 70°, and pitched down 15°


return;
timer:
  // Force ranking
  SetInv(player, 20, 0);
  SetInv(player, 14, 4*50);

jkSyncForcePowers();

  Return;
entered:
	if(GetSenderRef()!=land)	return;		// Entered isn't only for sectors, it also is used for when you land on a surface. Touch with you feet.
	// PlaySoundThing(yikes,player,1,-1,10,0x80);	// A little yikes from kyle.
	sleep(1);
	SetSurfaceMat(water,brick);			// Take away the water effect
	SetThingLight(light,0,0.25);			// Turn off lights
	PlaySoundThing(close,light,1,-1,10,0x80);	// Close portal sound
	sleep(1);
	ClearFaceType(water,0x2);			// Clear translucency
	SetCameraFocus(0,player);			// Return camera to player
	ClearActorFlags(player,0xA00000);		// Unfreeze player
return;
end

This COG was made for a Noob. He asked me to make some fancy stuff for him, and I sent him a copy of this before I tested it. Now, the problem is that, when I'm going to test the game, the loading freezes at 95%. It worked before I added the extra sound open and yikes. I tried to // the PlaySounds out, but that didn't work. Do I have all objects? Lets see:

cam=65, exists
pivot=66, exists
light=67, exists
land=19 0, exists
water=19 12, exists
brick=brick.mat, exists
close=forcepull01.wav, exists
open=forcespeed01.wav, exists
yikes=i00ky105.wav, exists

All is there, what's wrong?

/Edward
Edward's Cognative Hazards
2004-04-06, 8:15 AM #2
i00ky105.wav is in the ui folder, I believe, and although it shows up in JED, it doesn't actually exist when you try to reference it ingame. Try extracting that file from wherever it is and putting it into your /sound directory in your GOB.

------------------
Rites of Xanthus

The TC that exacted a terrible toll on my time and eyesight.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-04-06, 11:46 AM #3
i00ky105.wav does exist in the voice folder in Res1.gob, high and low. I have used this before. Check out my Empire's Revenge 2 and you'll find at the end, I've used it. Not end level, but the one before the last. Used, works, no problems... Has this ever accured before? What could cause a freeze of the game at 95% loading?

/Edward
Edward's Cognative Hazards
2004-04-06, 12:34 PM #4
I'm pretty sure Rotate() is not a verb. RotateThing() is though I think

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2004-04-06, 9:02 PM #5
Rotate did work before I applied the yikes and open sounds.
Edward's Cognative Hazards
2004-04-07, 9:50 AM #6
Rotate(thing, rot_vel);
RotatePivot(thing, frame, time);

RotateThing() is not a verb (or it just isn't in the DM).

I say try commenting out the Rotate() and the other new lines that are supposedly causing trouble, and seeing if JK works then. Then add the new code in one by one to see which one is the problem.

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.
May the mass times acceleration be with you.
2004-04-07, 10:02 AM #7
Yikes, you're both right. I'm really rusty.

The only thing I'd add to Slaw's comment it to put some debug Print() lines in your code, so that as you comment/uncomment things, and it's working in game, you'll know what's working and what's not. In fact, I used to do that for just about every cog. I makes it so much easier.

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2004-04-07, 10:36 AM #8
OK, I did some tests. I commented out everything in the code section, still crashed. I took away the whole COG, it worked!
Now I've commented out the symbols too. Still crashes. I left symbols, end, code, startup:, return;, timer:, return;, entered:, return;, and end un-commented. I have this feeling that I'll have to re-write the whole thing from scratch...

/Edward
Edward's Cognative Hazards
2004-04-07, 11:04 AM #9
HA! Pinpointed it! The accessive use of comentary! The Tab + // + What does it do...

Well, I have one question about this... WHY!!!!????

/Edward
Edward's Cognative Hazards
2004-04-08, 10:27 AM #10
Are you saying you had too many comments?
0_0
If so... WHY indeed!

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.
May the mass times acceleration be with you.

↑ Up to the top!