random

  1. Fluury

    GMS 2 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...
  2. 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){...
  3. Nathan

    GMS 2 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)...
  4. sinigrimi

    GMS 2 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 =...
  5. sinigrimi

    GMS 2 [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 -...
  6. 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...
  7. noé cambou

    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...
  8. Wicked

    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...
  9. Smenkare

    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...
  10. NotTayyy

    GMS 2 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...
  11. 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...
  12. 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...
  13. 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.
  14. B

    [Solved] create objects in predefined location in room checking collisions

    I need to create 25 block objects in a predefined space (within the view area), only random and checking collisions with other objects and only appearing in place free, but I can't. delimitations (area where the object needs to appear inside): x 32 --- x 640. y 64 --- y 960. P.s: the object in...
  15. giraffeman210

    Drag And Drop Random Enemy Movement For A Maze Game

    I am trying to make random enemy movement work for my maze game but can't find any tutorials on how to do it. I am trying to make it work so the enemies move in random directions but can not choose backwards or where there is a wall. Below is a response I had gotten but I don't know how to add...
  16. T

    GML (solved) select random Boolean only with the value of true

    I have four booleans, npc_canmove_up, npc_canmove_down, npc_canmove_left, ncp_canmove-right, in my npc object's variable definitions section. Then in my create event I started this self repeating alarm. //start another alarm alarm[0] = random_range(ncp_rotatetime_min,ncp_rotatetime_max)...
  17. K

    Change imagespeed of a random object

    I am currently working on a pizza delivery game, for which I want to create random delivery locations. I want it to choose a random house after I collide with the pizza restaurant (the player gets a pizza in its 'inventory'). Currently I have this: ///Change pizza count if (obj_player.pizzacount...
  18. Joe Banko

    Mac OSX Random (Choose)

    Hi all, 2 hours new to GM2 so excuse the ignorance. Going thru the Asteroids tutorial I have run into some confusion with the DND Choose block. I have the 3 different sprite names; Small, Medium, Huge in the 3 lines of options but only the first 2 options ever get chosen. If the 1st and 2nd...
  19. RyanC

    GMS 2 Random_Set_Seed() seems different for GMS 2 and no longer consistent between platforms.

    I've just had to update my app to support 64 bit so I purchased GMS 2 and imported my game. Within a few hours I had it running on Android but now my game is totally different. I spent many days selecting random seeds that would generate levels and nearly 100 of them were tested which took...
  20. N

    GML Procedural Dungeon Generation System

    Greetings, GameMaker Community members. I have been working on a procedural dungeon generation system and would like to share a solution. Just to put it out there, this solution is not the be all end all as many other solutions exist. The purpose of this post is simply to showcase my method...
Top