Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12  Next  [ 231 posts ]  Reply to topicPost new topic 
Author Message
 [nl]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Fri Oct 25, 2013 3:00 pm 
User avatar
Wreck 'n get stomped
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
Might be, but sometimes longer but simpler code is easier than short code. I made my script as simple as possible so everyone with minor knowledge about GML can understand it (at least a bit).

_________________
My Youtube | My Twitter
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Fri Oct 25, 2013 4:22 pm 
User avatar
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
WreckingGoomba wrote:
Might be, but sometimes longer but simpler code is easier than short code. I made my script as simple as possible so everyone with minor knowledge about GML can understand it (at least a bit).
I ran your code and your collision is annoyingly buggy. :/ It's really to be expected when you set "obj_solid" to "Solid" and use Game Maker's move_contact_solid(...) method as you have done.

 
Top
Offline 
 
 
 [nl]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Fri Oct 25, 2013 4:25 pm 
User avatar
Wreck 'n get stomped
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
kremling wrote:
WreckingGoomba wrote:
Might be, but sometimes longer but simpler code is easier than short code. I made my script as simple as possible so everyone with minor knowledge about GML can understand it (at least a bit).
I ran your code and your collision is annoyingly buggy. :/ It's really to be expected when you set "obj_solid" to "Solid" and use Game Maker's move_contact_solid(...) method as you have done.

What's buggy about it? I tested it myself and I couldn't find any bugs.

_________________
My Youtube | My Twitter
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Fri Oct 25, 2013 4:45 pm 
User avatar
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
I'll edit this post as I see things that are not as they should be.

[1]: You don't set myfriction to zero upon collision with a solid. This then causes the object to become lodged into the wall for a split second.
Code:
-- your code previously

//Adds friction
if(myfriction > 0 && place_free(x+myfriction+1,y)) or (myfriction < 0 && place_free(x-myfriction-1,y))
x += myfriction;

-- your code modified
if(myfriction > 0 && place_free(x+myfriction+1,y)) or (myfriction < 0 && place_free(x+(myfriction-1),y))
x += myfriction;
else myfriction = 0;

// notice that all I simply did was added an 'else statement' and set myfriction to zero. Also, notice how I changed 'x-myfriction-1' to 'x+(myfriction-1)'. You previous code had incorrect arithmetic.


 
Top
Offline 
 
 
 [ca]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Fri Oct 25, 2013 7:35 pm 
User avatar
No games
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
I'll bring up my how-to from the mainsite.
http://www.mfgg.net/index.php?act=resdb ... 4&id=29123
Name: Basic Superball Engine
Program: Game Maker 8
User: UltLuigi
Registered: No.

_________________
Spoiler:

Refs: ~CaMTenDo~: http://i45.tinypic.com/2cfv0xk.png supernova: http://i50.tinypic.com/16gd4h.png kremling: http://i105.photobucket.com/albums/m206/KiddyKong/ultluigi_zps2612660b.png Mit:http://i.imgur.com/eW2W9zl.png
Dustinvgmaster wrote:
Because I'm over here being a doofus, almost everyone else is cruelly denying and Ult is offering beverages for some reason
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Fri Oct 25, 2013 8:03 pm 
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
But it isn't caveman friendly...

_________________
Spoiler:
 
Top
Offline 
 
 
 [ca]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Fri Oct 25, 2013 8:14 pm 
User avatar
No games
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
LuigiM9 wrote:
But it isn't caveman friendly...

an example doesn't need to be "caveman friendly" to be useful.

_________________
Spoiler:

Refs: ~CaMTenDo~: http://i45.tinypic.com/2cfv0xk.png supernova: http://i50.tinypic.com/16gd4h.png kremling: http://i105.photobucket.com/albums/m206/KiddyKong/ultluigi_zps2612660b.png Mit:http://i.imgur.com/eW2W9zl.png
Dustinvgmaster wrote:
Because I'm over here being a doofus, almost everyone else is cruelly denying and Ult is offering beverages for some reason
 
Top
Offline 
 User page at mfgg.net
 
 [nl]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sat Oct 26, 2013 6:31 am 
User avatar
Wreck 'n get stomped
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
kremling wrote:
I'll edit this post as I see things that are not as they should be.

[1]: You don't set myfriction to zero upon collision with a solid. This then causes the object to become lodged into the wall for a split second.
<code>

Thanks! Did you mention any other problems?

_________________
My Youtube | My Twitter
 
Top
Offline 
 User page at mfgg.net
 
 [nl]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Fri Jan 10, 2014 3:38 pm 
User avatar
Wreck 'n get stomped
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
Name: sprite_flash(wait time, total flash times)
Program: GameMaker 8.0 (but it will probably work with earlier versions as well)
User: WreckingGoomba
Registered: No

Syntax: [ Download ] [ Hide ]
Using gml Syntax Highlighting
//sprite_flash(wait time, total flash times)
//call this in the step event if you want your object to 'flash'
//the script basically toggles the visibility when needed

if finished = false
{
    timer += 1
    if timer >= argument0
    {
        timer = 0
        visible = !visible
        total += 1
    }
   
    if total >= argument1
    {
        finished = true
        visible = true
        timer = 0
        total = 0
    }
}

_________________
My Youtube | My Twitter
 
Top
Offline 
 User page at mfgg.net
 
 [nl]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sun Jan 19, 2014 2:15 pm 
User avatar
Wreck 'n get stomped
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
Name: random_ext(min,max)
Program: GameMaker 8.0 (but it will probably work with earlier versions as well)
User: WreckingGoomba
Registered: No

