Backward walk
Moderators: marionline, SDHawk
Backward walk
Quick question :
How do I make an NPC or Hero walk backwards? eg facing upwards while walking 1 step down.
Regards.
How do I make an NPC or Hero walk backwards? eg facing upwards while walking 1 step down.
Regards.
vvight.wordpress.com
Write a simple script to change the hero's walkabout picture set to a copy of their normal one, with the frames facing in opposite directions.
If it's something like facing up while going down a ladder, just have an NPC at the top of the ladder trigger that script, then have another NPC set your hero picture back to normal when you're not on the ladder anymore.
EDIT:
An example might be handy too, now that I think of it.
Just give the NPC(s) that turns on the climbing graphic a script argument 1, and the NPC(s) that sets it back to normal a script argument 0.
If it's something like facing up while going down a ladder, just have an NPC at the top of the ladder trigger that script, then have another NPC set your hero picture back to normal when you're not on the ladder anymore.
EDIT:
An example might be handy too, now that I think of it.
Code: Select all
## Assuming walkabout set 1 is the hero climbing,
## and set 0 is the regular one.
plotscript, climb ladder, status, begin
if (status) then (
set hero picture (me, 1)
)
else (reset hero picture(me))
end
Last edited by Foxley on Sun Dec 04, 2016 3:39 am, edited 1 time in total.
- Pepsi Ranger
- Liquid Metal Slime
- Posts: 1457
- Joined: Thu Nov 22, 2007 6:25 am
- Location: South Florida
Real easy:
Basically, just set the direction after you send the hero (or NPC) in motion.
Code: Select all
script,Moonwalk,begin
walk hero (who,direction,distance)
set hero direction (who,opposite direction)
wait for hero (who)
end
Last edited by Pepsi Ranger on Sun Dec 04, 2016 3:35 am, edited 1 time in total.
Place Obligatory Signature Here
Thanks guys! I just wanted the hero to back away from a threat rather than walk backwards and turn around. If I wanted to move back more than 1 space I guess I'd need to do something like:
right?
Code: Select all
script,Moonwalk,begin
walk hero (bigsteve,down,1)
set hero direction (bigsteve,up)
wait for hero (bigsteve)
walk hero (bigsteve,down,1)
set hero direction (bigsteve,up)
wait for hero (bigsteve)
walk hero (bigsteve,down,1)
set hero direction (bigsteve,up)
wait for hero (bigsteve)
walk hero (bigsteve,down,1)
set hero direction (bigsteve,up)
wait for hero (bigsteve)
end
vvight.wordpress.com
- FnrrfYgmSchnish
- Metal Slime
- Posts: 741
- Joined: Thu Jun 18, 2009 4:37 am
- Location: Middle of Nowhere
I don't think you'll have to use a new set of "walk hero"/"set hero direction" commands for every step unless you want each step to have a slight pause before the next one. If I'm remembering right, all you need to do to make a hero walk down several steps while still facing up is to use a single "walk hero" for however many steps you need, then a single "set hero direction" immediately afterward. The game won't try to change the direction again until after that "walk hero" command is finished.
FYS:AHS -- Working on Yagziknian NPC walkabout sprites
this is what I did
Code: Select all
variable (d)
d:= hero direction (me)
walk hero (me,d,-1)
wait for hero (me)
- Bob the Hamster
- Lord of the Slimes
- Posts: 7660
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
- Bob the Hamster
- Lord of the Slimes
- Posts: 7660
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
I remember that one! I seem to remember that talking to an enemy would not cancel their move, so it happened all the time.FyreWulff wrote:Reminds me of back in the day where if you talked to an NPC that walked in any game, they could walk backwards or sideways from you if you talked to them just at the right time for one more tile. I swear that got fixed at some point?
That was fixed a long time ago, so now talking to them causes them to snap back if they are stepping away
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
I'm pretty sure it's always been written in the plotscripting dictionary.
http://hamsterrepublic.com/ohrrpgce/doc ... ut-walknpc
EDIT: Is that recently added? I seem to remember reading it somewhere, at least.
http://hamsterrepublic.com/ohrrpgce/doc ... ut-walknpc
EDIT: Is that recently added? I seem to remember reading it somewhere, at least.
Last edited by SwordPlay on Sat Aug 19, 2017 5:05 pm, edited 1 time in total.
- Bob the Hamster
- Lord of the Slimes
- Posts: 7660
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact: