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 won't work at all!
COG won't work at all!
2003-09-04, 6:55 AM #1
Hi!
WHY WON'T THIS SMEGGING COG WORK???
Code:
# Intro to SS2
#
# By Edward
symbols

message		startup
message		pulse

thing		look
thing		ship
thing		crates

thing		cam2

thing		cam3

thing		cam4
thing		crates3
thing		ship2

template	boom
template	shard
template	firy

sound		music
sound		quickly
sound		nevercatch
sound		woooow
sound		alright
sound		hyper
sound		panic
sound		break
sound		cantbreak
sound		weregonnacrash
sound		woooooo
sound		serious

sound		cratepass
sound		cratewacked

int	i	local
thing	a0	local
thing	a1	local
thing	a2	local
thing	a3	local
thing	a4	local
thing	a5	local
thing	a6	local
thing	a7	local

end
#
code
startup:
	SetActorFlags(GetLocalPlayerThing(),0xa00000);
	SetCurrentCamera(0);
	SetCameraFocus(0,look);
	sleep(1);
	PlaySoundLocal(music,1,0,0xC0);
	sleep(7);
	MoveToFrame(ship,1,1);
	sleep(24);
	PlaySoundThing(cratepass,look,1,-1,1,0xC0);
	MoveToFrame(crates,1,1);
	WaitForStop(crates);
	SetCameraFocus(0,cam2);
	sleep(1);
	PlaySoundLocal(quickly,1,0,0xC0);
	sleep(GetSoundLen(quickly));
	PlaySoundLocal(nevercatch,1,0,0xC0);
	sleep(GetSoundLen(nevercatch));
	PlaySoundLocal(woooow,1,0,0xC0);
	sleep(GetSoundLen(woooow)+1);
	SetCameraFocus(0,cam3);
	PlaySoundLocal(alright,1,0,0xC0);
	sleep(GetSoundLen(alright)-1);
	PlaySoundLocal(hyper,1,0,0xC0);
	for(i=0; i<256; i=i+1)
	{
		AddDynamicAdd(GetLocalPlayerThing(), i, i, i);
		sleep(0.01);
	}
	SetCameraFocus(0,cam4);
	PlaySoundThing(cratewacked,crates3,1,-1,100,0xC1);
	MoveToFrame(ship2,1,1);
	MoveToFrame(crates3,1,2);
	sleep(1);
	PlaySoundLocal(panic,1,0,0xC0);
	sleep(3);
	PlaySoundLocal(break,1,0,0xC0);
	sleep(GetSoundLen(break));
	PlaySoundLocal(cantbreak,1,0,0xC0);
	sleep(GetSoundLen(cantbreak));
	PlaySoundLocal(weregonnacrash,1,0,0xC0);
	sleep(1);
	PlaySoundLocal(woooooo,1,0,0xC0);
	WaitForStop(crates3);
	CreateThing(boom,crates3);
	SetPulse(0.01);
	for(i=0; i<8; i=i+1)
	{
		a0=CreateThing(shard,crates3);
		CaptureThing(a0);
		SetThingVel(a0,VectorSet((rand()*10)-5,(rand()*10)-5,(rand()*10)-5));
	}
	DestroyThing(crates3);
	MoveToFrame(ship,2,1);
	sleep(1);
	PlaySoundLocal(serious,1,0,0xC0);
	sleep(GetSoundLen(serious));
	JKEndLevel(1);
return;
pulse:
	for(i=0; i<8; i=i+1)
		CreateThing(firy,a0);
return;
end


/Edward
Edward's Cognative Hazards
2003-09-04, 11:38 AM #2
Tell us where your cog fails, and at least we'll have some place to start.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-09-04, 1:08 PM #3
Ditto SaberMaster's post.... [http://forums.massassi.net/html/redface.gif]

