• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

strings

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. Topper1

    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...
  8. 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)...
  9. 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!
  10. 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
  11. NNNIKKI

    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...
  12. 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...
  13. 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...
  14. 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...
  15. 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)?
  16. 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?
  17. Anomaly

    GML only part of a string...

    you know in file searching you can say... search: thisFile10_*.* and it will find any thing that begins with just "thisFile10_" is there a way to phrase strings in GM to achieve something similar?
  18. A

    GMS 2 String function characters

    What I'm looking for is to create, for example: If a string looks like this: This text is /rred. Then it should look like this: This text is red.
  19. T

    Help with random numbers and using those random numbers

    I'm trying to make a randomly generating item generator. that will make another item at that location that will repeat the same code but with different variables etc. let's say that the object before it picked 3 (down) So what it would do is R1X= 3 //from before when the object before picked...
  20. R

    Legacy GM Is it possible to convert a string into a sprite/object name?

    Hi again everyone! Another strange question for everyone here, I'm afraid: Is it possible to make game maker interpret a string as an entity/sprite/object name, etc? Sorry for the vagueness of the question, I'm kinda grappling with a code structure idea and I'm wondering how it would work...
Top