Syntax: [ Download ] [ Hide ]
Using gml Syntax Highlighting
//random_ext(min,max)
//returns a random number between min and max

myrandomnumber = random(argument1-argument0) + argument0
return myrandomnumber

_________________
My Youtube | My Twitter
 
Top
Offline 
 User page at mfgg.net
 
 [tr]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sun Jan 19, 2014 2:21 pm 
User avatar
Thanks DonnieTheGuy!
Administrator
[A]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
random_range?

_________________
Image
 
Top
Offline 
 
 
 [nl]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sun Jan 19, 2014 2:30 pm 
User avatar
Wreck 'n get stomped
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
Mors wrote:
random_range?

Oh, it already existed? Well, ignore my script then :whoops:

_________________
My Youtube | My Twitter
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Mon Jan 20, 2014 9:21 am 
User avatar
Lawful Evil
Member
[*]
[*]
[*]
[*]
[*]

[*]
Here's a handy script that I've used in Magikoopa Security Force for quite a few objects with homing capabilities.

Name: moveToAngle(startDirection,goalDirection)
Program: GameMaker 8.0 (Should be fine in later versions, too)
User: Magnemania
Registered: No

Syntax: [ Download ] [ Hide ]
  1. //argument0: current direction 
  2. //argument1: direction to face 
  3. compareDirection = argument1; 
  4. compareDirection -= argument0; 
  5. if (compareDirection < 0) 
  6. compareDirection = 360+compareDirection; 
  7. if (compareDirection > 180) 
  8. plusMinus = -1; 
  9. else 
  10. plusMinus = 1; 
  11. return plusMinus; 


This code compares the first direction with the second direction and provides an increment of 1 to get the first direction closer to the second; a usage of this code to make something home in on a position, for example:
Code:
direction += moveToAngle(direction,point_direction(x,y,Target.x,Target.y))

_________________
Image
Magikoopa Security Force, the Mario Action-Strategy game!
  It's time to fight for Bowser!
 
Top
Offline 
 User page at mfgg.net
 
 [es]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Mon Jan 20, 2014 5:39 pm 
User avatar
I'm just a little adorable kitty :3
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

UPDATE 20/01/2014

- Added 4 new scripts.

- Removed 1 script due non working link.

@Magnemania: You may want to add some indent on that code :)

_________________
Image ImageImageImageImageImageImage Image
~ Supernova / Drawerkirby (2) / Gato / Neweegee (2) (3) ~
"shy guys are wall plugs confirmed" - Vitiman on Club Saturn Ex
Image
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sat Jan 25, 2014 1:07 am 
Always have Jason Voorhees in your sig
Member
[*]
[*]
[*]
[*]
[*]

The following links are broken:

FANGAME SOURCES
DrJellik SMB3 Engine
Open Source SMB1 Engine
Open Source SMB2 Engine

TUTORIALS
CCBasics
Fixed Camera Exploration
Level Editor Engine (link isn't broken, but anchors to a comment)
Pause Menu How-to
SMW Keyhole Example

SCRIPTS/CODING
minmax(lowval,midval,highval) (perhaps not broken, but says I'm not authorized to view that forum)

_________________
Image

Image Image
Bibby Team | MFGG3 Github
 
Top
Offline 
 User page at mfgg.net
 
 [es]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sat Jan 25, 2014 5:01 am 
User avatar
I'm just a little adorable kitty :3
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

Thank you for reporting these, I was able to fix the following links.

- DrJellik SMB3 Engine
- Open Source SMB1 Engine
- Open Source SMB2 Engine
- Level Editor Engine
- Pause Menu How-to

The other ones sadly have been deleted.

_________________
Image ImageImageImageImageImageImage Image
~ Supernova / Drawerkirby (2) / Gato / Neweegee (2) (3) ~
"shy guys are wall plugs confirmed" - Vitiman on Club Saturn Ex
Image
 
Top
Offline 
 User page at mfgg.net
 
 [aq]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sat Feb 01, 2014 6:31 pm 
User avatar
Obey.
Member
[*]
[*]
Reuploaded SMW Keyhole Example:
https://dl.dropboxusercontent.com/u/873 ... inary1.zip

_________________
I am your supreme leader
 
Top
Offline 
 User page at mfgg.net
 
 [es]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sat Feb 01, 2014 6:34 pm 
User avatar
I'm just a little adorable kitty :3
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

DarkBlueYoshi wrote:


Thanks for reuploading.

BTW, this is SDL right?

_________________
Image ImageImageImageImageImageImage Image
~ Supernova / Drawerkirby (2) / Gato / Neweegee (2) (3) ~
"shy guys are wall plugs confirmed" - Vitiman on Club Saturn Ex
Image
 
Top
Offline 
 User page at mfgg.net
 
 [aq]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sat Feb 01, 2014 6:37 pm 
User avatar
Obey.
Member
[*]
[*]
Yeah, it's SDL 1.2.

_________________
I am your supreme leader
 
Top
Offline 
 User page at mfgg.net
 
 [es]
 Post subject: Re: Engine / Tutorial Topic
PostPosted: Sat Feb 01, 2014 6:41 pm 
User avatar
I'm just a little adorable kitty :3
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

K, added

_________________
Image ImageImageImageImageImageImage Image
~ Supernova / Drawerkirby (2) / Gato / Neweegee (2) (3) ~
"shy guys are wall plugs confirmed" - Vitiman on Club Saturn Ex
Image
 
Top
Offline 
 User page at mfgg.net
 
« Previous topic | Next topic »
Display posts from previous:  Sort by  
Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12  Next  [ 231 posts ]  Reply to topicPost new topic 


Who is online

Users browsing this topic: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group