coding

  1. Lightmind

    Getting a variable from 2 different objects.

    Sorry if the title isn't clear enough for what I'm about to say. Basically, I want my player to take damage when touching an enemy. So, the player hp - enemy dmg, but I don't know how to put 2 variables from different objects into 1 line of code.
  2. N

    GMS 2.3+ help with collision with walls

    I wanted to make a game and needed collision for walls for a room with a hallway and most posts here for wall collision don't work, here is my player step script; x = x +0; if keyboard_check(vk_left) { x = x - 3 } else if keyboard_check(vk_right) { x = x + 3 } else if...
  3. S

    Random_set_seed confusion

    As we can use randomise() function but what's the speciality of random_get_seed() ? here i attach another link about random ssed ... https://en.m.wikipedia.org/wiki/Random_seed
  4. Christopher A. Orestis

    How do I find a particular object that contains a particular value

    something like this... if (obj.var < 3) { with (obj.var < 3) { obj.var += 1; } } //========================================================================== I want to make it so: if (a particular obj with the smallest value of var && that are less then a value of 3) { // code }...
  5. AlfMandoor

    SOLVED Need help with tutorial

    Hello to everyone, I really would appreciate any help you can please give me... From a week ago I have this problem and can´t fix it, and the worst is that the enemy just stay there and don´t do anything, I am been following a tutorial about using platform pathfinding, where the enemy follows...
  6. Skoplir

    Portfolio - Programming [AVAILABLE] GML programmer looking for work (Inventories, save systems, level editors, etc.)

    About me Hey, I’m Skooparoll. I've used GMS2 for thousands of hours and enjoy the challenge of helping people with their projects. I'm open to any task and happy to learn new things. I deal with people online all the time, so we can easily discuss the details of your project on a voice chat. As...
  7. Powerset

    GML Help making Enemy Knockback/Script

    Hello! So I got some Enemy knockback working for my game. The only problem is im trying to transfer the logic into a script and im hitting major roadblocks. I cant seem to figure out whichever part of it im doing wrong. Inside the enemy hurt state I have this: case ENEMYSTATES.HURT: {...
  8. otterZ

    SOLVED A more elegant way of coding my timer countdowns?

    Hey guys, I will be the first to admit that I am not an elegant coder and tend to repeat lines of code that resembles spaghetti. I am trying to change this. Can anyone suggest a way to code my timer countdowns more elegantly? Here's some code as it is at the moment . . . repetitive and ugly. . ...
  9. M

    noob question, object properties.

    so i was wondering, how to assign "properties" to objects. what i mean by that: for example, i have Player, who is colliding only with obj_solid. So, to add different kinds of solid platforms, i create an object as a child for obj_solid, so that player will collide with all of them. but that is...
  10. D

    Gamemaker and Gamemaker two difference?

    What is the difference between Gamemaker and Gamemaker two coding? is it exactly the same, also is it easy to transfer old projects to the new game maker two?? Thanks
  11. S

    Help with programming

    Hello everyone! I'm kinda new to programming and was following this tutorial: when I ran into a problem. when I try and run the program I get this error message: ___________________________________________...
  12. 2

    GML Coding a basketball game.

    Hi everyone, I don't know where to go for this so I come here. You see, I am making a mini game for my GDD plan in game maker. I would like to make a basketball with my characters. This sport is perhaps one of the most intense thing to program in gaming in history because of the AI. What would...
  13. K

    SOLVED How can I get (instance_number) for all objects in a room.

    Hello! I'm a complete amateur and have "some" questions. 1. What is the difference between instance_count and instance_number ? Is it the same thing but for different versions of gm? or are they completely different functions? 2. How could I get instance_number for every object in the room...
  14. M

    GMS 2.3+ Coding A Proper Hookshot?

    Hello there! I am currently working on a side scrolling platform game with a main focus being hookshot based grappling which the player will use to both traverse and fight/grab enemies using a button press based on the direction the player is facing similar to say 2D Zelda. Currently, I am able...
  15. Necromedes

    Pixel Collision with Sprint Button?

    I've started work on a top-down, action rpg of sorts. I'm using Shaun's platformer code as a base until I finish watching his tutorial on action rpgs. I have the code set up for horizontal and vertical collisions and those work just fine. However, I have set up a sprint/dodge key that increases...
  16. L

    Arrays to draw Text

    Hello everyone, I am currently working on a Point and Click Adventure in GM2. As I am still new to GML I am having quite a few problems with the coding language. Some of you might know, that clicking on an item usually triggers a text in Point and Clicks. At the moment I coded it this way: The...
  17. J

    question about tilesets... [closed]

    As of the time of this posting I have a rough level editor that swaps between several sprites (spr_wall, spr_floor, and so on). I also flip through the frames for different walls or floors depending on the sprite. I am wondering if it is possible to code a level editor that can use tilesets and...
  18. D

    GML how does this code work??

    inputDirection = point_direction(0,0,keyRight-keyLeft,keyDown-keyUp); inputMagnitude = (keyRight - keyLeft != 0) || (keyDown - keyUp !=0); hSpeed = lengthdir_x(inputMagnitude * speedWalk, inputDirection); vSpeed= lengthdir_y(inputMagnitude * speedWalk, inputDirection); x += hSpeed; y +=...
  19. L

    How do I stop motion_add?[SOLVED]

    So basically I want to stop motion_add so it happens only once or are there any alternatives beacuse I want to push player from guns rotation so how do I stop it or is there any other way to do it. Thanks in advance!
  20. T

    GML Ally and ememy AI

    I have some code below for a simple ally Ai. However I am not sure how to have the ally drone skip the top code if there are no enemies nearby. If I use if(!instance_exists(obj_Player)) exit; then the ally will just float off brain dead. Very new to coding and not sure what to do here...
Top