Instead of doing a lot of tedious experimentation, I thought I'd ask to see if anyone already knew. I'd like to know so I can use a draw function to draw something on top of his apparent position. It looks pretty bad if I use his actual position.
Link's Apparent Position During Screen Scrolling
#1
Posted 07 December 2014 - 09:56 PM
#2
Posted 07 December 2014 - 10:23 PM
if(Link->Action==LA_SCROLLING)
{
if(scrollDir==-1)
{
if(Link->Y>160)
{
scrollDir=DIR_UP;
scrollCounter=45;
}
else if(Link->Y<0)
{
scrollDir=DIR_DOWN;
scrollCounter=45;
}
else if(Link->X>240)
{
scrollDir=DIR_LEFT;
scrollCounter=65;
}
else
{
scrollDir=DIR_RIGHT;
scrollCounter=65;
}
}
if(scrollDir==DIR_UP && scrollCounter<45 && scrollCounter>4)
drawY+=4;
else if(scrollDir==DIR_DOWN && scrollCounter<45 && scrollCounter>4)
drawY-=4;
else if(scrollDir==DIR_LEFT && scrollCounter<65 && scrollCounter>4)
drawX+=4;
else if(scrollDir==DIR_RIGHT && scrollCounter<65 && scrollCounter>4)
drawX-=4;
scrollCounter--;
}
else
{
drawX=Link->X;
drawY=Link->Y;
if(scrollDir!=-1)
scrollDir=-1;
}
#3
Posted 07 December 2014 - 10:47 PM
That works like a charm. Thanks, Saffith.
Edited by Lejes, 08 December 2014 - 12:58 PM.
#4
Posted 08 December 2014 - 11:44 AM
Can I use this too? I would have used dummy items and LTM's to alter link's sprite, but if I can use this method instead, that'd be much simpler.
#5
Posted 08 December 2014 - 12:53 PM
#6
Posted 08 December 2014 - 01:21 PM
Are you asking my permission? Anyone's welcome to use that, as far as I'm concerned.
Well yes, I usually ask for permission first if I wasn't the one who requested the script. Anyways, thank you ![]()
#7
Posted 08 December 2014 - 05:52 PM
Hey Leges, is this the function that solves the scrolling problem in your Sideview Swimming script? You said that the scrolling using LTM needs a function to keep Link's position.
#8
Posted 08 December 2014 - 07:08 PM
Yes, you could fix it with this.
#9
Posted 02 January 2015 - 11:27 AM
could someone explain how to use this function or upload a script or a demo that uses it?
i've tried to implement it, but can't get anything to draw when scrolling. i've tried drawing before and after the Waitdraw.
edit: lweapons are not drawn during scrolling right? that's probably my issue.
Edited by justin, 02 January 2015 - 11:38 AM.
#10
Posted 02 January 2015 - 11:38 AM
Everything is in the script buffer. The function that controls draw position is named TorchScrolling. The position variables are global, named center_x and center_y. You'll notice their values are set by TorchScrolling and nowhere else.
EDIT: Yeah that would be an issue. Lweapons don't persist through screen scrolling.
Edited by Lejes, 02 January 2015 - 11:41 AM.
#11
Posted 02 January 2015 - 11:42 AM
torches.qst seems broken. can you reupload?
#12
Posted 02 January 2015 - 11:45 AM
It's on your end. The download is working fine for me.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users

