Jump to content


mathiasbb12

Member Since 28 Sep 2010
Offline Last Active Mar 20 2013 06:58 PM

Posts I've Made

In Topic: Reading an Excel spreadsheet?

01 November 2012 - 05:18 PM

Assuming datafunctions to be installed, one can simply use a script like this:

// csv_read(fname)
var fname, file, rowlist, collist;
fname = argument0;
file = file_text_open_read(fname);
rowlist = ds_list_create();

while(!file_text_eof(file)){
  collist = ds_list_create();
  ds_list_add(rowlist, collist);
  str_to_list(file_text_read_string(file), ",", collist);
  file_text_readln(file);
}
file_text_close(file);
return(rowlist);
Above function opens and reads a csv file and returns a 2D ds_list structure; the list returned holds ds_list id's for the columns, these hold the actual values. To get the value from the third column (#2) of the second row (#1), you could use:
var rows, columns, value;
rows = csv_read(fname);
columns = ds_list_get(rows,1);
value = ds_list_get(columns,2);
// value now is the value in the second row on the third column

Edit: Note, this was made on the fly, from scratch, in the past 10 minutes. To be useful, a function to "close" the csv file, eg remove the data structures involved, should be added, as well as a function to save as csv. Maybe I'll make an extension for it, why not.


Whoa...perfect! THANKS! :)

In Topic: Multiplayer help needed!

10 October 2012 - 05:28 PM

Yeah, mplay is a dinosaur. It should be fairly easy to use 39dll, as there is a lot of documentation. Try this tutorial. It's what I first used to learn 39 and it's really good if you already have a prior knowledge to programming in general. If you need to do connection tests, I believe a large range of GMC members (including myself) would be glad to assist you.

Awesome...thanks! :)

In Topic: Leech Health Code?

10 October 2012 - 05:25 PM

I'm trying to figure out a way to make it so a hero can leech enemy health under say a collision event and can't figure it out, I couldn't find anything else under the forums relating to this, I may be in way over my head but thought I might as well ask and find out if someone else had any ideas.

Thanks in advance!

A simple way to do this would be to simply subtract a certain amount of health from the enemy object and then just increase the player's health by a certain amount. Like this:

other.health-=5; global.player_health+=5;

In Topic: Process Finding Dll V2

02 October 2012 - 04:27 PM

Link is broken again...update it please? :)

In Topic: Download file from website?

25 August 2012 - 02:53 AM

H0bbel's download manager works great: http://gmc.yoyogames...owtopic=451513. Very easy to implement, but supports:

  • Threaded downloading
  • Improved memory management (reduces chance of crashes)
  • Get the value of HTTP response headers
  • Pausing and resuming downloads
  • Custom HTTP request headers
  • Support for proxy servers
  • Partial downloading of files
  • Adding cookies to your download
  • Get the status of your download
  • Get the size of the download
  • Get the download speed in bytes per second
I've used it in several projects so far. Works perfectly! :D