string

  1. T

    Windows Runtime loop ERROR

    GMS:2 used to work perfectly fine up until I switched my internet plan for the same ISP. Now the runtime installation just loops whenever I start the program. I even get this error: I've looked everywhere for a solution, but I couldn't find any online other than "Change your ISP." I have...
  2. N

    Adding newline character to string after a specified amount of characters

    Hi, I am trying to make a script which inputs a string and returns that string with newline characters every n amount of characters. However I do not want a newline character to be added in the middle of a word or number, and I do not want a newline character to be added after or before another...
  3. C

    Legacy GM [SOLVED] Searching strings within strings using GML

    I made a string system for a fighting game where every action adds a string to the variable input_chain, and there is a variable input_chain_len=string_length(input_chain)+1, I also have a technique_chain variable which =" ", it changes if I do an action or technique, I have been able to make...
  4. N

    Legacy GM JSON reading from URL.

    Hi. var wrjson = '{"status":"Success.","p1":"NoFontNL","s1":"26"}'; wrjsonlist = json_decode(wrjson); var worldrecord = wrjsonlist[? "s1"]; var wrowner = wrjsonlist[? "p1"]; draw_text_outline(x-240,y+52,string(worldrecord) + " by " + string(wrowner),4,c_black); works, but var wrjson =...
  5. F

    Something's not right with this

    Ok, so I am trying to make a platformer and I need to be able to switch between specified rooms that are set up like this: r1_1 the first number being current level, the second number being which room of the current level player is in. I tried doing this: room_goto(r1_1); which worked fine. so...
  6. N

    GameMaker 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...
  7. P

    real("2+a") variable in string in real

    is something like this possible a = 5; str = "2*a" b = real(str) show_message(string(b))
  8. A

    Legacy GM Problem saving time based score

    Hello everyone, I am trying to save a time score like this "0:00:00". I already used ini files and functions ini_write_string and ini_read_string (you can enter and save your name the first time you play and it works fine. Now i'm using the same code but doesn´t work. 1st object: SCORE_LOAD...
  9. S

    GameMaker Get a string out of enum

    Not sure if this is possible or not but I have an enum and i want a variable to change to a random string from that list. For example if i have this enum. enum item { none = 0, test1 = 1, test2 = 2, test3 = 3, height = 11, } and i want a variable to change to...
  10. darijs1

    Legacy GM (Solved) Simple way to draw a rectangle under my text

    Based on this code: ///Script object = argument0 str = argument1 draw_set_halign(fa_center); draw_text_transformed(argument0.x, argument0.y-argument0.sprite_height, str,0.5,0.5,0); how can i draw a rectangle under this text in a way that would keep the rectangle the same width and height as the...
  11. Gasil

    (SOLVED) Special characters á, é, í, ó, ú and ñ on strings.

    Hello again, I'm seeking a bit of advice about this matter, could you help me please? I was planning on using both English and Spanish languages on my games, however, it seems GM2 doesn't recognize special characters such as the extra Ñ letter and the vowels marked with an accent. While I'm...
  12. S

    GameMaker [SOLVED] Adding the results of a For loop together

    I have the following code. Just for reference, ds_grid_get(playerInventory, 65, i) is the status of the object, and ds_grid_get(playerInventory, 0, i) is the name of the object. for (i = 0; i < ds_grid_get_height(playerInventory); i++) { if ds_grid_get(playerInventory, 65, i) == "Equipped" {...
  13. J

    Need some string help

    good evening everyone, i am working on a personal project, a unique calculator for a gaming work place that is needed and i was told to help with it (Game maker is amazing) lol the software is completed, however there is just this ONE thing I don't like. the strings come out as 123456789 when...
  14. S

    GameMaker [SOLVED] How to Detect the Amount of Lines in a String

    I'm using the function: "draw_text_ext_transformed" Its odd, some things behave differently than I expected, but overall I get it. However, I need to detect how many lines are drawn with randomly sized strings of different words. With the "width" argument in this function, you can specify how...
  15. S

    Legacy GM "string_width" calculating wrong value?

    Perhaps someone with more experience could explain what is happening here, and how to correct it. I'm assuming it has something to do with spacing of the characters in the font not matching with the actual draw length. The actual draw width of this text is 153 pixels, but the game says it is...
  16. K

    "filename_change_ext()" only returns <null>

    I'm testing in the debug console, and no matter what kind of arguments I use, this function never returns anything but "<null>". Example: filename_change_ext("test.txt","") returns "<null>" filename_change_ext("test.txt",".jpg") returns "<null>" etc.... Is this a bug with GM:S or something, or...
  17. C

    GML [SOLVED]: Parsing Strings ignoring substring

    So I don't want to create a book out of my problem, here it is: I have a string, say 'Hello [c:yello]friend[c:default]! How are you?'. That string has tags (starts with [ and ends with ]) inside of it for colors. Now, I'm trying to make a draw_text_ext that ignores said tags, but manually...
  18. H

    Legacy GM Translating key value to string

    Hello! I am trying to translate a pressed key value (say, '72' which is the value for the 'H' key) to a string, but I can't get it to work. Any ideas?
  19. jobjorgos

    Legacy GM [SOLVED] how to make a global variable from a string name

    Im wondering how I can edit the value of a global variable from a string name as you can see below. SCRIPT: scr_do_damage_to_enemy: ///scr_do_damage_to_enemy(enemy_id_number); a = argument0; //the id of the enemy. it is just a number of 0 between 29 for every unique enemy b =...
  20. 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...
Top