MFGG Forums
  • Home
  • Members
  • Help
  • Search
MFGG Main Site MFGG Forums MFGG Developer Discussion v
« Previous 1 … 12 13 14 15 16 Next »
(trash, do not read)
MFGG Forums MFGG Developer Discussion v
« Previous 1 … 12 13 14 15 16 Next »
(trash, do not read)
MFGG Forums MFGG Developer Discussion v
« Previous 1 … 12 13 14 15 16 Next »
(trash, do not read)
Mark All Posts Read Today's Posts

(trash, do not read)
United States mrpin355
Actually feel like engaging here again
Members
Submitter Iso Collab Contributor MFGG 19th Anniversary
#1
03-31-2018, 04:22 PM (This post was last modified: 05-23-2020, 10:54 PM by mrpin355.)
While this thread is active.

I got a issue dealing with Wiggler's body parts, and I seriously want help, the fact that I tried many methods but it won't work and "Developer Discussion" is the least active thread of this site.

The problem is that whenever it instantly moves horizontally 8 pixels, specifically, shifting itself while on the slopes it jumps *number depending how steep the slopes is* pixels up,
I know why that happens, but I need a better method that solves this problem.

Here is a screenshot visually portraying it:
[Image: issue.png]
Wiggler is flashing


Thanks.

  ↳
United States Willsaber
Kootie Pie is My Girl
Members
Submitter Iso Collab Contributor (2) Sprite Comp Runner-Up Sprite Comp Top 5 Minigame Comp Winner Minigame Comp Runner-Up Minigame Comp Top 5 Music Comp Winner Music Comp Top 5 Skull Badge E3 Bingo Golden Skull Badge NCFC Contributor Secret Santa Holiday Tree KFC Badge MFGG Awards 2015 Winner
#2
04-02-2018, 12:49 AM
Some more information would help in diagnosing the issue. What kind of collision checking are you using?
Making terrible posts since 2014

  ↳
United States mrpin355
Actually feel like engaging here again
Members
#3
04-02-2018, 05:20 PM (This post was last modified: 04-02-2018, 05:20 PM by mrpin355.)
(04-02-2018, 12:49 AM)Willsaber Wrote: Some more information would help in diagnosing the issue. What kind of collision checking are you using?

I use collision_rectangle for these situations.

  ↳
China Hyper
Ambitious but too burnt out
Members
assholw adminy Big Help Submitter Super Reviewer Wiki Contributor Iso Collab Contributor Sprite Comp Winner (3) Sprite Comp Runner-Up (4) Sprite Comp Top 5 (2) Minigame Comp Winner (4) Minigame Comp Runner-Up (2) Music Comp Winner Music Comp Runner-Up Music Comp Top 5 Drawing Comp Winner (3) Drawing Comp Runner-Up Drawing Comp Top 5 (5) Special Comp Winner Egg Hunter (3) Skull Badge (2) E3 Bingo Game of the Month Winner (5) NCFC Contributor (4) Secret Santa (5) Holiday Tree NPGA Distinguished Service MFGG 17th Anniversary MFGG 18th Anniversary MFGG 19th Anniversary Ye Olde MFGGe Retro Game Jam Participant MFGG Awards 2010 Winner MFGG Awards 2012 Winner MFGG Awards 2013 Winner MFGG Awards 2014 Winner MFGG Awards 2015 Winner MFGG Awards 2018 Winner MFGG Awards 2019 Winner MFGG Awards 2020 Winner
#4
04-02-2018, 10:45 PM
Please post your codes here using
Code:
[code]//code here[ / code] (remove the spaces between "/")
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
United States mrpin355
Actually feel like engaging here again
Members
#5
04-02-2018, 11:26 PM (This post was last modified: 04-04-2018, 05:28 PM by mrpin355.)
Before reading the code, It's a modified Hello's Wiggler object.
I might hear I should make my own.

Stun code
Code:
//Stop body parts
   for (i=0; i<maxpart; i++) {
  
       //Affect parts animation
       with (part[i]) {
      
           //Freeze
           image_speed = 0;
           hspeed = 0;
          
           //Stop turn sequence
           timerstart = 0;
          
           //Snap the parts
           x = behind.x-offset*xscale;
          
           //Turn him into a "accordion"!
           offset = 3;
       }

Slope logic
Code:
//Embed into the slope to ensure correct slope mechanics
if (collision_rectangle(bbox_left,bbox_bottom,bbox_right,bbox_bottom+4,obj_slopeparent,1,0))
and (!collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-4,obj_slopeparent,1,0))
and (vspeed = 0)
   y += 4;

