Go to page Previous  1, 2, 3, 4, 5, 6 ... 41  Next  [ 816 posts ]  Reply to topicPost new topic 
Coding Help, Questions and Issues relating to coding
Author Message
 [gb]
 Post subject: Re: Coding Help
PostPosted: Wed May 15, 2013 7:58 pm 
I never really was on your side.
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
I actually found an extension which serves its purpose. I thank you for your time though!

Perhaps you can help with something else though. I would like to have a sprite's angle set to the direction of which I am pointing the analog stick. For example, I hold the analog stick up, and i want the image to be at 90 degrees for that. Any ideas?

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Coding Help
PostPosted: Wed May 15, 2013 9:46 pm 
Member
[*]
[*]
[*]
[*]
[*]

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

[*]
[*]
Which stick?
Left:
Code:
image_angle=point_direction(0,0,joystick_xpos(1)*10,joystick_ypos(1)*10);

Right (for Xbox 360 controllers):
Code:
image_angle=point_direction(0,0,joystick_upos(1)*10,joystick_rpos(1)*10);

_________________
"talk about dang ol' this ain't scientific rockets, man"
Spoiler:
Bibby Team - Nice little place. Give it a try.
 
Top
Offline 
 User page at mfgg.net
 
 [gb]
 Post subject: Re: Coding Help
PostPosted: Wed May 15, 2013 10:06 pm 
I never really was on your side.
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
Thank you a lot! It works great!

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Coding Help
PostPosted: Sun May 26, 2013 5:46 pm 
Member
[*]
[*]
[*]
[*]
[*]

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

[*]
I suppose this is a bump but how do you push an object (a block) in game maker?
I'll attach the .gmk to this post.

edit: aaand I can't add it as an attachment! Here's what I'm doing.

In the collision mario event for my 'pushblock' object, I have Check Object checking for Mario at x: 8 and y: 0. If so, it'll move his speed, which is Jump relative to position 3 or -3,0 respectively. I have no idea what i'm doing wrong. Mario just acts as if it's a it's solid, and thinks it's a sideways trampoline if it's not.

http://www.sendspace.com/file/liirlm


Last edited by Kirby's Adventure on Sun May 26, 2013 6:09 pm, edited 1 time in total.
_________________
Spoiler:
 
Top
Offline 
 
 
 [us]
 Post subject: Re: Coding Help
PostPosted: Sun May 26, 2013 6:00 pm 
User avatar
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
Put the .gmk on sendspace or some other hosting site and post the link. Drag and Drop is way harder to picture than code.

 
Top
Offline 
 
 
 [zz]
 Post subject: Re: Coding Help
PostPosted: Mon May 27, 2013 1:51 pm 
Member
[*]
[*]
[*]
[*]
[*]

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

[*]
Hey, guys, I'm having trouble with jump through platforms.

Here's a code for a normal nonsolid block (vertical floor collision) which for the most part works perfectly

Code:
platformID =  place_meeting(x,y+ymovementspeed,object0)
{if platformID and ymovementspeed > 0 //and y > platformID.y
 {var cc;
  cc = ymovementspeed + 1;
  while (!place_meeting(x,y+1,object0) and cc >= 0)      {y += 1;}
  onground = 1;
  jumping = 0;
  ymovementspeed = 0;
  repeat(round(random(2))+4)  {dust = instance_create(x+choose(-5,-4,-3,-2,-1,0,1,2,3,4,5),y+8,objDustCloud)};}}


and here's the one for a jumpthrough, which comes right after. Also nonsolid

Code:
//Jumpthrough platforms
platformID =  place_meeting(x,y+ymovementspeed,objBlockJumpThrough)
{if platformID == 1 and ymovementspeed > 0 and (!place_meeting(x,y,objBlockJumpThrough))
 {var cc;
  cc = ymovementspeed + 1;
  while ( (!place_meeting(x,y+1,objBlockJumpThrough) ) and cc >= 0)      {y += 1;}
  onground = 1;
  jumping = 0;

  ymovementspeed = 0;
  //if y > platformID.y {y = platformID.y;}
  repeat(round(random(2))+4)  {dust = instance_create(x+choose(-5,-4,-3,-2,-1,0,1,2,3,4,5),y+8,objDustCloud)};}}


pretty much the only thing different here is that I'm checking for an additional collision with the jumpthrough to see if the player is touching it in general rather than just y+vertical speed.
This code works okay, but the instant that the player comes into "general" contact with another jumpthrough, say one that's eye level to him while on another jumpthrough, he falls straight through the one he's currently walking on. I assume this is because I checked for the object and not the instance he is currently standing/walking on.

