Two questions: playsound and platforms

White Dragon

New member
Hi to all guy!! Openbor is great =)
I've 2 questions for you and I hope you know my problems...

1) Does exists a method to play a sound in script mode? Not playsample + openborconstant...
    But I want to play a custom sound for ex. "data/sounds/mysample.wav"
2) Can I do a platform that block the jump of my hero player?? (Like super mario ^__^)

Thanks guys, you're great ever!! =)
 
#1 I usually load certain SFX from it's path before playing it with script, like this:

    int SFX = loadsample("data/sounds/clang.wav");

then play it with playsample like this:

    playsample(SFX, 0, 120, 120, 100, 0);

As you can see, you can load SFX from certain path not only load 'default' ones.

Maybe Damon Caskey could help you more on this.

#2 Yes, aside of platforms, you need to set height in your characters's text to 'allow' their jump to be blocked by platforms.
Without setting this, characters can jump from below platform and pass the latter.
 
I have 2 similar questions  -

#1 - I want to replace some type none entites that are just for playing sfx in stage. 

What's the best way to play sound by just inserting script into the stage?

I just want to do something like this

spawn @script
playsound blahblah
@end_script
coords 200 200
at 450

#2 - I just spent ages trying to get platforms working. What do you need to set to make them work? 

I thought I was just doing it wrong on mine, so I copied a platform from another mod and I still can't jump on anything.
 
I thought I was just doing it wrong on mine, so I copied a platform from another mod and I still can't jump on anything.

Check the min and max z and the platform width. in Avengers game, there is a level with working platform. Its "platformstage.txt" under data/bgs/platform
 
# the second value is the Z, must be the same of the stage (don't change it)
yep here's the problem, why does a few notes in your text make more sense than the manual.  :o


I think the manual makes sense if you read it like 100 times, but the way it is worded for some explanations is just confusing.  ???


 
why does a few notes in your text make more sense than the manual.  :o
I think the manual makes sense if you read it like 100 times, but the way it is worded for some explanations is just confusing.

Same here. But I changed some things at the manual to make it more clear. If you have any suggestion, drops me a line.
 
Cool np,

Maybe you could round up a team from your contacts to help translate the manual, it would really help a lot of people out too I'm sure.

Okay I think I sorted platforms now.  The other problem was offset,  it seems to count height from the bottom. 
My platform was 64x16 - So offset 1 1 makes height wrong, but 1 16 makes it perfect.

Thanks for the help. Now if I could only make ladders...  I need to learn walls too.  ::)


-----------------
Off topic - Been meaning to ask, Do you think you could help write or link a good tutorial for the forum, that works for making palettes in OpenBOR?  (Just a whenever thing, I know ya real busy lately)

The existing one needs to be removed, it's become mis-information.  It was only for original BOR engine.



 
#1 - I want to replace some type none entites that are just for playing sfx in stage.

What's the best way to play sound by just inserting script into the stage?

I just want to do something like this

spawn @script
playsound blahblah
@end_script
coords 200 200
at 450

That might work, have you tried this?

Now if I could only make ladders...  I need to learn walls too.

Making ladders are easy ;) BUT the hardest part is giving characters ability to climb ladders.

Walls OTOH are easy to set, you need good imagination to set these
 
I tried this but it would crash, so thought I'd ask how you would try it.

Code:
spawn @script int SFX = loadsample("data/sfx/31.wav");
playsample(SFX, 0, 120, 120, 100, 0);
@end_script
coords 0 196
at 270
 
Oh yeah of course,  :-[

Thanks Bloodbane, I  should do this stuff when I'm more awake  ::)

I'm used to writing script in it's own file, and it's been a while since I tried anything.


One other thing, do you have an idea how to make sound play with priority?  For example sound played in death anim should always be heard and not let other sounds interupt it or stop it playing. (like player dies but if enemy or another entity makes sound too it's sometimes not heard)
 
Back
Top Bottom