Description

Some simple useful scripts to convert numbers, create arrays, and other:

  • 1D arrays

    • array_add_to_list(array, list)
    • array_create_ext(value, ...)

      res = array_create_ext(10, 20, 30) -> res[0] = 10, res[1] = 20, res[2] = 30
      
    • array_create_from_string(separator, is_real, string)

      res = array_create_from_string(";", false, "A;B;C") -> res[0] = "A", res[1] = "B", res[2] = "C"
      
    • array_sort(array, ascend, change_source)

    • array_to_string(separator, pure, array)

      data = ["Array", "To", "String"];
      
      array_to_string(";", true, data)  -> "Array;To;String"
      array_to_string(";", false, data) -> "{ Array; To; String }"
      
  • Conversion

    • convert_dec_to_hex(value, [digits])
    • convert_hex_to_dec(value)
    • convert_dec_to_bin(value, [digits])
    • convert_bin_to_dec(value)
    • convert_range(from_range, to_range, pos)

      Convert value from one range to another range. Example:

      convert_range(1000, 1, 500) -> 0.5 (from 0..1000 to 0..1)
      
    • convert_gm_color_to_hex(color)

      convert_gm_color_to_hex(c_red)   -> "FF0000"
      
    • convert_hex_to_gm_color(value)

  • Debug

    • print(val[, val2, val3...])

      Print data to debug console.

    • print_comma(val[, val2, val3...])

    • quoted(string)

    • show_message_ext(a, [b, c, ...])

    • string_build(val[, val2, val3...])

    • string_build_comma(val[, val2, val3...])

      string_build_comma(100, 10, 25, 30) -> "100, 10, 25, 30"
      
    • string_build_sep(separator, val[, val2, val3...])

  • Other

    • draw_set_colour_rgb(colour)
    • ds_map_find_key(id, value)
    • event_user_object(instance, user_event)
    • foreach(ds_list, script)
    • instance_destroy_ext(id1, id2, ...)

For more info see forum

End User Licence Agreement (EULA).

Age Rating: 4+

Versions

GMS2 - Version 1.2.1. Published August 20, 2017

added: array_add_to_list, foreach, quoted, ds_map_find_key, string_build_sep, show_message_ext, print_comma, convert_hex_to_gm_color...

GMS1 - Version 1.2.1. Published August 20, 2017

Renamed array_createarray_create_ext, added: array_add_to_list, foreach, quoted, ds_map_find_key, string_build_sep, show_message_ext, print_comma, convert_hex_to_gm_color

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait

Back to Top