However, when I change !place_meeting(x,y,objBlockJumpThrough) to !place_meeting(x,y,platformID), the instance's ID, the player glitches up get's stuck in the platform while he's jumping and has presumably a positive vertical speed. This doesn't make any sense because the game is checking if he ISN'T generally intersecting with the platform, not if he IS.

Sorry, but changing any object's solidity is 100% out of the question because I need for all objects to always stay unsolid.

It's so frustrating. :/

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Coding Help
PostPosted: Tue May 28, 2013 2:32 pm 
User avatar
Stay fresh!
Member
[*]
[*]
[*]
[*]
[*]

[*]
@Wiiboy- Hmm... This is almost definitely a problem with checking the object instead of the instance. However, I can't seem to tell where the problem is at.
I'm guessing that this is for the same game that I attempted to help you debug before, but it wouldn't work on my computer. If you wanted, I could try it on my computer again and see if I can find a solution :D

_________________
It's a me, Superbowser! :cool:
 
Top
Offline 
 User page at mfgg.net
 
 [zz]
 Post subject: Re: Coding Help
PostPosted: Tue May 28, 2013 5:49 pm 
Member
[*]
[*]
[*]
[*]
[*]

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

[*]
superbowser wrote:
@Wiiboy- Hmm... This is almost definitely a problem with checking the object instead of the instance. However, I can't seem to tell where the problem is at.
I'm guessing that this is for the same game that I attempted to help you debug before, but it wouldn't work on my computer. If you wanted, I could try it on my computer again and see if I can find a solution :D
It's actually for a different engine with a similar............intent if you will.

Compared to the previous game, it's very early in development and has no FMOD stuff so it should literally give you no error at all. I can PM you the gmk again.

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Coding Help
PostPosted: Tue May 28, 2013 8:16 pm 
User avatar
Stay fresh!
Member
[*]
[*]
[*]
[*]
[*]

[*]
Ok, you can send it over whenever you get the chance. :D

_________________
It's a me, Superbowser! :cool:
 
Top
Offline 
 User page at mfgg.net
 
 [br]
 Post subject: Re: Coding Help
PostPosted: Sun Jun 23, 2013 1:06 am 
User avatar
I Have Returned®
Member
[*]
[*]
[*]
[*]
[*]

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

[*]
[*]
[*]
[*]
Hi peepz, I have a question (sorry if this is a bump)

There has been a lot of time since anti-aliasing and scaling filters was discussed on Game Maker Community (Yoyogames)
and all said it was impossible... but that time Game Maker was on its 6th version, so I don't know if it can be possible now.

Basically, I wanna know if now with GM8 or Studio, is possible to create games with the filtering you see on various
emulators and even the Mario Forever fangame, the filters: Scale 2x, 2xSai, Super Eagle, Hq2x, etc.

EDIT:
For further reference, take these examples:
Normal image:
Image
Resized 3x:
Image
Hq3x filter:
Image

and a site:
http://www.hiend3d.com/hq3x.html

_________________
 
Top
Offline 
 User page at mfgg.net
 
 [jp]
 Post subject: Re: Coding Help
PostPosted: Sun Jun 23, 2013 3:01 pm 
User avatar
Yeah, I don't Even...
Member
[*]
[*]
[*]
[*]
[*]

[*]
Nope, GMS nor it's previous incarnates naturally supporta that, so sorry.

_________________
Spoiler:
 
Top
Offline 
 User page at mfgg.net
 
 [ca]
 Post subject: Re: Coding Help
PostPosted: Sun Jun 23, 2013 7:40 pm 
User avatar
The Quantifiably Quip-tic QC Dude
Member
[*]
[*]
[*]
[*]
[*]

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

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

[*]
So I'm working on a textbox engine, similar to that of the Paper Mario games in which certain parts of text can have different colors and such. I already got the basic "letter-by-letter" typewriting thing down, so I thought about implementing a BB Code-style thing for the colors, but I'm absolutely lost on how to do it in GML.

Here's what I have so far:

Create:
Syntax: [ Download ] [ Hide ]
Using gml Syntax Highlighting
text_pos = 0;
text = "This is a [color=c_red]test[/color]."
text_spd = 2;

alarm[0] = 1;
 


Alarm 0:
Syntax: [ Download ] [ Hide ]
Using gml Syntax Highlighting
if ( text_pos <= string_length(text) )
{
     text_pos += 1;
     sound_play(snd_text_type);
     alarm[0] = text_spd;
}
 


Draw:
Syntax: [ Download ] [ Hide ]
Using gml Syntax Highlighting
draw_set_color(c_black);
draw_text(0, 0, string_copy(text, 1, text_pos));
 

_________________
<insert funny sig image here>

Image Refs - Something new's gonna show up here, I just know it! - DeviantArt - YouTubeImage
???!, 10%
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Coding Help
PostPosted: Sun Jun 23, 2013 8:01 pm 
User avatar
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
I suppose you're asking how to go about reading the [color=c_red] (open tag) and making Game Maker understand that you want to switch the color based on the value that was placed after the equal sign?

