Jump to content


troido

Member Since 23 Oct 2011
Offline Last Active Mar 26 2013 02:29 PM

Topics I've Started

can't load 3d models

01 February 2012 - 09:37 PM

[solved]



Hello,

I am making a 3D game, and a map-editor that should save the maps in a file.
I have trouble in loading the model in the game.
No error occurs, but the model won't be drawn.
My code for loading the map is:
name=filename+".d3d"; //filename is asked to the player earlier, using get_string(str). It has no extension.

mworld=d3d_model_create();
d3d_model_load(mworld,name);
in the draw event is the code:
d3d_model_draw(mworld,0,0,0,tex[3]);

I have tried save the loaded model again.
This gives a file with just as many lines of code as the file the model is loaded from, but exept vor the start values, all the values in this file are zero.

Does somebody know what i did wrong?

ds_grid_read crash

23 October 2011 - 01:45 PM

Hello everyone

I try to make a game with a grid that stores the height of a position.
I want to be able to store the this grid in an INI file.
I use ds_grid_write to store, and all this works fine, but when i try to open it with ds_grid_read, the game crashes.

//saving
if keyboard_check_pressed(116){
height=ds_grid_write(z);
ini_open("mapp.ini");
ini_write_string("section","key",height);
ini_close();
}

//loading
if keyboard_check_pressed(117){
ini_open("mapp.ini");
height=ini_read_string("section","key","min 1");
ini_close();
ds_grid_read(z,height);//Game crashes here.
}

When i removed the ds_grid_read function, the game functions normal and variable height can be read as a string.