View previous topic :: View next topic |
Author |
Message |
carsten
Joined: 17 Aug 2012 Posts: 16
|
Posted: Sun Apr 14, 2013 4:13 pm Post subject: some questions |
|
|
btw, a couple of questions because I'm not 100% proficient with the software,
1. is there a way to make doors activate only by the "use" input (space bar or enter) with out coding the door every time.
2. is there way i can make it so heros walk over ncps. this way i can use a clear pic and have the ncp trigger events/say somthing as if it wern't an ncp? i have tried editing the general map data and saying heros over ncps, and it looks that way in layers page but i am always running into the ncp and never walking over it. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun Apr 14, 2013 7:15 pm Post subject: Re: some questions |
|
|
carsten wrote: |
1. is there a way to make doors activate only by the "use" input (space bar or enter) with out coding the door every time.
|
Unfortunately, no you have to link doors manually. I am open to suggestions on ways to make door linking easier
carsten wrote: | 2. is there way i can make it so heros walk over ncps. this way i can use a clear pic and have the ncp trigger events/say somthing as if it wern't an ncp? i have tried editing the general map data and saying heros over ncps, and it looks that way in layers page but i am always running into the ncp and never walking over it. |
that "Heroes over NPCs" setting has to do with the order that layers are drawn. What you want is to change the NPC "Activation" to "Step On" |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Apr 14, 2013 10:17 pm Post subject: |
|
|
Wow, that fixed it? I don't actually know why the problem would have gone away.
1. I'm interpreting your question differently than James did. I put my answer here: 'Scripts:Activate doors with a use key' _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
carsten
Joined: 17 Aug 2012 Posts: 16
|
Posted: Thu Jul 18, 2013 4:03 pm Post subject: any scripting ideas |
|
|
so now that i'm working on my game, there is a part where i want really creepy echoing footsteps. i want it so that a ten second footstep sound file will start when you walk any direction and immediately cut out when you stop. I've tried using a 1 second move tile loop and it sounds terrible.
this was my miserable attempt at my coding for it
include, plotscr.hsd
plotscript, footstep, begin
if(get hero speed(me) >> 1) then(
play sound (0, true, true))
if(get hero speed(me) << 0) then(
pause sound(0))
end
anyone know have to code this, or if its even possible?
P.S. i have a macbook now.  |
|
Back to top |
|
 |
Doctor TheGiz Guest
|
Posted: Fri Jul 19, 2013 4:05 am Post subject: |
|
|
GetHeroSpeed doesn't work that way. What it's actually referring to is the speed the hero crosses a tile, which by default is 4 (Pixels Per Tick) and is modified with the SetHeroSpeed command. You should try HeroIsWalking instead. |
|
Back to top |
|
 |
carsten
Joined: 17 Aug 2012 Posts: 16
|
Posted: Fri Jul 19, 2013 8:46 am Post subject: |
|
|
i see. my hero speed is always 4 weather im walking or not.
this is the changes i made but its not working (just silence)
include, plotscr.hsd
plotscript, footstep, begin
if(hero is walking (me)) then(
play sound (0, true, true))
if(not(hero is walking (me))) then(
pause sound(0))
end |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jul 19, 2013 9:34 am Post subject: |
|
|
Heh, you should create a new thread for new questions; I was worried that the Mac port was broken again.
This is actually surprisingly difficult to do for a combination of unfortunate reasons. An on-footstep is only triggered at the end of a step. And "hero is walking" returns false for one tick whenever you complete a step (one tile), so you can't directly use it to start/stop a sound effect for movements larger than one tile.
Here's my solution: a script that loops continuously (eg. newgame) and remembers the previous value of "hero is walking" to smooth over that one tick gap:
Code: | plotscript, stepping sound, begin
variable(was moving)
while (true) do (
if (hero is walking(me) || was moving) then (
play sound(sfx:step, false, false)
) else (
stop sound(sfx:step) # Or pause sound
)
was moving := hero is walking(me)
wait(1)
)
end |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|