strings

  1. Slothagami

    GMS 2 Color coding strings at runtime

    I'm making my own version of code writer, just for fun, and I am want to make the text color coded for the languages I intend to use it for (html, css, javascript, etc...). So the problem is that I need to change part of a strings color based on context, (check if it's in brackets and things)...
  2. EvanSki

    GMS 2 What is best practice for String compares?

    Not sure if this qualifies as advanced programming but the way I see it the normal user wouldn't worry about this. Anyways... I was watching A GDC talk(3:40) and the speaker was talking about how they avoid string to string compares, but didn't go into details So after some research I've come...
  3. Binsk

    Asset - Scripts UBG Strings

    Yoyo Marketplace (coming at some point) Itch.IO Upset Baby Games View the online documentation to explore the available functions. Would you like to expand upon the available string functions included in GameMaker? This extension does just that. The added functionality ranges from small to...
  4. Coded Games

    Designing a translation system with dynamic strings.

    I am attempting to implement localization support into my game but I am running into one challenge. My game is a card game and the description of cards can change depending on how many "Fusion Points" a card has. For example I may have a card like this: Gunshot: Fire 2 bullets. But if I gain 1...
  5. Antikore

    GML Problem converting from string to real for seeds

    I'm trying to make a minecraft-like seed system where you can type some kind of text string and it will be converted to real and afterwards the seed will be set. However, seems I'm doing something wrong with the converter. I didn't follow any tutorials so my code might be completely stupid, I'm...
  6. KyleRansford

    GMS 2 Spell Checking Dialog "strings"

    Is there a way to spell check "strings" that I've written dialogs with? I know (or at least haven't seen it) that GameMaker Studio 2 IDE doesn't have a grammar spell check, but is there away or some kind of program, where I can check for grammer spelling in the code that I've typed? I have a...
  7. EvanSki

    SOLVED How to check if a global variable exists without using a ds_map

    Hi! As the title says I want to figure out if a global variable (global.cats) exists without having to put every global in the entire game into a ds_map and checking against it. for more context. im currently doing it like this //If variable name actually exists if...
  8. A

    GML split equation into numbers and operator

    I want to split an equation into 3 sections. The first number, the second number and the operator itself. Example: Input (string_print) = print 10+15 num1 = 10 num2 = 15 op = "+" eq = string_copy(string_print, 7, string_length(string_print)-6) This is the code I use for getting everything...
  9. Fixer90

    GMS 2 Em Dash in Strings (SOLVED)

    I want to include em dashes in my strings, and not have them return as the default "▯." For example: str = "The quick brown fox — who was very quick indeed — jumped over the lazy dog."; returns as "The quick brown fox ▯ who was very quick indeed ▯ jumped over the lazy dog." I already tried...
  10. FeetUpGaming

    Replace multiple characters in a string

    Hey having trouble figuring how to replace multiple sets of characters in a string at once. I have a file save and load system where the player picks the save file name but to do that i need to make sure they don't do anything silly like putting @,£,$,/,| etc in the file name so how would i go...
  11. T

    GML Squish text after two lines

    Hello I am drawing text into a sprite box of a fixed size, 1200 pixels wide and enough room for 2 lines of text. I am using the following to wrap the text so it is not drawn off the sides of the sprite draw_text_ext(x,y,thisText,-1,1200) where x,y is the centre of the sprite and thisText is the...
  12. PlayerOne

    GMS 2 Advice when it comes to loading text (localization) [SOLVED]

    I plan localizing my game and I have two ideas rolling around in my mind on how to load text. Either load the strings from an .ini file into a ds_grid in a centralized way and have the objects access the strings form that grid or load strings in each object when a room starts (or object spawned)...
  13. EvanSki

    Legacy GM (Solved) Can a variable pick a string at random?

    Basically what I want to do is Have an object call a script (scr_decry) The script holds a variable (decry_phrase) and a list of strings such as "apple", "password","pinepplesarebad" Then the script will make (decry_phrase) = a random string from the list Any help is appreciated, Thanks!
  14. Lord KJWilliams

    Windows do you need quotation marks for using load_csv function, to import strings?

    Ive been reading the online manual , and the load_csv function does not state if your csv file needs to have values that are treated as strings to be enclosed in " " , double quotation marks so that load_csv converts it to a string variable. Does any one know ? Thanks
  15. N

    GMS 2 Writing strings in-game

    In my game, I want to be able to write strings via keyboard input in-game. I tried to do this. In the object that is the textbox, I have 3 events: -Left Pressed event: global.textselect = id; -Step event if (global.textselect != id) || (string_length(global.title) > 14) exit; if...
  16. Gasil

    Checking how many characters a string has?

    Hello, I am using the following snippet: if (time < text_length) { time += velocity; print = string_copy(text, 0, time); } To draw the letters of a string one by one on a text box. However, I'd like to give the option to make the text appear in a single frame by pressing the letter...
  17. Nixxi

    UWP [Resolved] Having trouble creating/initializing global variables

    Hello GameMaker Community. I'm having an issue with creating global variables for sharing information between the players, game objects, and ini reading/writing. Part of the problem is that my game has a max of twenty (20) save slots, each slot has roughly 5,200 individual datapoints (for...
  18. D

    String in script arguments?

    Hello, so I'm doing a suuuuuuper simple text box.Basically I have an invisible controller for the text system in the room, and any time I need it to show up, I just change the currenttext variable and it draws whatever text I tell it to. The only way I can really make it work is through scripts...
  19. Fixer90

    Legacy GM Check the case of a letter? (SOLVED)

    Is there a way to check the case of a letter (whether or not it's a capital letter), returning either true or false (or something similar)?
  20. Fixer90

    Legacy GM Specificities of string_pos (SOLVED)

    The function string_pos will return the position of a given substring within a given string. But let's say I have the following code: text = "AAABAAABAAA"; Now, I want to run the string_pos function to find out the position of the 2nd B in this string, and only that 2nd B. What do I do?
Top