Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

diagonal walking missaligns hero walkabout gfx

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
byako
Shogun




Joined: 28 Oct 2003
Posts: 48
Location: Shotgun in the 48 car...

PostPosted: Mon Dec 15, 2003 11:40 pm    Post subject: diagonal walking missaligns hero walkabout gfx Reply with quote

I have a script that I use for multi directional movement (not just the standard n,s,e,w directions) Arrow

The problem is, sometimes the walkabout becomes missaligned (both north-south & left-right) Pissed off!

I can't seem to fix it. Crying

#begin script----------------------
script,Diagonalwalk,begin
# variable(upkeypad)
# variable(downkeypad)
variable (pass,move)
variable (HXX,HYY)
set tag ( 10, true )
# setheroz(me,5) #attempt at manually resetting after each step
# setheroz(1,5)
# setheroz(2,5)
# setheroz(3,5)
while ( checktag ( 10 ) ) do
(
set variable( move, 1 )

wait for key (anykey )
while ( key is pressed ( 73 ),and,move) #walk northeast
do,begin
set variable(pass,read pass block(hero X(me)+1,hero Y(me)--1))
if (pass,and,harm tile)
then,begin ( set variable( move, 0 ) ) end
else, begin
suspendherowalls
walk hero ( me, right, 1 )
walk hero ( me, up, 1 )
wait for hero ( me )
resumeherowalls
end #end else
end #end while/do walk northeast
set variable( move, 1 )
wait for key (anykey )
while ( key is pressed (79),and,move )#walk southwest
do,begin
setvariable(HXX,(herox(me)--1)*20) #math for exact pixel location
setvariable(HYY,(heroy(me)+1)*20)
set variable(pass,read pass block(hero X(me)--1,hero Y(me)+1))
if (pass,and,harm tile)
then,begin ( set variable( move, 0 ) ) end
else, begin
# while ( herox <> HXX, and, heroy <> HYY ) do, begin #this locks up the script, so I disabled it
#it is supposed to check the current pixel placement of the hero
#versus the destination, and stop when they match

suspendherowalls
walk hero ( me, left, 1 )
walk hero ( me, down, 1 )
wait for hero ( me )
# puthero(me,hxx,hyy) #this by itself caused the hero to 'jump' suddenly to a new place
resumeherowalls
# end #end of unused while
end #end else
end #end while/do walk southwest
)
end
#Script over------------------------------

as you can see, I have an attempt at direct pixel placement to realign the hero after each step(the hxx,hyy variables), but all that accomplished was making the heros suddenly jump to a new location periodically.

I also have tried to use setheroz(who,5) to reset the vertical alignment, to no avail. I have tried other locations in the script, for those commands as well, but no luck yet.

any ideas?
_________________
This is my new signature.
---------------------
EDO -an oldie but goodie
matricx re-hacked a great little game
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group