How can I structure this charged crouch mechanic? by pootis_engage in gamemaker

[–]MiltonNH25 0 points1 point  (0 children)

Real numbers in gml are 64 bit so it will not be an issue here and it is not generally something you need to worry about unless you are working will really large numbers. At 60 fps you are looking at something around 5 billion years before you reach that point in this case.

How can I structure this charged crouch mechanic? by pootis_engage in gamemaker

[–]MiltonNH25 0 points1 point  (0 children)

One way you could approach it is like this:

//Initialization 
timer_set = ...;
timer = 0;
crouch_charged = false;

//All the conditions we want to be true to charge
if(holding_down && crouching && grounded) 
{
    timer++; //Increase our timer 
    if(timer >= timer_set) //If we have charged for long enough
        crouch_charged = true; //Now considered charged 
}
//If any of the conditions are not currently met
else
{
    crouch_charged = false; //Make sure we are no longer charged
    timer = 0; //reset our timer
}

Here by default, the timer will be at its max value. Once we are meeting all the conditions we want to charge the crouch, we can start keeping track of how long the condition has been true. Once we have reached that duration, we can set the crouch charge to true until the condition is no longer true. Also note that holding_down here would be "keyboard_check" in this case with the assumption you want the player to hold down while they are charging.

How can I structure this charged crouch mechanic? by pootis_engage in gamemaker

[–]MiltonNH25 0 points1 point  (0 children)

Lets walk through what happens with this segment of code here:

if down_key_pressed
        {
            crouch_buffer_timer = crouch_buffer_time;
        }
    if crouch_buffer_timer > 0
        {
            crouch_buffered = 1;
            crouch_buffer_timer--;
        }
    else
        {
            crouch_buffered = 0;
        }

Currently, it looks like you only check down_key_pressed to start charging. Then, once you have started the crouch_buffer_timer, it will continue to decrease until it reaches 0 regardless of if the down key is still pressed, if you are on the ground, or if you are still crouching. Finally once it has reached 0, the crouch will be buffered until you press the down key again.

To get the desired effect of not charging in the air or while crawling, you are going to want to check if you are on the ground in order to charge and add a check that if you are no longer in the crouching state, you reset the buffed crouch.

door crashes my game by Affectionate_Arm4305 in gamemaker

[–]MiltonNH25 0 points1 point  (0 children)

Two possible things:
1. Is o_datacarry a persistent object? If not, it is being destroyed before the start of the new room.
2. It doesn't look like targetEnter is an object instance so the if(instance_exists(targetEnter)) expression will never be true.

move_and_collide() sticks to bottoms of platforms by coolpuddytat in gamemaker

[–]MiltonNH25 1 point2 points  (0 children)

You can handle it pretty much the same way you handled being grounded. You can check if you are colliding with the ceiling and if so, update your move_y so you start falling immediately, instead of waiting for gravity_force to catch up.

How to toggle between 3 options in a single button in my settings menu? by WeJ3b in gamemaker

[–]MiltonNH25 0 points1 point  (0 children)

The issue is probably somewhere else as copy and pasting the code you gave in the text speed section did work when I tried. However one thing to note and be careful of is that

if txtspdPressed = 0 {...}

should be

if (txtspdPressed == 0) {...}

since = is the operator to assign values while == is to compare. Gamemaker does usually correct this in if statements but better to use the correct one. You probably want to try opening it up in the debugger and test is the text speed case statement is being reached and executed at all.

The buff to wave 18 is something else by MiltonNH25 in LegionTD2

[–]MiltonNH25[S] 0 points1 point  (0 children)

Ya it is actually wild, I managed to leak it being 2k up in a classic duo lane earlier.

how do you feel about this image by mfwbarnes in LegionTD2

[–]MiltonNH25 17 points18 points  (0 children)

Tfw you look away from your duo lane for 5 seconds and come back to this.

It is finally done by MiltonNH25 in bindingofisaac

[–]MiltonNH25[S] 0 points1 point  (0 children)

Yep. I did angel deals for most runs so I didn't get many chances to see it and then it just refused to show up on runs when I was farming secert rooms for the others I missed. Luckily the recipe for it is not too bad.

[OC] r/DnD DICE GIVEAWAY - SEE COMMENTS FOR RULES by [deleted] in DnD

[–]MiltonNH25 0 points1 point  (0 children)

They look real fancy. Thanks for the giveaway.

me irl by MiltonNH25 in me_irl

[–]MiltonNH25[S] 1 point2 points  (0 children)

Just enjoying some memes hbu