Powered by Invision Power Board

 
  Pages: (2) [1] 2  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> Problem with Yoshi's tongue, (close to fixing it!)
Unspecified
yoshi-warrior
Posted: Jun 30 2008, 05:17 PM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08

Status: (0d) [--]


Alright, to save myself time on typing the question out, I'll provide the link to the topic on the game maker community forums where I have the explanation of the problem.
problem with Yoshi's tongue Topic
I figured I'd post my problem here since this is a more Mario-based community and might have someone who can help me out.

Basically, the tongue object moves using hspeed and I need the tongue to follow Yoshi without interfering with the object's hspeed. If I set the tongue object to follow "yoshi.x" then it stops the tongue object's hspeed. You can read more about it in the link. The link also provides a download of the gmk file containing the problem. Also, you can post your replies/questions here instead of on the GM forum.

Any and all help is greatly appreciated! If this problem can get fixed, I'll put your name in the credits of my future fan-game. nod.gif

Edit:
Okay, I think I might have made a break through!
In the step event for the yoshi object, I have a script that I used for his movement controls. The original script looked like this(this is for the right key event):
CODE

if place_free(x+3,y-3) and !place_free(x+3,y){x+=3 y-=3}

Right now, I just changed it to this:
CODE

if place_free(x+3,y-3) and !place_free(x+3,y){x+=3 y-=3}{tongue_object.x+=3 tongue_object.y-=3}

Basically, I added a code to move the tongue when the Yoshi object goes up a slope.

Now there's only one thing that needs to be fixed:
When Yoshi is walking up against a wall and he shoots his tongue out, the tongue detaches from his mouth. I just gotta figure out how to make the tongue stay if there's something in front of it.

This post has been edited by yoshi-warrior on Jul 4 2008, 09:53 PM
PMEmail Poster
Top
Unspecified
zzo38
Posted: Jun 30 2008, 06:08 PM
Quote Post


Registered user


Group Icon
Group: Members
Posts: 1621
Member No.: 2549
Joined: 21-August 06

Status: (0d) [--]


Don't use the "follow" command, use the "jump to position" command instead.


--------------------
Access my web-site
Vonkeror: the new web-browser
Wikipedia user-page
My gopher site Forget Web 2.0. Now is the time for Gopher 2.0.
Furryscript!!

Member of Anti-Master-Balls

Message to the moderator: I don't want you to add the badges under my name anymore.
PMUsers Website
Top
Unspecified
yoshi-warrior
Posted: Jun 30 2008, 06:12 PM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08

Status: (0d) [--]


QUOTE (zzo38 @ Jun 30 2008, 06:08 PM)
Don't use the "follow" command, use the "jump to position" command instead.

Actually, when I said it was following Yoshi, I meant to say that I was using the jump to position command. I knew enough to not use the follow command.
PMEmail Poster
Top
Unspecified
zzo38
Posted: Jun 30 2008, 06:13 PM
Quote Post


Registered user


Group Icon
Group: Members
Posts: 1621
Member No.: 2549
Joined: 21-August 06

Status: (0d) [--]


QUOTE (yoshi-warrior @ Jun 30 2008, 04:12 PM)
Actually, when I said it was following Yoshi, I meant to say that I was using the jump to position command. I knew enough to not use the follow command.

Make sure the depth of the tongue is less than the depth of the Yoshi. Events always happen in order of depth. Also make sure to put it in the "end step" event so it will happen after the movement.


This post has been edited by zzo38 on Jun 30 2008, 06:14 PM


--------------------
Access my web-site
Vonkeror: the new web-browser
Wikipedia user-page
My gopher site Forget Web 2.0. Now is the time for Gopher 2.0.
Furryscript!!

Member of Anti-Master-Balls

Message to the moderator: I don't want you to add the badges under my name anymore.
PMUsers Website
Top
Unspecified
yoshi-warrior
Posted: Jun 30 2008, 06:30 PM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08

Status: (0d) [--]


QUOTE (zzo38 @ Jun 30 2008, 06:13 PM)
Make sure the depth of the tongue is less than the depth of the Yoshi. Events always happen in order of depth. Also make sure to put it in the "end step" event so it will happen after the movement.

Everything involving the tongue's movement is in the end step event. But wouldn't making the tongue's depth smaller than Yoshi's depth make the tongue appear on top of yoshi?
yoshi's depth=-5
tongue's depth=0
Making the depth a smaller number would put that object on top.
PMEmail Poster
Top
Unspecified
Miaxis
Posted: Jul 1 2008, 01:48 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


you had to set the tongue´s depth to -6 if Yoshi´s depth was -5
the Z-axis is negated in posi and negative afaik


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Unspecified
zzo38
Posted: Jul 1 2008, 10:52 AM
Quote Post


Registered user


Group Icon
Group: Members
Posts: 1621
Member No.: 2549
Joined: 21-August 06

Status: (0d) [--]


