Post new topic    
Page 1, 2  »
Red Slime
Send private message
Footsteps sound effects 
 PostSun Jan 25, 2015 2:38 pm
Send private message Reply with quote
I've been making a game with OHR and I have been wondering, is there any way to add a sound effect so that every time the hero takes a step it does a footstep noise?
Metal King Slime
Send private message
 
 PostSun Jan 25, 2015 3:03 pm
Send private message Reply with quote
Well, yes... It should be relatively easy. You'd create a script to call up a sound, and then turn it into an Each Step script. If you're not entirely sure how to go about doing that, I'd be happy to walk you through the process.



That said though, and I don't mean to be dismissive, but I have a hard time seeing this work effectively without it being annoying. Of course, you're free to give it a shot, who knows, it just might work out brilliantly.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Slime Knight
Send private message
 
 PostSun Jan 25, 2015 3:06 pm
Send private message Reply with quote
Ah, oddly enough, I just made a game doing just this.
First, import your footstep sound effect!

then, A simple code like this will work when set as an "Each Step" script. In the "General Map Data" menu for the map you want to have footsteps, set the script as an "each step" script, and it will make a sound every time your hero steps on a new tile.
Code:

plotscript,footsteps, begin
play sound (2, false, false)
#where (2) is the number of the imported sound effect for your footstep.


Theoretically, you could also make a bunch of invisible NPCs, set them to run the same script, set their use to "step on" and put them all over your map. I don't recommend this, but I had to do it in one or two spots in a game once.

Hope that helps!
Liquid Metal Slime
Send private message
 
 PostSun Jan 25, 2015 3:37 pm
Send private message Reply with quote
Just an additional suggestion. You could code the footstep as has already been said, but also add in a condition which checks which zone number you're standing on. If your in zone 1 the each step script may play a "walking through tall grass sound," if zone 2 then it will play a "wading through shallow water sound," if zone 3 then "clacking on hard floor sound." I think this could help to avoid any annoyance by only giving certain regions on your map layout sound too.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Red Slime
Send private message
 
 PostSun Jan 25, 2015 3:47 pm
Send private message Reply with quote
ok, everything just somehow got really complicated Sad . First I got myself a text write to write down the code you told me to. Then after I tried importing it is said HSPEAK is missing. I then tried to download OHRRPGCE again and tried it and it said that the HSPEAk was an old version, get the newer one. Now I really have no idea what to do. Confused I am not sure if it is because I am on a mac or not.

PS: Ok, it imports now, I just have to fix the code because I am somehow messing it up somewhere
Liquid Metal Slime
Send private message
 
 PostSun Jan 25, 2015 5:48 pm
Send private message Reply with quote
If you're stuck just copy and paste the code here and someone should be able to help point out the problem.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Red Slime
Send private message
 
 PostSun Jan 25, 2015 7:04 pm
Send private message Reply with quote
Since I am new to plotscripting with OHR I think I do need help xD

Code

include, plotscr.hsd

plotscript,footsteps,begin

if read zone (1, false, false) = true then play sound (1, false, false)
else if read zone (2, false, false) = true then play sound (2, false, false)
end
Liquid Metal Slime
Send private message
 
 PostSun Jan 25, 2015 7:40 pm
Send private message Reply with quote
You were mainly missing brackets, and also didn't specify the x,y coordinates. I made something that should work better. May need some tweaking. Be sure to put it on your map as an "each step script"

Code:

include, plotscr.hsd

plotscript,footsteps,begin

