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 plays the wrong WAV
cog plays the wrong WAV
2004-01-14, 8:51 AM #1
I have a COG that plays a WAV file, and for some reason it plays a different WAV than the WAV i specified when the line is executed. any idea what's causing the problem?

------------------
www.lastgreatwar.com
2004-01-14, 9:34 AM #2
Firstly you should probably post the cog here so people can examine it to see whats wrong. Maybe its a typo or something. It plays a different file than what you want? or plays nothing at all? Is it a custom wav?

------------------
nil nip nada zip zero naught lip zil
This is retarded, and I mean drooling at the mouth
2004-01-14, 10:05 AM #3
It plays the glass-break sound, doesnt it?


Post the cog.

------------------
The future is here, and all bets are off.
And when the moment is right, I'm gonna fly a kite.
2004-01-14, 11:14 AM #4
it happens with two cogs. one plays the glass break sound, the other plays a tusekn raider sound. one is a costom wav, the other uses beep1.wav from res1hi.gob (or whatever that file is called)

symbols
message activated
message arrived
message startup

thing elev

model newelev=newelev.3do
model oldelev=newelev1.3do

flex speed = 1.0

sound activate=set_hi2.wav
sound arrived=beep1.wav

end

code

startup:
SetThingModel(elev, oldelev);
return;

activated:

PlaySoundPos(activate, GetThingPos(elev), 1, -1, -1, 0);

if (GetCurFrame(elev) == 0)
{
SetThingModel(elev, newelev);
movetoframe(elev, 1, speed);
}
else if (GetCurFrame(elev) == 1)
{
SetThingModel(elev, newelev);
movetoframe(elev, 0, speed);
}

return;

arrived:

PlaySoundPos(arrived, GetThingPos(elev), 1, -1, -1, 0);
SetThingModel(elev, oldelev);

return;

end

------------------
www.lastgreatwar.com
2004-01-14, 3:59 PM #5
Just a suggestion, but SOMETIMES my cog's don't fuction properly unless I set things like key frame file names and wav file names via the JED cog placement window, as opposed to just declaring them in the source of the cog (as you have). Might try setting them in JED. it's worth a try.

------------------
One day, after everybody else quits, I'll be the best.
Sith Mercenaries
^My site.
One day, after everybody else quits, I'll be the best.
Sith Mercenaries
^My site.
2004-01-14, 5:47 PM #6
Bah. Repeat after me; NEVER EVER *EVER* LABEL VARIABLES THE SAME NAMES AS MESSAGES.


Or for that matter, no 2 names should be the same, be they variable, message, or whatever. That is likely your problem.

------------------
The future is here, and all bets are off.
And when the moment is right, I'm gonna fly a kite.
2004-01-14, 10:15 PM #7
GBK == truth teller [http://forums.massassi.net/html/smile.gif]

Standard coding/programming/scripting rules apply - with regard to naming variables, NEVER use the language's verbs or reserved keywords [http://forums.massassi.net/html/smile.gif] - you're just asking for something in your code to not work/compile... [http://forums.massassi.net/html/wink.gif]

SM_Sith_Lord: Chances are that you've done something similar, as you can literally hard-code everything that appears in JED's COG placement/parameter list into a cog script (assuming you know all the variables/values you're going to be using). I've found that this is one of COG's more useful traits, what with the ability to declare variables as "local" and not be able to edit them, juxtaposed with omitting the "local" keyword and being able to input your own values for variables... [http://forums.massassi.net/html/smile.gif]

Could be just me though [http://forums.massassi.net/html/wink.gif] Hope this has helped [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
"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" - 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 ||
2004-01-15, 9:57 AM #8
huh...you know, i didn't even see that i used "arrived" as a variable name until you pointed it out. i usually don't use the "arrived" symbol so it didn't occur to me it was a reserved word until i checked it over just now. thanks for the help anyway, and hopefully it works

------------------
www.lastgreatwar.com
2004-01-15, 2:59 PM #9
Download Parsec.
It would have picked that error up in a heartbeat.

------------------
I am Darth Slaw.
The Dark Lord of the Sith,
And part of the Nightfire mod team
May the mass times acceleration be with you.
2004-01-15, 10:12 PM #10
Darth Slaw speaks the truth [http://forums.massassi.net/html/smile.gif] - Parsec is absolutely invaluable for code debugging - especially when you find out that all that was wrong with a cog script was that you forget a ";" [http://forums.massassi.net/html/rolleyes.gif] [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
"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" - 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!