Also, you can simply use the Step Event instead of an Alarm Event for this type of thing.

 
Top
Offline 
 
 
 [ca]
 Post subject: Re: Coding Help
PostPosted: Sun Jun 23, 2013 8:07 pm 
User avatar
The Quantifiably Quip-tic QC Dude
Member
[*]
[*]
[*]
[*]
[*]

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

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

[*]
kremling wrote:
I suppose you're asking how to go about reading the [color=c_red] (open tag) and making Game Maker understand that you want to switch the color based on the value that was placed after the equal sign?

Also, you can simply use the Step Event instead of an Alarm Event for this type of thing.

Yes, that's it.

Also, the reason why I'm using the Alarm Event is because a sound plays when a new letter appears. I'm assuming there's a better way, though.

_________________
<insert funny sig image here>

Image Refs - Something new's gonna show up here, I just know it! - DeviantArt - YouTubeImage
???!, 10%
 
Top
Offline 
 User page at mfgg.net
 
 [rs]
 Post subject: Re: Coding Help
PostPosted: Tue Jun 25, 2013 8:22 am 
User avatar
Я твой слуга, Я твой работник
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
Hi, I'm making a Mario fangame with Game Maker 8.0, and I have a problem. Remember how in original Super Mario Bros. Goombas and Koopas walked in groups of 2 or 3? I decided to use that method for enemy movement in my game. Enemies move in groups and it's fine, but the problem is when they fall in pits. I want them to come back to their original positions when they fall in a pit. Since they are in groups, all 3 of them first have to fall in the pit and then come back. Can you people please help me solve the problem?

_________________
Image
 
Top
Offline 
 User page at mfgg.net
 
 [nl]
 Post subject: Re: Coding Help
PostPosted: Tue Jun 25, 2013 8:34 am 
User avatar
Wreck 'n get stomped
Member
[*]
[*]
[*]
[*]
[*]

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

[*]
[*]
[*]
Novak wrote:
Hi, I'm making a Mario fangame with Game Maker 8.0, and I have a problem. Remember how in original Super Mario Bros. Goombas and Koopas walked in groups of 2 or 3? I decided to use that method for enemy movement in my game. Enemies move in groups and it's fine, but the problem is when they fall in pits. I want them to come back to their original positions when they fall in a pit. Since they are in groups, all 3 of them first have to fall in the pit and then come back. Can you people please help me solve the problem?

Let's say there's a group of 3 enemies.Then, in each enemy's code (enemies of that group only), put the following. EDIT: fixed some things, don't use the old code!

Syntax: [ Download ] [ Hide ]
Using gml Syntax Highlighting
//Step event
if y > room_height && canfall = true
{
canfall = false
global.mygroup -= 1
}

//Be sure this is in ONE of the group enemies' code only, else it will mess up
if global.mygroup = 0
{
//Regenerating code here
global.mygroup = 3 //NECESSARY!
}

//Create event
canfall = true
global.mygroup = 3


Hope this helped.

_________________
My Youtube | My Twitter
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Coding Help
PostPosted: Tue Jun 25, 2013 12:20 pm 
User avatar
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
I don't think you can use a gloval variable for multiple if instances. Instead why don't you create a leader object. This leader object will create a number of instances to be involved in a group. You must keep track of the instance ids however because they will used check whether someone in the group is gone. I'll have to rewrite so it'll make more sense, but currently I am on my mobile device.

 
Top
Offline 
 
 
 [rs]
 Post subject: Re: Coding Help
PostPosted: Tue Jun 25, 2013 12:31 pm 
User avatar
Я твой слуга, Я твой работник
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
Thanks for solving my problem WreckingGoomba and kremling, now I know what to do.

_________________
Image
 
Top
Offline 
 User page at mfgg.net
 
 [nl]
 Post subject: Re: Coding Help
PostPosted: Tue Jun 25, 2013 12:55 pm 
User avatar
Wreck 'n get stomped
Member
[*]
[*]
[*]
[*]
[*]

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

[*]
[*]
[*]
No problem, glad we could help ;)

_________________
My Youtube | My Twitter
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Coding Help
PostPosted: Tue Jun 25, 2013 1:50 pm 
User avatar
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
@Yoshbert: Any luck on your text engine? I'll look into your problem today if you haven't alread found a solution.

 
Top
Offline 
 
 
« Previous topic | Next topic »
Display posts from previous:  Sort by  
Go to page Previous  1, 2, 3, 4, 5, 6 ... 41  Next  [ 816 posts ]  Reply to topicPost new topic 


Who is online

Users browsing this topic: No registered users and 3 guests


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group