random

  1. E

    GML How could I make enemies spawn on the right side of the game screen?

    Hey all! This is my first time using GML so I am not too great at it and I need a little help. I am currently working on a 2D side scrolling shooter. I am trying to make enemies/entities spawn on the right side of the screen but I'm having some trouble. I have looked at a lot of videos and...
  2. FoxyOfJungle

    How can I not repeat a random number even using randomize()?

    Hi! My goal is to generate a final number in which it cannot be repeated, within a range of numbers from 1 to 5. 1 - This is what happening: Notice that MEMORY_GAME and SWIPE_CARD were repeated in a very "close" way, when in fact it should give way to other friends that have not been added...
  3. S

    SOLVED Choosing random from a dslist

    Hi I have a 💩💩💩💩load of sprites to choose from at random, so i put them in a dslist. var list = ds_list_create(); ds_list_add( list, spr_human__1_ , spr_human__2_ , spr_human__3_ , etc......... ) then i shuffle the list ds_list_shuffle(list); rdnm = choose (list) and create...
  4. N

    Can the start position on a path be randomized?

    I have a movement path for an enemy, but using the path makes the enemy predictable as to where it will go since it's a simple sine wave pattern. I'd like to randomize that start position along the path so each enemy at least starts at a different point of the path. Is this possible? Or do I...
  5. W

    Choosing a random value from an enum

    How do I do it? I'm trying to pick a random value from an enum for an object at the creation of that object. Do I have to set that enum's value in the create event (to zero) and then make it random in a step event? Or can I set that random value right away in the create event. And, what...
  6. Daniel Mallett

    Random bugs worth keeping

    This is just a point of interest I don't need help as such. Has anyone, or is it normal to find a bug in your game but keep it anyway because it has an unusual effect that actually enhances the game? Minecraft is an example (The farlands). So I guess my question is has this ever happened to...
  7. R

    Trying to generate phrase inside grid at random

    I'm new to game dev and it's my first time posting in this forum. I'm halfway through the trial period and about 40 hours deep into tutorials, free and purchased, and some playing around. Granted, this is a very short time. I'm just trying to figure out what GMS is capable of. I have a series of...
  8. Fluury

    GameMaker Bizarre performance decreasing, random-number related Issue

    I had posted a thread earlier about my issues, but unfortunately to no avail. Given there was a lot of information to write, I just put it in a video. The gist is that as it appears, in some context, using random number generation just seems to cause some internal, permanent (until you close...
  9. yvodlyn

    SOLVED Random Room switching

    Hello everyone, I would like to simplify this code. What I want to do is change rooms randomly and the next room is not the same as the current room. Here my code: if (point_distance(o_player.x,o_player.y,o_portail.x,o_portail.y) < 8){ if (room == rm_player_1){...
  10. N

    GameMaker Randomize position by multiples of 24

    I have a very simple spawning object which randomly spawns an object every 2 seconds. What I would like it to do the spawner creates the objects in the same y position of the spawner, but the x position I want to be randomized multiples of 24 (ie. x, x+24, x+48, x+72, x, x-24, x-48, x-72 etc)...
  11. sinigrimi

    GameMaker How to call a random key from ds_map?

    How do I call a random key from a ds_map structure? or will i have to create ds_list? a bunch of variables are created in ds_list, if for example I have 300 keys? I tried to do something with this, but my head is not working as it should var arts = global.artefacts; var arts_size =...
  12. sinigrimi

    GameMaker [SOLVED]Summon monsters in random but different places in rooms

    I am generating random room with monsters and I need them to not spawn on each other. It works but looks terribly big, can it be simplified? That's what I'm doing: Script-Code: randomize(); var x1 = 160 + random(room_width - 320); var y1 = 160 + random(room_height -...
  13. L

    how do I make a key follow the player without it randomly moving? Help!

    so I'm making a game that has keys in it and when thay follow you thay can get stuck and thay randomly move the key will move randomly when the player is standing still. the code: //move to the player if (instance_exists(obj_player)){ mp_potential_step(obj_player.x, obj_player.y, 10...
  14. N

    Random doesn't work

    Hi, When I use fonctions like random() or choose(), it's Always the same Numbers wich are given. For exemple, with random(3), the program will give me 2,41 for sure the first time. Then 2,89 the second time. And 0,76 ; 1,94 etc... So the random is not random ?! It's Strange… In conclusion, my...
  15. W

    GML Randomly generating chest spawns with a randomly generated level

    Hi, i've posted before about needing help with this for another problem, but here I am again. I've made some progress with a bunch of things but am currently stumped with trying to place down chests in the grid of the level. It is based off of this tutorial, and this is the code that came with...
  16. S

    Creating from, picking random and adding to ds_map

    Let me explain my problem in this example. i have variables for each object objvar1 = 1 obj1disable = false objvar2 = 1 obj2disable = true objvar3 = 3 obj3disable = false objvar4 = 1 obj4disable = false one empty ds_map and i have 4 objects...
  17. NotTayyy

    GameMaker How Do Seeds Work?

    Hi I Had an Idea to Have a Random number that is Set at the beginning of thegame and depending on what number was rolled you would get slight variations to the main game. But I Was wondering, How does Seeds work, Is the seed That I Export the Game With The Seed everyone Gets? Or is the Seed...
  18. Wile94

    Legacy GM Maze/Room/Level Generation and Loading Time

    Hi, I've recently coded a maze generator inside a ds_grid. Each cell has a string value like "0000" or "1010", etc. Each number represents a wall/exit (0/1) around that cell (left-right-up-down), having a total of 16 combinations. Then I run a script that seals most of the "one way exit" cells...
  19. M

    GML Assign new random variable

    Hello, i make a game for mobile devices and faced a problem. After the player hits cube with the same color, player should change its color to random. I am trying to do it with random_range, but it does not work, looks like gamemaker does not understand that i want to assign new variable through...
  20. E

    RESOLVED ..! how can we ensure that a random number is not selected again

    Create; global.roomno = irandom_range(1,4); global.rm_go = asset_get_index("q_room"+string(global.roomno)); Mouse Clicking; room_goto(global.rm_go); .. I'm organizing random rooms for quiz and I'd appreciate it if you help.
Top