string

  1. GunnyBoy

    Converting string to object name to return object ID

    I have objects used for the player to collide into to change rooms called "o_transition". Each object has a unique with a naming convention (current_room_to_target_room) and has a a variable for the current room it's in and the target room to move to in the creation code. I'm trying to find a...
  2. GunnyBoy

    SOLVED Automatic player position after room transition help

    Most of the tutorials I've done involves creating a "door" object for the player to run into and have which room to change to as well as the x and y position to start the player in each of the door objects creation code. While this works I'm trying to think of a way to do this with JUST the door...
  3. Kyrieru

    GMS 2 Seperate numbers in a string into an array? (solved)

    I'm loading a text file with lines like; 1,5,12 And I need to convert it into an array. I understand (more or less) how I would have to do this, but frankly as more of an artist than a programmer; when I think about it my soul tries to leave my body. Because I know I will stumble over it...
  4. Daniel Mallett

    GMS 2 Drawing text frustrations

    I'm having a break from my main project to work on some form controls. I'm currently writing a text box control. I am perfectly happy with the code I have at the moment so I really don't want to completely restructure it in order to fix the following issue. The gap between each letter either...
  5. FoxyOfJungle

    GML Turn string into ******** password

    What is the most efficient way to turn a string into something unread for use in a password textbox? Example: Password: 12345678 Password in the draw_text(): ******** I tried to use string_format() and string_replace_all(), but I don't know if I did it wrong. Is using loops the only...
  6. Michael Hart

    SOLVED 3 or 4 strings to fit in specific area

    i have strings that should fit in an area from 210 to 786 . i would like to have 3 or 4 strings to scale to fit in this area. the variables are called guest1, guest2, guest3 and guest4 all of these variables vary in string_width how can i make these fit using draw_text_transformed?
  7. 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...
  8. 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)
  9. zendraw

    SOLVED weird string error

    i get this error when i try to run the project and i cant see why is it happening
  10. 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...
  11. 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. (https://github.com/Sven98/ezBox) I was wondering if the way I am doing it right now is...
  12. 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...
  13. 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 =...
  14. 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?
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...
Top