Jump to content


Tha_14

Member Since 13 Apr 2011
Offline Last Active Apr 14 2013 05:01 PM

Posts I've Made

In Topic: String split to arrays. How to do this?

11 September 2012 - 04:48 PM

/*
**  Usage:
**      string_extract(str,sep,index)
**
**  Arguments:
**      str         string of elements
**      sep         character or string seperating the elements
**      index       element to return, {0..n-1}
**
**  Returns:
**      the element at the given index within a given string of elements
**
**  Example:
**      string_extract("cat,dog,mouse",",",1) == "dog"
**
**  GMLscripts.com
*/
{
    var str,sep,ind,len;
    str = argument0;
    sep = argument1;
    ind = argument2;
    len = string_length(sep)-1;
    repeat (ind)
        str = string_delete(str,1,string_pos(sep,str)+len);
    str = string_delete(str,string_pos(sep,str),string_length(str));
    return str;
}

It doesnt split into arrays, but it's close enough and does exactly what you want :D

Thank you, that's even more easier then the script I was going to use :D
Close thread :)

In Topic: String split to arrays. How to do this?

11 September 2012 - 04:00 PM

After some time I realized what I was doing wrong the whole time so plz close thread. Thank you :)

In Topic: Sprite Animation Simply Won't Play

27 July 2012 - 04:04 PM

You should also take into consideration that you should use image_speed while you set the sprite_index to the death animation. Set image_speed to a value near 1 for start to see if the animation will work now. If that is not your problem then I have no idea.

In Topic: Get screen resolution

25 July 2012 - 02:36 PM

Hello,

Thanks for your answer.

I made my game in 1920 x 1080 screen resolution. It runs fine on my Mac, and I have also tested it successfully on a larger Mac (2560 x 1440). Now I would like to run it on a smaller MacBook, but the resolution is - predictably - all messed up: the rooms are not resizing and are therefore partially outside of the screen!

Is there a way to make the game set its resolution to the screen's resolution (resizing itself)?

If that's not possible, the other idea is - related to my original question and the above answer - to somehow integrate a "second version" for MacBooks in my game, with additional pictures... in lower resolution, and to somehow switch between both versions according to the current screen size.

Has anyone done something like this before?
Is there more information about HOW to achieve this?

BTW: I read the beginning of an interesting thread on this matter in the forum some days ago but it's just gone now!

Many thanks.


I am having the exact problem but on Windows. I tried to run my game on different computers with different resolutions and only on some of them the mouse was going to the correct x and y and the images where exactly where I wanted. If anyone can give us a clue on how to fix that please do. Thanks

In Topic: Multiplayer Engine

23 July 2012 - 08:57 PM

If you need any help with design and stuff, I'm here to help. I can do some sprites and stuff on photoshop :)