MFGG phpBB Message Boards Archive
https://phpbb.mfgg.net/

Coding Help
https://phpbb.mfgg.net/viewtopic.php?f=10&t=14053
Page 1 of 41

Author:  Shadow Kami [ Thu Jan 31, 2013 4:54 pm ]
Post subject:  Coding Help

Well since it looks like it's a good Idea this'll be a general "coding help" thread,
This is help reduce the clutter of topics thatask questions relating to code of some sort, and it'll actually help people get the help they need.
The jist is that we'll help you out with coding issues or questions, but won't program what your doing for you or it'll defeat the purpose of helping people learn.

So we have some people that are quite able to use coding so I'll list differet people that feel they're able to help, also feel free to say something if you want to be listed here, as it may be useful in the future:
Spoiler:


Original Post:
Spoiler:

Author:  TheShyGuy [ Thu Jan 31, 2013 5:08 pm ]
Post subject:  Re: GM/Gamemaking Support Thread? Opinions?

I think thats a good idea. I don't use gamemaker, but i can help out with other questions relating to stuff like c#, java, directX*, openGL*, or xna. I know not many here even use what i mentioned, but if a question ever comes up, i can help.

*i have experience using directX, but i didn't go deep into it. I probably have intermediate experience with it. I don't use it anymore since im learning sfml and openGL for crossplatform support. I don't use xna anymore either.

*im learning openGL right now but its a bit similar to directX.

Author:  Vimimin [ Thu Jan 31, 2013 5:13 pm ]
Post subject:  Re: GM/Gamemaking Support Thread? Opinions?

I personally think this would be a fine idea - it would put an end to any cluster of threads asking simple questions about code and whatnot, and it would be rather helpful to people in need of answers to said questions, among other things.

Actually, a general "Coding Help" megathread wouldn't be a bad idea, honestly.

Also, for future reference, this thread should be in the Developer Discussion, not the General Chat :)

Author:  TheShyGuy [ Thu Jan 31, 2013 5:15 pm ]
Post subject:  Re: GM/Gamemaking Support Thread? Opinions?

I agree with the general coding help thing. A recent question was about how to have the player move ontop of a moving platform. Thats less of a gm question and more of a design one.

Author:  Shadow Kami [ Thu Jan 31, 2013 5:25 pm ]
Post subject:  Re: Coding Help

M'kay I'll report this so a mod can move it over.

Edit: Well, since it's been moved, it is in the right place now.

So if anyone needs coding help, or such post your questions and/or issues here.

Author:  Doc [ Thu Jan 31, 2013 5:51 pm ]
Post subject:  Re: Coding Help

I can code a bit of GMK myself. I'm not a pro, but I can easily spot out errors and miscalculations.

Author:  Goombaking123 [ Sat Feb 02, 2013 10:39 am ]
Post subject:  Re: Coding Help

Does anyone know how to make a fight like it in Game Maker? Right now all my boss does is shoot fireballs and can be hurt via stomping. Anyways, I need the object to act like this:
•It can't go in the same pipe/hole.
•Once the object leaves the room, it pops up in an other pipe/hole in a few seconds.
That's pretty much it, so I hope someone could help me. If needed, I'll send you what I have coded.

Author:  Shadow Kami [ Sat Feb 02, 2013 10:47 am ]
Post subject:  Re: Coding Help

Well if you need a basic Idea on how to do it, you can use variables to set states, you can use those states to identify wether it's rising up out of the pipe, going down into it, etc.

You can use a simple randomiser script that has a certain amount of variables per pipe, and you can make each of the dummies and lemmy select a "pipe" using the variables, and then make it so that it can only select a pipe if theres not a dummy or a lemmy object present.

TBH I feel it's bettr to explain what id does instead of copying and pasting as it'll help the person who's code it is get better at coding.
If your unable to use this explaination as a guild feel free to ask for more specifics.

Author:  FireSeraphim [ Thu Feb 07, 2013 11:14 pm ]
Post subject:  Re: Coding Help

I have come up against a pair of fomidiable problem. I am trying to get GMFMOD to cooperate with the engine I'm using and so far I managed to get it to play the titlescreen BGM properly and it also plays the intended maptheme as well but here's the rub.

1.The Titlescreen BGM continues to play and plays over the Hubmap BGM
2.When I load a savefile with the engine I'm working on there will be no music whatsoever.

Gentlemen, I have reasons to assume that the problem is more complicated then I can handle, due to the fact that I implemented GMFMOD properly and I'm still running into these problems. If anyone, anyone whatsoever is willing to help me I would gladly send a copy of my dev files so you can see the problem for yourself since my words only give a gist of the problem. I believe the culprit lies in the way the engine itself is coded.

