loop

  1. L

    Windows Spine animation loop problem

    i made an animation in spine.it has 61 frames(from frame 0 to frame 60). And frame0 is defferent from frame60 when the GMS2 play this animation. it will play 60 frames but not 61 frames. the image_index will be 0 to 59. when image_index is 0. GMS2 will draw either frame0 or frame60. it seems...
  2. Smenkare

    (SOLVED) Changing values in all positions in ds_list

    for(i=-1; i < exampleListSize; i++) {ds_list_replace(exampleList, i, 0)} Will it work? And is there faster way? I have like 500 positions in ds_list and i want to be able to change them all to 0.
  3. 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...
  4. B

    GMS 2 Search for ds_map value

    Hello :) , I have a question over a code I am breaking my head over for several days now! I have this line of code where you get different rewards depending on the number. For example if you win coins, you get +100 coins etc. In this case you win a new football. I have a ds_map that stores...
  5. B

    GMS 2 How to create an algorithm

    Hello dear community :) I really need help with this peace of code. I have a Level room where there is an Object that checks, when created, how much stars (0-3) each level has saved on the ini. Then it changes the image_index of each level button to match the amout of stars. 3 stars are yellow...
  6. A

    GML Crash when looking for object index in a for loop [SOLVED]

    I'm having a very odd error pop up seemingly at random. The odd thing about this is this doesn't crash all the time and I cannot figure out why it's crashing because it says it's looking for an object index in the for loop statement which doesn't make any sense to me. When I run debugger and...
  7. F

    Loop freezing when repeating too much

    So I have a loop counting down a number of rooms I want to place in a procedually generated dungeon, I have it set to where there is an attempt per room if there are 2 failed attempts a time is incremented which after reaching a certain value, ticks down the main number of rooms placed value...
  8. Stratadox

    Asset - Scripts repeat for_all

    So.. I made this a while back... noticed it's only on the old forums, so I'll post it here too. for_all This library adds the repeat for_all construct. The repeat for_all(x) syntax is an emulated language construct, enabling a foreach-like loop structure in gml. In many languages, there...
  9. B

    Circular loop through 2D array

    While I'm worried this is above me, for reasons regarding depth I would like to loop through a 2D array starting at a given position and "spiraling" out from that point. The most helpful thing I found online was this https://stackoverflow.com/questions/398299/looping-in-a-spiral?rq=1, however it...
  10. K

    Windows looping object change

    Hi, i'm struggling to make a looking object change, I'm managing to change one time, then it stops. I have this code in the 1ºst obj: Create Event: set Alarm 0 to 45 execute code: image_speed = 0.2 Alarm Event for alarm 0: set Alarm 0 relative to 100 change the instance into object...
  11. PlayerOne

    GMS 2 Creating objects from the tile layer

    I'm trying to make to improve this code by spawning all the collision objects for any given level by placing tiles in the room. Current I got the intended effect but it's very slow and I need to make this instant when the room starts. Tried using a for loop but it doesn't work at all. Any help...
  12. Corey

    (Fixed)Global variable/Alarm/instance_create issue

    Edit: Disregard. I fixed my problem by adding a Step event with global.enemyCounter = currentEnemies; to check the counter every frame and switched my Alarm event code to check conditions before spawning an enemy. Hello all. I have tried countless times to fix my problem. I am somewhat...
  13. Mosaknows

    "Instance_create_depth" bug/annoying thing

    Hey, Recently I've been working on my own boss A.I., but I've encountered an annoying problem. Whenever I try to use the function "instance_create_depth" on my bot, on the first frame the instance that it creates spawns in the wrong coordinates which makes it look bad. I've tried many things to...
  14. M

    Question - Code Looping music somewhere other than start

    Is there a way in Game Maker to loop music somewhere other than back to the beginning of the song - to some arbitrary sample number earlier in the song? I can do this if I encode the music as raw PCM then use manual audio buffer manipulation, but that's complicated, and rather large. Because...
  15. Architheutis

    Jumping withing one animated sprite

    Good morning, everybody! That topic was certainly solved, elsewhere inside. Or something similar. I´ve got a special intention. Maybe that could be solved with states. But I asked myself, and now you, what about jumping within an animated sprite. Example: oPlayer collides (place_meeting) with...
  16. Architheutis

    How to switch of a rapidfire of a sound? (SOLVED)

    Hi Folks, I´ve got a simple problem with a sound, that is played by place_meeting with a locked door. If you haven`t collected a key for opening, a blinking key/questionmark-sign appears. Fit to that rhythm a sound turns on (loop = true), switching off on if (!place_meeting(x,y,o_locked door))...
  17. I

    Need help with waves

    //Next wave or end spawner when all enemies have died if (remaining [current_wave]<=0) { if (current_wave == total_waves) { //game_restart(); highscore_add(string(""), global.highscoreboard); } else {...
  18. Architheutis

    Simple movement display doesn´t work (ladder-climbing - (SOLVED!))

    Hi Folks. Here is a very simple code-block for ladder-climbing. My game hero is working absolutely fine. I made further idles for climbing a ladder. He climbs up and down, as I wanted. But: He doesn´t play the full loop of the climb-idle "sPlayerLadderClimb". You can only see the first image of...
  19. tomsaram

    Legacy GM [Solved] Loop a sound effect for a set amount of times

    Hi guys, I am trying to loop a sound effect, but only for a certain amount of times in stead of indefinitely. As for now I just loop the sound and stop it at some later time. But this often cuts the sound effect off in the middle, and I don't know of a way to toggle looping on/off. I am aware...
  20. Mauricio Albanese

    repeating a state

    Hello all im doing heartbeast's tutorials for games and i have a doubt in the state's of the character: for example whe i, the player, hit an enemy they change to knockback state and when they are in this state they execute the following query: case "Knockback": #region Knockback...
Top