///Handle slope collisions
if (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
&& (!collision_rectangle(bbox_left,bbox_bottom-8,bbox_right,bbox_bottom-8,obj_slopeparent,1,0)) {

   //Stay embed on the slope.
   while collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0)
       y--;
}

When spawned
Code:
//Create anatomy
part[0] = instance_create(x,y,obj_wiggler_body) {

   part[0].image_index = 0;
   part[0].depth = -1
   part[0].parent = id;
   part[0].behind = other.id; //Snaps to the head
}
part[1] = instance_create(x,y,obj_wiggler_body) {

   part[1].image_index = 1;
   part[1].depth = 0
   part[1].behind = part[0];//Snaps to the previous body and so on.
   part[1].parent = id;
}
part[2] = instance_create(x,y,obj_wiggler_body) {

   part[2].image_index = 2;
   part[2].depth = 1
   part[2].behind = part[1];
   part[2].parent = id;
}
part[3] = instance_create(x,y,obj_wiggler_body) {

   part[3].image_index = 3;
   part[3].depth = 2
   part[3].behind = part[2];
   part[3].parent = id;
}

If you need more, let me know.

Anyone here?
A new signature is on the works but have this:
[Image: lol.gif]

  ↳
United States mrpin355
Actually feel like engaging here again
Members
#6
04-06-2018, 09:18 PM (This post was last modified: 04-06-2018, 09:20 PM by mrpin355.)
If the screenshot is not enough.

Here is a .gif showing it on action!
[Image: image.gif]
A new signature is on the works but have this:
[Image: lol.gif]

  ↳
China Hyper
Ambitious but too burnt out
Members
#7
04-07-2018, 03:15 PM
Comment out this in the stun code:
Code:
x = behind.x-offset*xscale;
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
United States mrpin355
Actually feel like engaging here again
Members
#8
04-07-2018, 03:48 PM (This post was last modified: 04-07-2018, 03:50 PM by mrpin355.)
(04-07-2018, 03:15 PM)Hypernova Wrote: Comment out this in the stun code:
Code:
x = behind.x-offset*xscale;

It makes the body part snap to it's assigned behind body parts.
Functions purpose is when it's stunned or when it makes a turn.
'offset' means the width of the body.
A new signature is on the works but have this:
[Image: lol.gif]

  ↳
China Hyper
Ambitious but too burnt out
Members
#9
04-07-2018, 10:19 PM (This post was last modified: 04-07-2018, 10:20 PM by Hyper.)
You intended to make the Wiggler to shorten itself when hit, however the y position is not set during the processes. I would recommend to do this:

Instead of:
Code:
//Snap the parts
x = behind.x-offset*xscale;

//Turn him into a "accordion"!
offset = 3;

Do this
Code:
//Turn him into a "accordion"!
offset = 3;

//Snap the parts
x = behind.x-offset*xscale;

if (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
{
   do
   {
       y--;
   }
   until !(collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))
}
else
{
   do
   {
       y++;
   }
   until (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
}
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC

[-] The following 1 user Likes Hyper's post:1 user Likes Hyper's post
  ↳ mrpin355
United States mrpin355
Actually feel like engaging here again
Members
#10
04-07-2018, 10:44 PM
(04-07-2018, 10:19 PM)Hypernova Wrote: Do this
Code:
//Turn him into a "accordion"!
offset = 3;

//Snap the parts
x = behind.x-offset*xscale;

if (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
{
   do
   {
       y--;
   }
   until !(collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))
}
else
{
   do
   {
       y++;
   }
   until (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
}

Thanks, but for some reason GameMaker reads it as 'Unexpected symbol'.
A new signature is on the works but have this:
[Image: lol.gif]

  ↳
China Hyper
Ambitious but too burnt out
Members
#11
04-07-2018, 11:38 PM
Are you using Game Maker 8, Studio, or Studio 2? Is there a reference that points out the unexpected code error?
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
United States mrpin355
Actually feel like engaging here again
Members
#12
04-07-2018, 11:39 PM
(04-07-2018, 11:38 PM)Hypernova Wrote: Are you using Game Maker 8, Studio, or Studio 2? Is there a reference that points out the unexpected code error?
I'm using Studio 1.4 and it doesn't point out why.
A new signature is on the works but have this:
[Image: lol.gif]

  ↳
China Hyper
Ambitious but too burnt out
Members
#13
04-07-2018, 11:48 PM
Let's see if this helps:

Change this:
Code:
until !(collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))

To this:
Code:
until (!collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
United States mrpin355
Actually feel like engaging here again
Members
#14
04-08-2018, 12:15 AM
(04-07-2018, 11:48 PM)Hypernova Wrote: Let's see if this helps:

Change this:
Code:
until !(collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))

To this:
Code:
until (!collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))