I also find that spaces in-between commas and certain brackets never goes amiss, as it's easier to read and asses other people's code - it's one thing to write a quick script for yourself, but if you want other people to understand it (or help you with it) then you've got to make it easy for them to read "in-between the lines", so to speak.... [http://forums.massassi.net/html/wink.gif]

Anyways - niggles aside [http://forums.massassi.net/html/wink.gif] - this is only a cursory scan as I'm going to bed now, but (and for some reason, I don't know why) your 2nd "for" loop just doesn't sit easy with me... And neither does the pulse message's a0 array reference, when you're using the same variable array name in your 2nd "for" loop....

I don't know - I could just be tired - I'll look at it again tomorrow evening... [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-09-04, 8:56 PM #4
Tell us where your cog fails
Oh, somewhere around... startup!

your 2nd "for" loop just doesn't sit easy with me...
I'll look into that, thanks...

Oh, and what this COG does? Well, music plays, a ship moves off into the distance, 24 seconds later, another ship follows it. New scene, there is a dialog, then a bright light of Hyper, and then they crash into the big ship, and that is where the shards come in. The shards are to fly in all kinds of directions, followed by fire. I'm using throwshrapnel as shards.

[This message has been edited by Edward (edited September 05, 2003).]
Edward's Cognative Hazards
2003-09-05, 4:54 PM #5
That still isn't enough info to pinpoint a problem. Put in some Print() statements - make sure startup is running and see if you can find where the code stops working. Is the player immobilized? Is the camera's focus reset? Do you hear any sounds?

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-09-06, 2:44 AM #6
There's also a command you can add to your testing bat file which logs every cogmessage that is run, look at jkspecs too look up the command.

------------------
Call me Vedder.
Author of: A Pirate's Tale (Mots SP)
APT homepage
----
<phantom> You're always going to be aloser if you attempt to aspire to massassi standards.
<phantom> They're a bunch of socially inadequate <beep> whores who have little or no lives.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2003-09-06, 11:02 AM #7
Well, sorry for lack of info... I'll tell you exactly what's happening... It is like if I never implemented the COG.
I've tried the print just after startup: and it didn't print... Humph...

/Edward
Edward's Cognative Hazards
2003-09-06, 5:19 PM #8
Quote:
<font face="Verdana, Arial" size="2">'ve tried the print just after startup: and it didn't print... Humph...</font>


You realize that you must have a sleep of about two seconds after startup so that you'll be able to see anything that prints?

Quote:
<font face="Verdana, Arial" size="2">There's also a command you can add to your testing bat file which logs every cogmessage that is run, look at jkspecs too look up the command.</font>


Where is this in the JKSpecs?

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited September 06, 2003).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-09-07, 1:05 AM #9
Where is this in the JKSpecs?
Under MotS... And I'm editing JK! And I'll put the print after the first second... Doubt it will work since the COG ain't working...

[edit]Just tried the print statement... Nothing[/edit]

[This message has been edited by Edward (edited September 07, 2003).]
Edward's Cognative Hazards
2003-09-07, 6:25 AM #10

Hi there [http://forums.massassi.net/html/smile.gif]

Ok - this may not be the answer you were looking for, but it's a tried, tested and proven way of debugging code: block/comment out all your code and then unblock it, line by line, from start to finish (obviously, it goes without saying that you should leave the "return;" statement in, in the code section... [http://forums.massassi.net/html/wink.gif] )

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-09-08, 4:54 AM #11
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Edward:
Under MotS...</font>


Sorry didn't know that it was mots-only.



------------------
Call me Vedder.
Author of: A Pirate's Tale (Mots SP)
APT homepage
----
<phantom> You're always going to be aloser if you attempt to aspire to massassi standards.
<phantom> They're a bunch of socially inadequate <beep> whores who have little or no lives.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2003-09-08, 8:31 AM #12
Did you run it through parsec?

------------------
"The Just shall live by faith." - Galatians 3:11
To edit is human... To COG is divine!!

[Anoying posts] + 1.
Catloaf, meet mouseloaf.
My music
2003-09-08, 8:51 AM #13
Quote:
<font face="Verdana, Arial" size="2">Originally posted by DogSRoOL:
Did you run it through parsec?

</font>


Did you? Acording to Parsec it says: "Pars of intro.cog done. Time Blah,balh,blah seconds."
In other words, no errors.
I'm trying the Block-out-all-and-release-one-by-one...

/Edward

TIME$=20:51 (Swedish Standard Time)
Gotten to moving the first ship. Seems OK.

TIME$=21:00
Gotten to next camera, and spedd up the crates. All is well.

TIME$=21:20, I think...
I've pinpointed the error. When I make PlaySoundLocal(break,1,0,0xC0); be available, COG won't work. I haven't tried after that yet, but I will... Once I've fixed the speed with the Crate and Ship.

[This message has been edited by Edward (edited September 08, 2003).]
Edward's Cognative Hazards
2003-09-08, 9:37 AM #14
Hm... I think I know the problem... Is break the same as sleep?
Please wait... Changeing... break = breakbreakbreak

WWWWWWWOOOOOOOOOOORRRRRRRRRKKKKKSSSSSSSSS!!!!!

SaberMaster! Update your Parsec!

/Edward
Edward's Cognative Hazards
2003-09-08, 11:28 AM #15
Just a thought - I know that "break" is a reserved word in Java for breaking out of loops (you'd never have guessed, would you [http://forums.massassi.net/html/wink.gif] ) ... but is it the same in COG ??

Hmmm ... think I'll go and have a scout through DataMaster and some old LEC cogs.... maybe we've pin-pointed what the problem is - you were using a language reserved word (maybe ??)...

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-09-08, 1:35 PM #16
Quote:
<font face="Verdana, Arial" size="2">SaberMaster! Update your Parsec!</font>

Now, now, let's not be hasty...

AFAIK, break is used only in MotS - and it works the same as in Java. I'll do some testing, and see what I can find about its use in JK.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-09-08, 1:47 PM #17
Okay, break does not work in JK, but it is a reserved word and so you can't use it your code.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-09-09, 7:29 AM #18

Well there's an update note for the DataMaster [http://forums.massassi.net/html/biggrin.gif] ... interesting what you find out when you do some digging (and name your variables rather innocently... [http://forums.massassi.net/html/wink.gif] lol )

And I thought I'd seen it used in some MotS cogs, but couldn't recall seeing it in any JK ones (thought so, but I wasn't sure...)

To be honest, I'm surprised nobody had this documented/noticed before - just goes to show that you can be truly thorough with your documentation efforts and still miss one (trivial) little thing [http://forums.massassi.net/html/wink.gif]

Oh well - at least we've gotten to the bottom of this particular cog [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

Well ... you did ask for feedback for the DataMaster and Parsec, SaberMaster [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/biggrin.gif]

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||

↑ Up to the top!