1. TheMrPancho

    GMS 2 Eliminar ultimo carácter de una cadena de texto/Remove the last character in a text string

    ¡¡Hola, primero que todo soy un usuario de habla hispana y mi inglés no es muy bueno!! Bueno lo que busco es como eliminar el último carácter de una cadena de texto. Llevo dos días usando Game maker 2 en su versión prueba, y me falta mucho por aprender. una agradecería de corazón su ayuda...
  2. C

    Finding the longest string in an array

    Im working on GUI right now and want to make sure the menu backdrop changes in size to fit the longest string in a given array. What function could I use to accomplish this? (I'm using GMS:S 1.4)
  3. zendraw

    SOLVED weird string error

    i get this error when i try to run the project and i cant see why is it happening
  4. K

    change multiple variables value in a for loop

    hello everyone. i'm new to coding in general and i was wondering if you can help me with this problem: i have this variables global.StatLvl1 = 2 global.StatLvl2 = 2 global.StatLvl3 = 2 global.StatLvl4 = 2 global.StatLvl5 = 2 global.StatLvl6 = 2 global.StatLvl7 = 2 global.StatLvl8 = 2...
  5. sv3nxd

    GML Most efficient way to render a textbox

    Hey, I'm currently working on an open-source project in which you can create a textbox with one single command. I've been working on it for a long time now, trying to improve it in every way I could. ( I was wondering if the way I am doing it right now is...
  6. tamation

    Remove last character from a string

    I'm really struggling with setting typing limitations right now. Ideally I'd like to have it so that once the player's keyboard_string exceeds a width of 248 pixels, they can't type anything else to add to the string until some characters have been removed. I couldn't figure out how to stop...
  7. Pompadour Dude

    GMS 2 (SOLVED) How to combine string variables?

    Hey guys, I am working on one of my games and I want characters to change clothing (head / body / legs) separately. I want to use three string variables. For example: headSlot = "some var" bodySlot = "some var" legsSlot = "some var" These variables can be equal to clothing type: bodySlot =...
  8. jobjorgos

    GML how to play a sound from string name

    snd_string = 'snd_szymat_echo_party' audio_play_sound(snd_string,10,true); Why does the above code not work? Do I have to convert the string to something else first?
  9. Cupid Stunt

    GMS 2 [Solved] Programmatically number sprites

    I'm working on a math learning game that uses tiles for the potential answers as well as the questions. The range of the answers is 0-19, so it was easy to make a single sprite that had all of the numbers on different frames. Then to use the image_index to set the number and store which number...
  10. Cupid Stunt

    GML [Solved] Zero Padding a number as a string

    I'm creating a clock for my game and I'm having issues with zero padding the numbers. I could use if statements and I will if necessary, but that's ugly code. In python I'd simply use: '{:02d}:{:02d}'.format(minutes, seconds) My output would be: 01:24 or 03:07 or 12:05 The point is to add the...
  11. Green Panda Studios

    GMS 2 Empty Boxes at newline locations after converting a txt file to string

    Hi everybody. I'm stumped on this one. I've been messing around with it for about an hour now, and I just can't figure out what this character is that keeps appearing at the end of a line after converting a txt file of dialogue to a string to use inside the game. I wrote this function to return...
  12. G

    GMS 2 [SOLVED] - string_lettersdigits_ext(str, [inclusions], [exclusions])

    Here's another script that goes along with string_letters() family. This string works much like non-alphanumeric script except that it works in the other direction: obtains the letters and digits opposed to non-alphanumeric chars. Again, you can add inclusions and exclusions based on which...
  13. G

    GMS 2 [SOLVED] - string_nonalphanumeric(str, [inclusions], [exclusions]);

    Here's an interesting script you can use. I call it string_nonalphanumeric(). It goes with string_letters(), string_digits(), and string_lettersdigits(). It accepts an input string and parses out the non-alphanumeric characters. You can also include specific alphanumeric characters to return...
  14. Daniel Mallett

    GMS 2 text border issues

    x = 500; y = 500; string_val = "string"; draw_text(x, y, string_val); width = string_width(string_val); height = string_height(string_val); draw_rectangle(x, y, x + width, y + height, 1); I am trying to implement a dialogue with form controls, text, etc. I have been having problems...
  15. Michael Stearns

    GML Solved - String Width but ignoring line breaks

    Hello! I've got a text box that gradually fills with text, typewriter-style. I wanted to draw a little "cursor" at the end of the string being displayed, but I seem to be having some trouble. The problem is that string_width (and string_width_ext) does not seem to actually return the line...
  16. M

    GMS 2 Execute script with variable

    Hello everyone! I have a small problem in my mobile project. I created a button that should lead to the next level. All the level atributes are saved in scripts: scr_level1 , scr_level2 , scr_level 3 and so on. So in the button I added these lines: // this button is in rm_game //when button is...
  17. Wretched.Dunce

    Mac OSX [SOLVED] String Literal Issues: Missing Glyph at Line Breaks

    I'm going through the Space Rocks tutorial and I've run into an issue with line breaks in literal strings. I'm creating the start up menu text using: @" score 1,000 points to win! UP: move ...etc." However, upon running the game, at the beginning of each new line theres the missing glyph...
  18. Edwin

    GML How to Solve this String Wrap Problem?

    Hello, everyone. I'm having a quite silly problem; I'll start from the beginning. I made a drawing text script that gets the tags from string and then converts these tags into new drawing functions. Having this I can't string warp the string regarding the width of it, because it will check not...
  19. N

    GMS 2 [Solved]Storing keyboard_string in two variables with different length

    I'm having trouble wrapping my brain around strings, and especially how string_delete works. I'm trying to store characters from keyboard_string in two different variables with different lenghts. One of the variables is used to store only 1 character (output), which refreshes everytime...
  20. Edwin

    Skipping tags in a string.

    Hello, nice people. I'm trying to create a script that will skip the tags like "[color=...]", "[/c]", "[alpha=...]" and stuff and then return a script_copy(). /// string_copy_tag(str,index,count) // Declare variables var str, index, count, p, cst, cct, ast, act, et, l, cstl, cctl, astl...