if (read zone (1, hero x (me), hero y (me)) = true) then(
  play sound (1, false, false)
) else if (read zone (2, hero x (me), hero y (me)) = true) then(
  play sound (2, false, false)
end

⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Red Slime
Send private message
 
 PostSun Jan 25, 2015 8:02 pm
Send private message Reply with quote
sheamkennedy wrote:
You were mainly missing brackets, and also didn't specify the x,y coordinates. I made something that should work better. May need some tweaking. Be sure to put it on your map as an "each step script"

Code:

include, plotscr.hsd

plotscript,footsteps,begin

if (read zone (1, hero x (me), hero y (me)) = true) then(
  play sound (1, false, false)
) else if (read zone (2, hero x (me), hero y (me)) = true) then(
  play sound (2, false, false)
end

Thanks Grin but for some reason everytime I try to import it it says "=" is not permitted inside a script. Everything else seems to be fine
Liquid Metal Slime
Send private message
 
 PostSun Jan 25, 2015 8:28 pm
Send private message Reply with quote
Oh my mistake. When you are writing a condition to see if something is equal you should actually write it as "==." So the code should be:


Code:

include, plotscr.hsd

plotscript,footsteps,begin

if (read zone (1, hero x (me), hero y (me)) == true) then(
  play sound (1, false, false)
) else if (read zone (2, hero x (me), hero y (me)) == true) then(
  play sound (2, false, false)
end


All the functions for the coding language can be found here:
http://hamsterrepublic.com/ohrrpgce/docs/plotdict.xml
but it can be a lot to take in...
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Red Slime
Send private message
 
 PostSun Jan 25, 2015 8:43 pm
Send private message Reply with quote
I never understood why programmers always said coding was hell, now I understand why xD

Now its complaining about the "plotscript,footsteps, begin" line saying it needs either an "end" or ")"
Liquid Metal Slime
Send private message
 
 PostSun Jan 25, 2015 8:48 pm
Send private message Reply with quote
yoelleoy wrote:
I never understood why programmers always said coding was hell, now I understand why xD

Now its complaining about the "plotscript,footsteps, begin" line saying it needs either an "end" or ")"


You may be missing brackets somewhere. Make sure all open brackets have a close bracket to end them. Also make sure the begin has an end (which it does).

Sorry I typed that code up fast without testing it. I think this solves the bracket situation:


Code:

include, plotscr.hsd

plotscript,footsteps,begin

if (read zone (1, hero x (me), hero y (me)) == true) then(
  play sound (1, false, false)
) else if (read zone (2, hero x (me), hero y (me)) == true) then(
  play sound (2, false, false)
)
end


Just double check it if it doesnt work... these are all the basic errors you will run in to frequently. Once you know what the error messages mean you'll get better at trouble shooting the code yourself, but don't be afraid to ask for the time being.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Red Slime
Send private message
 
 PostSun Jan 25, 2015 9:04 pm
Send private message Reply with quote
HALLELUJA! IT WORKS! thanks a bunch Grin I'll probably will read through the plotscripting dictionary for tomorrow so that I don't have to ask for every little thing Kamina
Liquid Metal Slime
Send private message
 
 PostSun Jan 25, 2015 9:08 pm
Send private message Reply with quote
yoelleoy wrote:
HALLELUJA! IT WORKS! thanks a bunch Grin I'll probably will read through the plotscripting dictionary so that I don't have to ask for every little thing Kamina


Great to hear! (No pun intended) Yeah it's good to at least skim through the sections of the dictionary that you think may be useful for your game. I often get good game mechanic idea's just from looking up different things in the dictionary and considering how I can combine them to do something useful.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Slime Knight
Send private message
 
 PostSun Jan 25, 2015 10:14 pm
Send private message Reply with quote
Yes, I visit the dictionary often!, and usually find out all sorts of cool stuff the program can do. Don't worry too much about asking questions you think might be dumb, That's practically all I do around here! I've been able to learn quite a lot in a few months from hanging around here, and I hope you do the same!

Also, sometimes I Google a phrase that I'm looking for help on, while adding "Slime salad" i.e. -Adding Footstep sound effects "slime Salad"

Sometimes I've found interesting threads from years past without having to ask, or search through pages of topics. Anyway, Good luck with your game, and don;t be a stranger Smile
Display posts from previous:
Page 1, 2  »