[Image: image.png]
Unfortunately, it still doesn't work.
I recommend you test it before you publish the code.
If you want, I could PM and give you the object and diagnose it.
A new signature is on the works but have this:
[Image: lol.gif]

  ↳
China Hyper
Ambitious but too burnt out
Members
#15
04-08-2018, 12:38 AM (This post was last modified: 04-08-2018, 12:39 AM by Hyper.)
I am currently using Game Maker: Studio 1.4.1804. I have tested out the code without any issues:
[Image: Test_Dolphin.png]

Some older version of Game Maker Studio may have issues like this, please update the game engine and see if that helps.

My end of result:
[+]Spoiler
[Image: image.png]
Reference of do/until statement:
https://docs.yoyogames.com/source/dadios...10_do.html
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
United States mrpin355
Actually feel like engaging here again
Members
#16
04-08-2018, 12:48 AM
(04-08-2018, 12:38 AM)Hypernova Wrote: I am currently using Game Maker: Studio 1.4.1804. I have tested out the code without any issues:
[Image: Test_Dolphin.png]

Some older version of Game Maker Studio may have issues like this, please update the game engine and see if that helps.

My end of result:
[+]Spoiler
[Image: image.png]
Reference of do/until statement:
https://docs.yoyogames.com/source/dadios...10_do.html
I'm using 1.4.1804 as well.
Wtf is going on?
Like, did I accidentally do a minor change?
A new signature is on the works but have this:
[Image: lol.gif]

  ↳
China Hyper
Ambitious but too burnt out
Members
#17
04-08-2018, 12:50 AM
Clear its compiler cache and restart the program would be a typical solution in most cases.
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
United States mrpin355
Actually feel like engaging here again
Members
#18
04-08-2018, 12:53 AM (This post was last modified: 04-08-2018, 01:38 AM by mrpin355.)
N/A

(04-08-2018, 12:50 AM)Hypernova Wrote: Clear its compiler cache and restart the program would be a typical solution in most cases.

Sorry for annoying you, but this time the problem is fixed!

Thanks for helping!
Topic disclosed.


for now...
A new signature is on the works but have this:
[Image: lol.gif]
[-] The following 1 user Likes mrpin355's post:1 user Likes mrpin355's post
  ↳ Hyper
China Hyper
Ambitious but too burnt out
Members
#19
04-08-2018, 02:34 AM
Since I am not able to DM you (Error message: Existant has private messaging disabled. You cannot send private messages to this user.), I'll just post an alternative solution here:

Code:
if (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
{
  do
  {
      y--;
  }
  until !(collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))
}
else if (collision_rectangle(bbox_left,bbox_bottom+1,bbox_right,other.bbox_bottom+32,obj_slopeparent,1,0))
{
  do
  {
      y++;
  }
  until (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
}
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
United States mrpin355
Actually feel like engaging here again
Members
#20
04-08-2018, 10:47 AM (This post was last modified: 04-08-2018, 10:50 AM by mrpin355.)
(04-08-2018, 02:34 AM)Hypernova Wrote: Since I am not able to DM you (Error message: Existant has private messaging disabled. You cannot send private messages to this user.), I'll just post an alternative solution here:

Code:
if (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
{
do
{
     y--;
}
until !(collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-1,obj_slopeparent,1,0))
}
else if (collision_rectangle(bbox_left,bbox_bottom+1,bbox_right,other.bbox_bottom+32,obj_slopeparent,1,0))
{
do
{
     y++;
}
until (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
}

And this time it worked!
Thanks for your big help!
I was trying to fix that problem like in 2 months!
[-] The following 1 user Likes mrpin355's post:1 user Likes mrpin355's post
  ↳ Hyper
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • View a Printable Version
Forum Jump:

Mario Fan Games Galaxy - Powered by MyBB | MFGG Staff | Contact Us

Linear Mode
Threaded Mode