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.
In the meantime please join the new Discord Server!
If you have any questions please e-mail me through the Platinum Arts website.
Sound when casting a spell?
- kddekadenz
- Member
- Posts: 423
- Joined: July 17th, 2011, 11:02 am
- Name: kdd
- Contact:
Sound when casting a spell?
I'm quite confused:
I want to add a custom sound when casting a spell, but I don't know how to do this.
Please answer as fast as possible.
I want to add a custom sound when casting a spell, but I don't know how to do this.
Please answer as fast as possible.
Kelgar is an advanced RPG beeing developed in Sandbox
Re: Sound when casting a spell?
I assume you want help with the RPG...
What I've done is more of a hack. I'm not sure how to approach doing it properly so that method has been there for a while...
So keep in mind this may change in the future!
Basically, the items in question as well as the attacker receive an "attacksound" signal when they attack.
So just invoke the sounds there using r_sound.
Just let the player play a few grunts if you want and give the weapon's use a swish or something.
What I've done is more of a hack. I'm not sure how to approach doing it properly so that method has been there for a while...
So keep in mind this may change in the future!
Basically, the items in question as well as the attacker receive an "attacksound" signal when they attack.
So just invoke the sounds there using r_sound.
Code: Select all
r_script_signal "attacksound" [
r_setref reference_to_optional_entity actor
r_sound "path/to/sound" reference_to_optional_entity
]
This is not a url, clicking it is pointless
- kddekadenz
- Member
- Posts: 423
- Joined: July 17th, 2011, 11:02 am
- Name: kdd
- Contact:
Re: Sound when casting a spell?
Yes, forgot to mention itHirato wrote:I assume you want help with the RPG... [...][...]Code: Select all
r_script_signal "attacksound" [ r_setref reference_to_optional_entity actor r_sound "path/to/sound" reference_to_optional_entity ]

I do not understand the 'reference_to_optional_entity' part.
If I have a item with the id 8 as reference, how this part should be like?
Kelgar is an advanced RPG beeing developed in Sandbox
- Sircameron
- Member
- Posts: 62
- Joined: March 6th, 2012, 9:13 pm
- Name: Cameron
- Location: Indiana
Re: Sound when casting a spell?
Code: Select all
setref ENT_ITEM 8 actor
Re: Sound when casting a spell?
It gives the sound a source, which means it will provide some vague sense of direction and distance.kddekadenz wrote:Yes, forgot to mention itHirato wrote:I assume you want help with the RPG... [...][...]Code: Select all
r_script_signal "attacksound" [ r_setref reference_to_optional_entity actor r_sound "path/to/sound" reference_to_optional_entity ]
I do not understand the 'reference_to_optional_entity' part.
If I have a item with the id 8 as reference, how this part should be like?
You could just write it as follows: r_sound "path/to/sound" actor
but I used that r_setref there to explain it a bit better
This is not a url, clicking it is pointless
- kddekadenz
- Member
- Posts: 423
- Joined: July 17th, 2011, 11:02 am
- Name: kdd
- Contact:
Re: Sound when casting a spell?
So I could make the sound follow something?Hirato wrote:It gives the sound a source, which means it will provide some vague sense of direction and distance.
You could just write it as follows: r_sound "path/to/sound" actor
but I used that r_setref there to explain it a bit better
Kelgar is an advanced RPG beeing developed in Sandbox
- kddekadenz
- Member
- Posts: 423
- Joined: July 17th, 2011, 11:02 am
- Name: kdd
- Contact:
Re: Sound when casting a spell?
Can I get the wielded item(s) of a actor? Or at least of the player?
Offtopic: PAS needs a better documentation - I think I will improve it when I have time
Offtopic: PAS needs a better documentation - I think I will improve it when I have time
Kelgar is an advanced RPG beeing developed in Sandbox
- Sircameron
- Member
- Posts: 62
- Joined: March 6th, 2012, 9:13 pm
- Name: Cameron
- Location: Indiana
Re: Sound when casting a spell?
Found getequip() in the rpgscript.ccp so it should be possible. I'll play around with it tonight after work. I dont know if it references a certain slot or what at this point.. Hope that helps
***Edit***
sorry i'm stumped 2.5 hrs and ive got nothing.. Not even an idea on how you could do this. Other than if you could get the weapons to set a specific variable when equipped, then ref that number for your sound in a list.. Goodluck
***Edit***
sorry i'm stumped 2.5 hrs and ive got nothing.. Not even an idea on how you could do this. Other than if you could get the weapons to set a specific variable when equipped, then ref that number for your sound in a list.. Goodluck
- kddekadenz
- Member
- Posts: 423
- Joined: July 17th, 2011, 11:02 am
- Name: kdd
- Contact:
Re: Sound when casting a spell?
Thank you for trying 
Good idea to browse the source code. I will try to find a solution.

Good idea to browse the source code. I will try to find a solution.
Kelgar is an advanced RPG beeing developed in Sandbox