QUOTE (yoshi-warrior @ Jun 30 2008, 04:30 PM)
Everything involving the tongue's movement is in the end step event. But wouldn't making the tongue's depth smaller than Yoshi's depth make the tongue appear on top of yoshi?
yoshi's depth=-5
tongue's depth=0
Making the depth a smaller number would put that object on top.

Yes it would, but ALL events (including draw event) happen in order of depth.

You should put the tongue movement codes in the yoshi object end step event:
CODE
if(instance_exists(Tongue)) with(Tongue) { x=Yoshi.x;y=Yoshi.y }


--------------------
Access my web-site
Vonkeror: the new web-browser
Wikipedia user-page
My gopher site Forget Web 2.0. Now is the time for Gopher 2.0.
Furryscript!!

Member of Anti-Master-Balls

Message to the moderator: I don't want you to add the badges under my name anymore.
PMUsers Website
Top
United States
Ziso
Posted: Jul 2 2008, 12:42 PM
Quote Post


Should I be concerned?
[*]

Group Icon
Group: Members
Posts: 992
Member No.: 3387
Joined: 2-March 07

Status: (0d) [--]


Is Yoshi's tongue always in existence? Or do you create it when it's time for Yoshi to lick?

This might in part have to do with your sprites.

In your end step for the tongue, I would put.

