Jump to content


JBxFootballx92

Member Since 23 Apr 2007
Offline Last Active Sep 05 2012 06:46 AM

Posts I've Made

In Topic: Global .ini file properties?

05 September 2012 - 06:47 AM

Solved! Thanks for the help everyone!

I was able to get everything on one line using find and replace in my word editor.  Then i just put it in the same folder, used the coding from above  and its working just how i want it!

Thanks again!

In Topic: Global .ini file properties?

05 September 2012 - 05:02 AM

Does every word need to have it's own line for this?

In Topic: Global .ini file properties?

05 September 2012 - 03:59 AM


How could i use a text file? Do I just put all the words in one and then search to see if the words exist?
If so, what codes would i use to read it?

Look up the functions that start with file_text_, then use them to read the dictionary line-by-line. The most convenient method of lookup is, of course, storing the data inside a list and then calling ds_list_find_index(). But if you don't have access to Pro, loading it into an array then using a linear search on it also works (a binary search would be better if the words in your dictionary are alphabetically ordered).

Here I will demonstrate the shorter list lookup --- if you need the array-based method, you can try that yourself.

Setup
var f;
f = file_text_open_read("dictionary.txt");
global.dictionary = ds_list_create();
while (!file_text_eof(f)) {
  ds_list_add(global.dictionary, file_text_read_string(f));
  file_text_readln(f);
}
file_text_close(f);

Lookup
word = "abcd";
if (ds_list_find_index(global.dictionary, word) > -1) {
  //"abcd" is in the dictionary
}

GameGeisha


Thanks for the reply, sadly I don't have Pro :[
any tips on how to go about with array method?
Sorry, I have no experience using outside files, everything I've made before was done internally

In Topic: Global .ini file properties?

05 September 2012 - 03:27 AM

Does it need to be an ini? Seems easier to use normal text files. If it's absolutely essential then you could just make a script to go through and assign each word a value so you don't have to do it manually.
dat Tosh


How could i use a text file? Do I just put all the words in one and then search to see if the words exist?
If so, what codes would i use to read it?

In Topic: Team Fortress 2 is the best game on Steam

08 January 2012 - 07:56 PM

It's the one game from steam I play most, so I guess it is the best one...


It's also the one I always come back to between big game releases.