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 → Spawnsound.cog
Spawnsound.cog
2005-04-05, 5:22 PM #1
Hi all!

I downloaded this cog from massassi, but it doesnt work for multiplayer. Players hear the sound, but only when they respawn themselves, not if another player spawns.

I'm sure this can be fixed! I tried adding the 'flags=0x240' line, but that didn't solve it.

Code:
# Jedi Knight Cog Script
#
# Spawnsound.COG
#
# Plays a sound when player (re)spawns
# 
#
# 10/6/2000 (c) Sven Solo

symbols

message     newplayer

sound       wav=

int         dummy     local

end

# ========================================================================================

code       
   newplayer:
       Dummy=PlaySoundLocal(wav, 1.0, 0, 0);           
       
   return;

end



Would someone be so nice to implement it for me? :)
ORJ / My Level: ORJ Temple Tournament I
2005-04-05, 5:36 PM #2
The newplayer: message is local only, meaning when another player respawns your COGs don't receive a newplayer: message. One way you could solve the problem is to fire off a trigger when you respawn that tells the other players to play a respawn sound on their computer.

QM
2005-04-05, 6:49 PM #3
Hmmmm, I didn't know that. Is that difficult to do?
ORJ / My Level: ORJ Temple Tournament I
2005-04-05, 7:47 PM #4
Or just edit the line that plays the sound in kyle.cog?
-Hell Raiser
2005-04-06, 3:29 PM #5
Kyle.cog? Never heard of that, I hardly know anything about Cog. I'm more of a mapper myself.

The trigger idea sounded good! I can't really write my own cog... I can modify really really basic things only....
ORJ / My Level: ORJ Temple Tournament I
2005-04-06, 4:50 PM #6
Try this and see what happens. I'm assuming newplayer is called whenever A player respawns, not just the local player. Otherwise this might have to be 2 cogs.
Code:
# Jedi Knight Cog Script
#
# Spawnsound.COG
#
# Plays a sound when player (re)spawns
# 
#
# 10/6/2000 (c) Sven Solo

flags=0x240

symbols

message		newplayer
message		trigger

sound		wav

end

# ==================================================

code       
newplayer:
	SendTrigger(-1, id, 0, 0, 0, 0);

return;
trigger:
	if(GetSourceRef() == id) PlaySoundLocal(wav, 1.0, 0.0, 0x0);

return;

end
May the mass times acceleration be with you.
2005-04-06, 5:32 PM #7
:D Wow, thanks, Slaw!

I'm going to test this! It looks like it'll work, hehe.

Your name will be all over the cog credits in my level, lol. You help me out so often!

This level is near completion and will be submitted as soon as I get the AI synced. (A Remote, G-Man is helping me out with it - we have it synced now but it keeps respawning, arg lol. G-Man is in my clan now, by the way :) )

This spawnsound.cog is for my second temple preview... it has this randomambient bell sound ... someone suggested to let it play the bell sound when a player joins the game...instead of just at random intervals.. so here I am, lol.

ok, I'll be back with the test results. ;)
ORJ / My Level: ORJ Temple Tournament I
2005-04-07, 1:58 PM #8
[Li'l Ani] "IT'S WORKING! IT'S WORKING!!!!!" [/Li'l Ani]

:D :D :D

Slaw is da man!!!!

*does the happy dance*

Awesome! my level now plays a temple bell everytime someone joins! And... everybody hears the sound!

Thanks a lot!
ORJ / My Level: ORJ Temple Tournament I
2005-04-07, 2:20 PM #9
w00t!

And when I posted that I thought it probably wouldn't work...!

*dances* <--- (oh now if only I could... prom is going to be interesting :p)
May the mass times acceleration be with you.

↑ Up to the top!