Author:  Miles [ Thu Feb 07, 2013 11:17 pm ]
Post subject:  Re: Coding Help

As for the titlescreen music continuing to play, are you stopping the instance? FMOD uses sound instances, like variable=FMODfunctionname(derpy); where variable is the instance you'll want to keep track of either globally or in a persistent object. I'll take a look at your thing and try to help if you want; I'm really experienced with it.

Author:  FireSeraphim [ Fri Feb 08, 2013 12:26 am ]
Post subject:  Re: Coding Help

@Miles: I could be mistaken but I could have sworn that I sent you a PM.

Author:  Miles [ Fri Feb 08, 2013 12:34 am ]
Post subject:  Re: Coding Help

I got it, and fixed it. Just gotta write up a change log so I can explain what's up; I'll send a PM shortly.

Author:  Pyro [ Sat Feb 09, 2013 6:38 pm ]
Post subject:  Re: Coding Help

How do you make things happen after a sound sample is done playing?

Author:  Fez [ Mon Feb 11, 2013 12:41 am ]
Post subject:  Re: Coding Help

Sort of depends what you're doing and how you want to do it, but you could use 'if sound_soundplaying' to check if it's playing, and if it isn't, make the object do something.
Alternatively, you can set an alarm and time it so it goes off when the sound is done.

EDIT: I'm assuming you're using gamemaker. If not, I'm sure the concept would transfer.

Author:  Pyro [ Mon Feb 11, 2013 8:31 am ]
Post subject:  Re: Coding Help

Thanks.

Author:  behind [ Sun Mar 17, 2013 4:28 pm ]
Post subject:  Re: Coding Help

I'm looking for a code that allows single-sprite animations. That is, having all your sprites in one, instead of having massive globs of sprite resources and such. I know several Sonic engines use this, but they tend to be really complicated and.....confusing.

Author:  smbmaster99 [ Sun Mar 17, 2013 4:33 pm ]
Post subject:  Re: Coding Help

Wiiboy4ever wrote:
I'm looking for a code that allows single-sprite animations. That is, having all your sprites in one, instead of having massive globs of sprite resources and such. I know several Sonic engines use this, but they tend to be really complicated and.....confusing.

Dragezeey's latest engine (dragezeey engine 7) has single-sprite-animations for each of his powerups. How about you try looking into that?

Author:  Mr. Yoshbert [ Sun Mar 17, 2013 5:09 pm ]
Post subject:  Re: Coding Help

Wiiboy4ever wrote:
I'm looking for a code that allows single-sprite animations. That is, having all your sprites in one, instead of having massive globs of sprite resources and such.

Coincidentally, I was looking for something like this as well. While scouring various threads at the GMC forums, I eventually came across this neat little thing:

Create Event:
Syntax: [ Download ] [ Hide ]
Using gml Syntax Highlighting
image_speed = 0; // Set this to 0 since we're going to be controlling the speed of the animation
anim_frame = 0; // The current frame of our custom animation
anim_speed = 0.25; // The animation speed, which replaces image_speed.
anim_seq = "00|01"; // This is a string containing the actual sequence of your custom animation, so in this case, there's two frames, subimage 24 and 25.  The "|" character is there for readability sake and will be removed in the step event.  This is the variable you will change to switch animations.  You need to have each frame as two characters though, so if, for instance, you wanted to cycle through the first three subimages, you would set this as "00|01|02"
 

Step Event (any one will do):
Syntax: [ Download ] [ Hide ]
Using gml Syntax Highlighting
var max_frames, seq;

seq = string_replace_all(anim_seq, "|", ""); // This removed the "|" character to allow the program to read the animation sequence easier

max_frames = string_length(seq) / 2; // This gets he number of frames in the animation by taking the length of the string and dividing it by the number of digits for the subimages, in this case 2.

// The following block of code cycles the animation frames
if (anim_speed >= 0)
{
    // Cycle frame forward
    anim_frame = (anim_frame + anim_speed) mod max_frames;
}
else
{
    // Cycle frame backward
    anim_frame = ((anim_frame + anim_speed mod max_frames) + max_frames) mod max_frames;
}

image_index = real(string_copy(seq, 1 + (2 * floor(anim_frame)), 2)); // Finally, this pulls the correct subimage from the sequence based on the current frame of our custom animation.
 

This topic is where I found the code, by the way.

Author:  behind [ Sun Mar 17, 2013 5:34 pm ]
Post subject:  Re: Coding Help

@SMBM77: Oh, but I thought he didn't release his engine 7?

@Yoshbert: work's wonderfully, thanks!

Author:  Kirby's Adventure [ Fri Mar 29, 2013 10:28 pm ]
Post subject:  Re: Coding Help

How do you do a falling sprite? GM DnD please.

Page 1 of 41 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/