string

  1. FactorX12

    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...
  2. 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...
  3. 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))
  4. A

    GM:S 1.4 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...
  5. S

    GMS 2 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...
  6. darijs1

    GM:S 1.4 (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...
  7. 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...
  8. S

    GMS 2 [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" {...
  9. 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...
  10. S

    GMS 2 [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...
  11. Silversea

    GM:S 1.4 "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...
  12. 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...
  13. CedSharp

    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...
  14. H

    GM:S 1.4 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?
  15. jobjorgos

    GM:S 1.4 [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 =...
  16. 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...
  17. Samuel Venable

    Legacy GM [SOLVED] Store entire text file contents in string (GM 8.1)

    I wrote a script for my Execute Statement extension which allows me to read the entire contents of a VBScript text file. It works in GMStuido 1.4 and 2. But for whatever reason I can't get it working in GM 8.1. It's obvious legacy GM can do this too, but needs to be done slightly different in...
  18. samyak

    Dialogue sound

    How to attach sound with text like in 0:10 in this video? I'm using string_copy(string_xyz, 1, i ) and incrementing i+=0.4;
  19. Meowanator

    GM:S 1.4 Password System Not Working

    I am trying to make a password system for unlocking a character, but it isn't working. In the Button's Create Event: password = ""; In the Button's Left Pressed Event: password = get_string_async("Enter a Password",""); if password != ""{ if password = "Zoroark"{ if...
  20. Nathan Matthews

    Showing message string and variables

    I thought this code would have worked but it didn't, can someone please help me with the right way to do it. show_message("Level Status: "+room_caption+"#Coins Remaining: " +instance_number(Coin)+"#Fuel" + health);
Top