Jump to content


Mark Ian

Member Since 17 Oct 2008
Offline Last Active May 17 2013 05:18 PM

Posts I've Made

In Topic: How Would You Programm This More Elegantly?

14 May 2013 - 07:36 PM

I do not want to avoid duplicates. It is a desired effect


In Topic: How Would You Programm This More Elegantly?

13 May 2013 - 07:55 PM

I have a second problem I am not sure how to tackle: I have an array with n values, some of the values are the same. The indexes of the values that match should be returned and the amount of same-value duplicates. I have a few ideas on how to do this, but again I'm not sure if it is the fastest way to compute. (I'll post my variant in a bit).

    dump=0;
        for (ii=0; ii<d_in_max;++ii) {                              
            if marker[ii]=0 {                                       
                for (iii=ii;iii<(d_in_max-ii);++iii) {              
                    if marker[iii]=0 and d_in[idd,ii]=d_in[idd,iii]{
                        dump+=1;                                    
                    }
                }
                for (iii=ii;iii<(d_in_max-ii);++iii) {              
                    if marker[iii]=0 and d_in[idd,ii]=d_in[idd,iii]{
                        marker[iii]=1;
                        if dump<4 {
                            d_in[idd,iii]+=dump                     
                        }else{
                            if (d_in[idd,iii]-(dump/2))>0 {
                                d_in[idd,iii]-=(dump/2)
                            }
                        }
                    }
                }
            }
        }

here is my current algorithm for the problem... there must be a better way. Ive looked at this website http://aperiodic.net/phil/archives/Geekery/find-duplicate-elements.html  but I cant get her or his ideas to work with my program.


In Topic: Unprecisely Gun

19 November 2012 - 04:58 PM

nah, include a bottle of vodka with your game and this code:
if vshoot=1 {
show_message('before pressing OK have a shot of vodka')
}

In Topic: Ini files in Studio

19 November 2012 - 04:21 PM

I agree. I am having the same problem. The .ini file the game has access to is located under (win7) 'x:Users\USERNAME\AppData\local\PROJECTNAME' The ini_read_real/string will read whatever is saved externally into the .ini file. When using the ini_write_real/string command, the game will write to something, because if one does another ini_read_real in the same section&amp;amp;key one will get a modified value. My guess is that gms now loads ini files into memory and the ini_write_x function only writes to memory and never to the ini file. Meaning the next time the game is started the ini file will be reset... not good! (Which totally defeats the purpose of ini files -.-)<br /><br />The ANSI/UTF8 format of the ini file has no effect on this phenomenon.

I've figured out what is going on: gms writes to ini files during the ini_close command :/ flip stuff around. This should be included in the help file

In Topic: Strings and .INI files

08 October 2012 - 09:08 PM

you show no example of ini_read_real(), sort of a basic function of INI files.