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 → Need help on this cog!
Need help on this cog!
2001-07-09, 12:21 AM #1
Hi, I need help on this cog, I need it to play a song from a designated thing, then, when the thing is damaged, play a different song, this is what I have:

Code:
# Jedi Knight Cog Script
#
# 00_CANTINASONG.COG
#
# Plays the cantina song from a location
# Made for the Dark Order's Training Base level
#
# [DingusFett]
#
# (c) 2001 DingusFett's Productions

symbols


message     startup                    
message     damaged                    
sound     song                    
sound     broken
thing     speakers                    
flex     volume                    
flex     mindist=0                    
flex     maxdist                    

end

# ========================================================================================
code
startup:

PlaySoundThing(song, speakers, volume, mindist, maxdist, 0x1);


damaged:

PlaySoundThing(broken, speakers, volume, mindist, maxdist, 0x1);

# ........................................................................................

end


So far, it just plays both songs at the same time [http://forums.massassi.net/html/frown.gif] can somebody please help me fix this, this is for my current level, in production. I also need it so that once the thing(speakers) is damaged, it creates sparks coming from the speakers.

Thanks in advance, Dingus Fett.
Dont ask me how it works, it just does.
2001-07-09, 4:05 AM #2
k, I'm no expert, but I it's obviously running both messages at the same time. The reason for this as far as I can tell is that you haven't established a health amount for the thing. You then have to have the damaged message check the things health, and not run if it's at full. I am pretty much a newbie, so you might wanna wait for a second opinion. [http://forums.massassi.net/html/smile.gif]
Cynic (sin'ik) n. One of a sect of ancient Greek philosophers who held that virtue is the ultimate goal of life, their doctrine gradually coming to symbolize insolent self-righteousness.

Drink So-Be, and play longer!
2001-07-09, 4:30 AM #3
I think it's because you forgot to return. =)

e.g.
Code:
startup:
PlaySoundThing(song, speakers, volume, mindist, maxdist, 0x1);
return;
damaged:
PlaySoundThing(broken, speakers, volume, mindist, maxdist, 0x1);
return;


Also, in startup:, you may want to add CaptureThing(speakers);

------------------
LordVirus: His pot is blacker than his kettle!

Visit Virus Productions!

[This message has been edited by LordVirus (edited July 09, 2001).]
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2001-07-09, 11:18 AM #4
I don't think capture thing will be nessery Lord Virus.
2001-07-09, 5:19 PM #5
Thanks, but now all it does is play the first sound, when it is damaged, nothing changes. Please help.

------------------
Forget years of training and commitment!
I found a lightsaber in a garage and that makes me a Jedi!
- DCM JK Special Edition
Dont ask me how it works, it just does.
2001-07-14, 1:10 AM #6
Anybody?!
Dont ask me how it works, it just does.
2001-07-14, 5:02 AM #7
Normally thing declared in the symbol to be assigned in level editors only recieves minimum messages (not including damaged).

In order to recieve damaged messages you need to mask it in the symbols like this.

thing speakers mask=0xfff

This way it should return damaged message when it gets damaged.

------------------
http://millennium.massassi.net/ - Millennium
2001-07-15, 5:55 PM #8
Still doesn't work [http://forums.massassi.net/html/frown.gif]
Dont ask me how it works, it just does.
2001-07-15, 7:23 PM #9
How's the cog now?

------------------
http://millennium.massassi.net/ - Millennium
2001-07-15, 8:09 PM #10
It *might* help to stop the old sound in the damaged section before starting the new one.

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

Tazz
2001-07-18, 12:41 AM #11
Yes, that may help, but everytime I use the StopSound line, it does nothing! Can somebody help me plz
Dont ask me how it works, it just does.
2001-07-22, 6:55 PM #12
Anyone?!
Dont ask me how it works, it just does.
2001-07-24, 2:51 PM #13
Anybody?!?!
Dont ask me how it works, it just does.

↑ Up to the top!