CODE
if yoshi.(variable that means he's in licking mode) = 1 {
// here, I would list if yoshi.image_index = # (do this for all the sub images of his licking sprite) {x = yoshi.x+(where ever the tongue should be depending on the subimage}


Now that may be a bit confusing, but what I mean is that when Yoshi licks, his head moves in the animation, so you want the tongue to stay in the same spot his head is. You assign the tongue a yoshi.x+# based on where Yoshi's head is in the animation. Where it is in the animation depends on the sub images (image_index). You will have to figure out what x goes with each sub images yourself since I don't know what sprites you're using.

Say the first sub image, the tongue should be at x+14, next one at x+15, next at x+17, etc. the code would look like this.
CODE
if yoshi.islicking = 1{
if yoshi.image_index = 0 {x = yoshi.x+14}
if yoshi.image_index = 1 {x = yoshi.x+15}
if yoshi.image_index = 2 {x = yoshi.x+17}}


If you don't understand what I'm getting at (I can be confusing when explaining my GM reasoning) just ask.

EDIT: about the first question. The tongue should not always be in existence. A good way to do this is to create the tongue at yoshi.x when he starts to lick. The end step code that I listed before will take care of where the tongue is in relation to the animation.

And you'll want to use that sub image logic for the tongue too when it licks an enemy. Move the enemy based on the sub image of the tongue (because it grows and shrinks in the animation).

This post has been edited by Ziso on Jul 2 2008, 12:45 PM


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
orange452
Posted: Jul 2 2008, 02:14 PM
Quote Post


...and brotha, I hurt people...
[*]

Group Icon
Group: Members
Posts: 519
Member No.: 3337
Joined: 21-February 07

Status: (0d) [--]


k, I got the tongue to follow yoshi right:
and I converted it back to gm6 (srry, only gm6 works on my comp)




Attached File ( Number of downloads: 2 )
Attached File  yoshi_game_WIP.gm6


--------------------
user posted image
************************************************************
PMEmail PosterUsers Website
Top
United States
Elyk
Posted: Jul 2 2008, 02:53 PM
Quote Post


Standard Member
[*][*][*][*]

Group Icon
Group: Members
Posts: 6604
Member No.: 3808
Joined: 22-May 07

Status: (0d) [--]


rather than using speeds to move the tongue, why not just do the animation in the sprite?


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Ziso
Posted: Jul 2 2008, 02:59 PM
Quote Post


Should I be concerned?
[*]

Group Icon
Group: Members
Posts: 992
Member No.: 3387
Joined: 2-March 07

Status: (0d) [--]


QUOTE (orange452 @ Jul 2 2008, 03:14 PM)
k, I got the tongue to follow yoshi right:
and I converted it back to gm6 (srry, only gm6 works on my comp)

If you jump and tongue, Yoshi's tongue disconnects from him.


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
orange452
Posted: Jul 2 2008, 05:46 PM
Quote Post


...and brotha, I hurt people...
[*]

Group Icon
Group: Members
Posts: 519
Member No.: 3337
Joined: 21-February 07

Status: (0d) [--]


k, fixed... ( you cant jump while the tongue is out now...)




Attached File ( Number of downloads: 2 )
Attached File  yoshi_game_WIP.gm6


--------------------
user posted image
************************************************************
PMEmail PosterUsers Website
Top
Finland
Ultramario
Posted: Jul 2 2008, 07:17 PM
Quote Post


Dan Dan Dan!
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 11240
Member No.: 2164
Joined: 9-June 06

Status: (0d) [--]


QUOTE (orange452 @ Jul 3 2008, 01:46 AM)
k, fixed... ( you cant jump while the tongue is out now...)

That doesn't fix it.

This does:
CODE
move relative to position (yoshi.hspeed,yoshi.vspeed)


Well not entirely, but mostly.


--------------------
PMEmail PosterUsers WebsiteAOL
Top
Unspecified
yoshi-warrior
Posted: Jul 4 2008, 02:45 PM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08

Status: (0d) [--]


QUOTE (Ziso @ Jul 2 2008, 12:42 PM)
Is Yoshi's tongue always in existence? Or do you create it when it's time for Yoshi to lick?

This might in part have to do with your sprites.

In your end step for the tongue, I would put.

CODE
if yoshi.(variable that means he's in licking mode) = 1 {
// here, I would list if yoshi.image_index = # (do this for all the sub images of his licking sprite) {x = yoshi.x+(where ever the tongue should be depending on the subimage}


Now that may be a bit confusing, but what I mean is that when Yoshi licks, his head moves in the animation, so you want the tongue to stay in the same spot his head is. You assign the tongue a yoshi.x+# based on where Yoshi's head is in the animation. Where it is in the animation depends on the sub images (image_index). You will have to figure out what x goes with each sub images yourself since I don't know what sprites you're using.

Say the first sub image, the tongue should be at x+14, next one at x+15, next at x+17, etc. the code would look like this.
CODE
if yoshi.islicking = 1{
if yoshi.image_index = 0 {x = yoshi.x+14}
if yoshi.image_index = 1 {x = yoshi.x+15}
if yoshi.image_index = 2 {x = yoshi.x+17}}


If you don't understand what I'm getting at (I can be confusing when explaining my GM reasoning) just ask.

EDIT: about the first question. The tongue should not always be in existence. A good way to do this is to create the tongue at yoshi.x when he starts to lick. The end step code that I listed before will take care of where the tongue is in relation to the animation.

And you'll want to use that sub image logic for the tongue too when it licks an enemy. Move the enemy based on the sub image of the tongue (because it grows and shrinks in the animation).

I get exactly what you're saying. That's actually the first idea that I had with trying to program yoshi's tongue. But I found that process to be a little too tedious to program for the enemies.

With this idea I'm trying to fix, all I would have to do with the enemies is make it follow the tongue and since the anchor point would be the tip of the tongue, I wouldn't have to worry about the positioning.
PMEmail Poster
Top
Unspecified
yoshi-warrior
Posted: Jul 4 2008, 02:48 PM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08

Status: (0d) [--]


QUOTE (Elyk @ Jul 2 2008, 02:53 PM)
rather than using speeds to move the tongue, why not just do the animation in the sprite?

Because the anchor point is the tip of the tongue. If I just used an animation, I'd have to find a way to make the enemy move according to each sprite frame (since they're different lengths).
By having the tip of the tongue be the anchor point, I can make the enemies look like they're sticking to the tongue.
PMEmail Poster
Top
Unspecified
Miaxis
Posted: Jul 4 2008, 03:03 PM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


some made a tut at the main site for that if you´re interested


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Unspecified
yoshi-warrior
Posted: Jul 4 2008, 03:16 PM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08

Status: (0d) [--]


QUOTE (Latia @ Jul 4 2008, 03:03 PM)
some made a tut at the main site for that if you´re interested

I took a look at those ones before, and the only problem is one of them uses hspeed(and I'm using "move to") with their movement, and the other doesn't move at all.
But one of them was helpful in putting together the basic coding for the one I have right now.
PMEmail Poster
Top
United States
Littlink
Posted: Jul 4 2008, 03:25 PM
Quote Post


hip 2b square
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 5146
Member No.: 2010
Joined: 11-April 06

Status: (0d) [--]


Draw the tongue where you need to, then it'll always be in the right place no matter what yoshi's doing ie jumping, runing, etc.


--------------------
[████████░░] 80%

user posted image
PMUsers WebsiteMSN
Top
Unspecified
yoshi-warrior
Posted: Jul 4 2008, 03:30 PM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08

Status: (0d) [--]


QUOTE (Littlink @ Jul 4 2008, 03:25 PM)
Draw the tongue where you need to, then it'll always be in the right place no matter what yoshi's doing ie jumping, runing, etc.

Could you give me a little more detail about that? I don't think I'm using the draw event, so I'm not too sure what you mean.
PMEmail Poster
Top
Unspecified
yoshi-warrior
Posted: Jul 4 2008, 09:20 PM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08

Status: (0d) [--]


Okay, I think I might have made a break through!
In the step event for the yoshi object, I have a script that I used for his movement controls. The original script looked like this(this is for the right key event):
CODE
if place_free(x+3,y-3) and !place_free(x+3,y){x+=3 y-=3}

Right now, I just changed it to this:
CODE
if place_free(x+3,y-3) and !place_free(x+3,y){x+=3 y-=3}{tongue_object.x+=3 tongue_object.y-=3}

Basically, I added a code to move the tongue when the Yoshi object goes up a slope.

Now there's only one thing that needs to be fixed:
When Yoshi is walking up against a wall and he shoots his tongue out, the tongue detaches from his mouth. I just gotta figure out how to make the tongue stay if there's something in front of it.
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Pages: (2) [1] 2  Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.1071 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 1.95 ]