Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

Specific sounds

Chat and ask questions about the RPG Maker Mode here.
Post Reply
zahan
Member
Member
Posts: 4
Joined: July 29th, 2012, 10:53 am

Specific sounds

Post by zahan »

I dont know how to add a sound , for exemple, when a quest is accepted. There is posible?
Let's say that i have a general sound in background. When the actor accept the quest i want to play a quest sound. Something like that!


Note: if there is topics with this subject, i really want the link.
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Specific sounds

Post by chocolatepie33 »

this is a coding thing, I don't know what mode you're using (and if it's RPG, I don't know RPG scripting), but here's some pseudocode based on fps cubescript:

Code: Select all

level_trigger_1 = [showgui person]
newgui person [
guitext "hi, what's up?"
guibar
guibutton "not much" [showgui person2]
guibutton "(say nothing)" [cleargui]
]
newgui person2 [
guitext "I need you to go on a quest."
guibar
guibutton "yes." [sound code plays; showgui person3]
guibutton "no" [cleargui]
like said, I don't know the specific code to play the sound, but I believe you can have the sound play if you have it activated after selecting a guioption that way.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Specific sounds

Post by Lou »

Hi,
I looked in the rpgscript.cpp file and found this reference.

Code: Select all

ICOMMAND(r_sound, "ss", (const char *p, const char *r),
		if(*r)
		{
			getreference(r, ent, ent->getent(entidx), , r_sound)
			playsoundname(p, &ent->getent(entidx)->o);
		}
		else
			playsoundname(p);
	)
So maybe there is a r_sound() function you can call in the script and pass it the sound file?
I could not find any tutorials or references as to how to get this to work so you will have to play with it and
see if it works.
Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Specific sounds

Post by Lou »

It works but not as expected. Here is what I coded up.

Code: Select all

// Lou NPC script
include scripts/1

//start conversation
r_script_node "main" [result "[Move along and stay out of trouble.]"] [
     r_response "Will do." normal //goes to dialogue normal
	 r_sound "/aard/bang"
	 r_response "Goodbye" "" //closes the dialogue
 ]

//normal path
 r_script_node "normal" [result "[Have a nice day.]" ] [ 
   r_response "Goodbye" ""
 ]
The issues are that the file needs to be a wave type and also the sound plays as soon as the the text branch is entered regardless
of how you respond. So it is firing at a higher level than the conversation code it running. Maybe it would be better to set a variable
when you enter the correct text path and then let that trigger the sound to play. It is just a thought.
Regards,
Lou
zahan
Member
Member
Posts: 4
Joined: July 29th, 2012, 10:53 am

Re: Specific sounds

Post by zahan »

I'm still working on sounds. thank's for help.
User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: Specific sounds

Post by kddekadenz »

Lou wrote: The issues are that the file needs to be a wave type
Actually not. PAS supports mp3 and ogg, too. 2.8 does add FLAC support.
Lou wrote: and also the sound plays as soon as the the text branch is entered regardless
of how you respond.
Then put the command into the respond :P
Kelgar is an advanced RPG beeing developed in Sandbox
Post Reply