Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Request / Listing] GM6 Views Help  (Read 1384 times)

0 Members and 1 Guest are viewing this topic.
[Request / Listing] GM6 Views Help
« on: June 24, 2006, 01:26:21 pm »
  • Txet Lanosrep
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 700
So I have this code for my Zelda game that lets me have multiple "rooms" in one big room.  It works great but there is one problem, whenever I got to a "room" that is not the one that Link was created in the screen shakes uncontrollably.  In obj_normal_link's create event I have this:

view_xview[0] = floor(obj_normal_link.x/view_wview[0])*view_wview[0]
view_yview[0] = floor(obj_normal_link.y/view_hview[0])*view_hview[0]
Wx = view_xview[0]
Wy = view_yview[0]

aAd in his step event I have this:

Wx = floor(obj_normal_link.x/view_wview[0])*view_wview[0]
Wy = floor(obj_normal_link.y/view_hview[0])*view_hview[0]
view_xview[0] -= sign(view_xview[0]-Wx)*view_wview[0]/20
view_yview[0] -= sign(view_yview[0]-Wy)*view_hview[0]/20


Any help would be great!

Thanks,
   Retro
« Last Edit: February 11, 2012, 09:03:08 am by Niek »
Logged

Retro
  • TITANIC
Re: GM6 Views Help
« Reply #1 on: June 24, 2006, 05:04:41 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 122
That is very odd...When I put that script in my link walking engine, it worked beautifully...Could you post your engine, or no?
Logged
Re: GM6 Views Help
« Reply #2 on: June 25, 2006, 11:50:40 am »
  • Txet Lanosrep
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 700
Not really lol, what are the sizes of your rooms, views etc?
Logged

Retro
  • TITANIC
Re: GM6 Views Help
« Reply #3 on: June 25, 2006, 01:15:00 pm »
  • Txet Lanosrep
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 700
Lol sorry update, I deleted everything made by me and just made it the engines I got from here:

dailydish.dayjo.org/CoT.gm6

^Copy into browser

Somebody help, please lol.
Logged

Retro
  • TITANIC

Goodnight

Once and future Captain
Re: GM6 Views Help
« Reply #4 on: June 25, 2006, 04:19:31 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
This is your lucky day. I just took a wild guess at it, and it works, and it shows why your code already worked for Streblo.

Your view dimensions are multiples of 16. The scrolling code (which is very innovative btw, I can't quite figure it out) uses some kind of 20ths. I'm thinking that it somehow made the view scroll too far, and then because it scrolls based on Link's x and the current view_xview, it starts to scroll back and forth because it thinks it should. I don't know, I can't explain what's happening.

Quote
view_xview[0] -= sign(view_xview[0]-Wx)*view_wview[0]/20
view_yview[0] -= sign(view_yview[0]-Wy)*view_hview[0]/20
But if you change the 20 to 16 on both lines, it seems to work fine.

BTW, the collision with the rocks is a little off, because you went with your own sprites with a different origin than the ones supplied in my movement engine, but the object mask (sprLinkShadow) still uses my origin, and it's too high on your sprites. Try changing its y origin to -14.
Logged

Goodnight

Once and future Captain
Re: GM6 Views Help
« Reply #5 on: June 25, 2006, 04:31:09 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
And I thought of something else you may or may not want, and that is stopping Link from moving while the screen is scrolling.

In the Step event, right before my movement script, put this:
Code: [Select]
global.scrolling = frac(view_xview[1]/view_wview[1])!=0 || frac(view_yview[1]/view_hview[1])!=0That makes a variable (global.scrolling) that is true if either view_xview[1] is not a multiple of view_wview[1], or view_yview[1] is not a multiple of view_hview[1]. In other words, it's true when you're scrolling, false when you're not.

Then in the movement script, there's a line that says this:

Code: [Select]
if holdd ||holdu || holdl || holdr {Just change it to:
Code: [Select]
if (holdd ||holdu || holdl || holdr) && !global.scrolling {[/code}
Logged
Re: GM6 Views Help
« Reply #6 on: June 25, 2006, 04:40:24 pm »
  • Txet Lanosrep
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 700
Man Goodnight you own, work on Two Swords and then make a normal Zelda game XD.
Logged

Retro
  • TITANIC
Re: GM6 Views Help
« Reply #7 on: June 26, 2006, 12:01:13 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 122
I think the problem may be much simpler, I made the view follow link, and the screen shook uncontrollably, if you made the view follow nothing, it would work.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.324 seconds with 54 queries.

anything