• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows how does one do 3d on gamemaker education or 1.4 with d3d?

zorth

Member
how does one do 3d on game maker education or 1.4 with d3d?
all I found works with gm2 not what I'm working with. can someone help me it's a school project.
 

zorth

Member
GML:
///Shooting

//Fire weapon   
if (mouse_check_button_pressed(mb_left))
{

    if (mana > 0){
    //fire bullet
    var n = instance_create(x, y, obj_bullet);
    n.z = player_height;
    n.xto = xto + x;
    n.yto = yto + y;
    n.zto = zto - player_height;
    n.damage = 100;
     mana -= 10;
     with (obj_spell)
    {
        image_index = 0;
        image_speed = 0.9;
    }

    }



}
GML:
///Move bullet
/*
//movement
x += xto;
y += yto;
z += zto;
*/
var range = 0;
var maxrange = 3000;
do
{
    x += xto;
    y += yto;
    z += zto;
    range++;
}
until (range >= maxrange || z <= 0 || place_meeting(x, y, obj_wall) || place_meeting(x, y, obj_zombie))

if (place_meeting(x, y, obj_zombie))
{
    var inst = instance_place(x, y, obj_zombie);
    if (z < inst.height)
    {
        inst.hp -= damage;
    }
}

//destroy
instance_destroy();

this is what I got
 

chamaeleon

Member
What's all this
GML:
do {
...
} until (...)
business which appears to be for the purpose of having something move over time .. I think. Anyway, the step/frame in which you run the code in the second code block, the instance will be destroyed. It won't be destroyed some amount of time later.
Maybe you want something akin to
GML:
if (mouse_check_button_pressed(mb_left))
{
    if (mana > 0){
    //fire bullet
    var n = instance_create(x, y, obj_bullet);
    n.z = player_height;
    n.xto = xto + x;
    n.yto = yto + y;
    n.zto = zto - player_height;
    n.damage = 100;
    n.range = 0;
     mana -= 10;
     with (obj_spell)
    {
        image_index = 0;
        image_speed = 0.9;
    }
    }
}
GML:
x += xto;
y += yto;
z += zto;
range++;

if (place_meeting(x, y, obj_zombie))
{
    var inst = instance_place(x, y, obj_zombie);
    if (z < inst.height)
    {
        inst.hp -= damage;
    }
}

//destroy
var maxrange = 3000;
if (range >= maxrange || z <= 0 || place_meeting(x, y, obj_wall) || place_meeting(x, y, obj_zombie))
    instance_destroy();
 

zorth

Member
What's all this
GML:
do {
...
} until (...)
business which appears to be for the purpose of having something move over time .. I think. Anyway, the step/frame in which you run the code in the second code block, the instance will be destroyed. It won't be destroyed some amount of time later.
Maybe you want something akin to
GML:
if (mouse_check_button_pressed(mb_left))
{
    if (mana > 0){
    //fire bullet
    var n = instance_create(x, y, obj_bullet);
    n.z = player_height;
    n.xto = xto + x;
    n.yto = yto + y;
    n.zto = zto - player_height;
    n.damage = 100;
    n.range = 0;
     mana -= 10;
     with (obj_spell)
    {
        image_index = 0;
        image_speed = 0.9;
    }
    }
}
GML:
x += xto;
y += yto;
z += zto;
range++;

if (place_meeting(x, y, obj_zombie))
{
    var inst = instance_place(x, y, obj_zombie);
    if (z < inst.height)
    {
        inst.hp -= damage;
    }
}

//destroy
var maxrange = 3000;
if (range >= maxrange || z <= 0 || place_meeting(x, y, obj_wall) || place_meeting(x, y, obj_zombie))
    instance_destroy();
the object is not spawning

GML:
//Draw bullet
var t = sprite_get_texture(spr_bullet, 0);
var s = 64;
d3d_draw_ellipsoid(x, y, z, x+s, y+s, z+s, t, 1, 1, 16);
this is the draw code I don't know what's wrong
 

chamaeleon

Member
uh trial and error. I don't know much about GM
The Debugger
show_debug_message()

They will save you time and hair if you learn to use them. I typically tend to prefer using show_debug_message() because I can restart the program, and assuming things run more or less the same, I get more or less the same output, except for changes in what I log and changes related to my program logic I do in order to fix a bug. The debugger is of course useful if you want to be able to inspect the program state from time to time or step through lines of code. Depends on what you're doing.

In any case, if you say "the object is not spawning", your immediate course of action after thinking that sentence should be to identify which line is supposed to be responsible for the spawning. Ensure that it runs using either of the above methods, collect data about why/why not an instance was created, and what parameters were used.

Collecting data using show_debug_message(), and including that with your code containing the show_debug_message() statements, will make it so much easier for others to help you.

In short, the goal is to have the program tell you exactly what it is doing and why, so you don't need to guess.
 

zorth

Member
The Debugger
show_debug_message()

They will save you time and hair if you learn to use them. I typically tend to prefer using show_debug_message() because I can restart the program, and assuming things run more or less the same, I get more or less the same output, except for changes in what I log and changes related to my program logic I do in order to fix a bug. The debugger is of course useful if you want to be able to inspect the program state from time to time or step through lines of code. Depends on what you're doing.

In any case, if you say "the object is not spawning", your immediate course of action after thinking that sentence should be to identify which line is supposed to be responsible for the spawning. Ensure that it runs using either of the above methods, collect data about why/why not an instance was created, and what parameters were used.

Collecting data using show_debug_message(), and including that with your code containing the show_debug_message() statements, will make it so much easier for others to help you.

In short, the goal is to have the program tell you exactly what it is doing and why, so you don't need to guess.
um that's for gm2 and is sadly not what i am using
 
Top