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 → Client Server Playrandomambiant
Client Server Playrandomambiant
2004-10-04, 11:46 PM #1
is there anyway I can make the "play random ambiant" play on all computers when playing.. not just the host?
||||||||||||||||||||
2004-10-05, 12:33 AM #2
Would it work if you just changed the local to a global? Like so.

Code:
# Jedi Knight Cog Script
# 00_RandomAmbient.cog
# Plays a random sound at random intervals with random volume and panning
#
#
# [SXC]
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved

symbols
	message		startup
	message		timer

	sound		wav0
	sound		wav1
	sound		wav2
	sound		wav3
	int		numsounds

	flex		min_interval
	flex		range_interval
	flex		min_volume
	flex		range_volume

	int		temp		local
end

code

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

startup:
	settimer(min_interval+(rand()*range_interval));
	return;

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

timer:
	temp = rand()*numsounds;
	playsoundglobal(wav0[temp], (min_volume+(rand()*range_volume)), ((rand()*2)-1.0), 0);
	settimer(min_interval+(rand()*range_interval));
	return;
end
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-10-05, 12:53 AM #3
Nah, that one don't work at all, even on the host computer.
||||||||||||||||||||
2004-10-05, 11:45 AM #4
600 years training in the fires of Shak rin, and i end up makeing... play ambient cogs... where did the elite vangaurd go?

Code:
# 	JK Cog Script
#
# 	PJ_RandomAmbient.cog
#
# 	Plays a random sound at random intervals with random volume and panning
#		-based on the JK 00_playrandomamient.cog
# [PJB]

symbols
	message		startup
	message		timer

	sound		wav0
	sound		wav1
	sound		wav2
	sound		wav3
	int		numsounds

	flex		min_interval
	flex		max_interval
	flex		min_volume
	flex		range_volume

	int		temp		local
end

code

startup:
	settimer(min_interval+(rand()*(max_interval-min_interval)));
	return;
timer:
	temp = rand()*numsounds;
	playsoundglobal(wav0[temp], min_volume+(rand()*range_volume), (rand()*2)-1.0, 0);
	settimer(min_interval+(rand()*(max_interval-min_interval)));
	return;
end

I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-10-06, 10:01 PM #5
Isnt that exactly what I did?
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-10-07, 6:18 AM #6
I'd probably create an array of ghost object "things" (dot them around your level) and an array of ambient sounds and then use either PlaySoundPos() or PlaySoundThing(), using the Rand() verb to select random sounds in random places...

At least that would be my take on things. You could also make the cog local (flags=0x240) to improve performance :)

Hope these ideas help :D

-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"
|| AI Builder: compatible with both JK & MotS || My website ||
2004-10-07, 10:43 AM #7
makeing that cog local would do no more than cause errors, unless you localised the sound but thats gonna decrese preformace.

As to A_persons cog, i really think you should rember the magic of PARSEC... it kinda... tells you when there is an error (as in this case, allthough im not shure what)

and jacpot, your idea dosent seem to be quite as efficiant as spirals for his project. but you wouldent know that.. so no biggie
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-10-09, 2:58 AM #8
Hey, if people don't elaborate on what they want... :p; I can only work with what info I'm given ;) :D

-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"
|| AI Builder: compatible with both JK & MotS || My website ||

↑ Up to the top!