Playable Piano tut? Need some help here..

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Sir_Ryan
Corporal
Posts: 28
Joined: Sat Jul 05, 2003 11:28 pm
Location: United States
Contact:

Playable Piano tut? Need some help here..

Post by Sir_Ryan »

Dudes, I'm looking desperately for a tutorial (or map) that teaches how to add a playable piano (like found in ml6a of MOHAA SP), but with absolutely no success. And I've searched the forums already. :wink:

I've also tried to use the MOHBSPtoMAP prog to decompile the ml6a, but I cannot get the speaker or the trigger to work right.

Please help..

:?
<><
Sir_Ryan
SirRyan.Pure-Fun.Com
[It's the Cheesiest]
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

well have a trigger_use targetname and setthread of my_piano and then have a scirpt_object targetname of my_piano_speaker and a key/value of model/ fx/dummy.tik.

then have in your script:

Code: Select all


my_piano:

$my_piano_speaker playsound moh_piano1

end
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

I made exactly this in the new version of "The Canal"

Code: Select all

open_piano_lid:
	while(true) {
		$piano waitTill trigger
		$piano nottriggerable
		$piano playsound moh_piano
		wait 8
		$piano triggerable
	}
end
And to get this called you add a trigger_use with targetname piano to your map and add theis line

Code: Select all

thread open_piano_lid
to the main method of your script.
Admin .MAP Forums
Image
Head above heels.
User avatar
Sir_Ryan
Corporal
Posts: 28
Joined: Sat Jul 05, 2003 11:28 pm
Location: United States
Contact:

Post by Sir_Ryan »

Ok, I've got the part that blue explained down and the piano works like it should, but I'd like to add the whole song to the trigger, as in m6la. You know, like every time the player activates the trigger, it plays a different tune? How do I do that? (I'm kinda new to scripting, so please put it in layman's terms :wink: )

Thanks.
<><
Sir_Ryan
SirRyan.Pure-Fun.Com
[It's the Cheesiest]
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Just add this above the piano code in my example:

Code: Select all

local.master = spawn ScriptMaster
	local.master aliascache moh_piano1 sound/mechanics/MOH_Piano1.wav soundparms 1.3 0.2 1.0 0.0 160 1600 item loaded maps "dm obj moh"
	local.master aliascache moh_piano2 sound/mechanics/MOH_Piano2.wav soundparms 1.3 0.2 1.0 0.0 160 1600 item loaded maps "dm obj moh"
	local.master aliascache moh_piano3 sound/mechanics/MOH_Piano3.wav soundparms 1.3 0.2 1.0 0.0 160 1600 item loaded maps "dm obj moh"
	local.master aliascache moh_piano4 sound/mechanics/MOH_Piano4.wav soundparms 1.3 0.2 1.0 0.0 160 1600 item loaded maps "dm obj moh"
Admin .MAP Forums
Image
Head above heels.
Post Reply