• 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 DS not existing? How the...

F

FredyJabe

Guest
Hi everyone,

I have a pretty annoying problem, it always says that my DS doesn't exists.

This is a piece of my create event
Code:
name = "?";
model = 0;
weapon = 0;
thrusters = 0;
wings = 0;
armor = 0;
shield = 0;
battery = 0;
genrator = 0;
cargo = 0;
shipButt = 0;

shipColor = c_white;
thrustColor = c_orange;

sector = "Unknown Sector";

canShoot = true;

maxHull = 100;
hull = maxHull;
maxEnergy = 1;
energy = maxEnergy;
maxShield = 1;
shield = maxShield;
cargo = ds_list_create();
maxCargo = 1;

ds_list_add(cargo,0,1,2,3,2,2);

speedPrevious = 0;
maxSpeed = 2;
acceleration = 0.25;
deceleration = 0.05;
rotation = 2;

image_speed = 0;

// Menustuff
drag = -1;
lastMX = 0;
lastMY = 0;

for (var i=0;i<4;i++)
{
    menuX[i] = 256;
    menuY[i] = 256;
}
menuW[0] = 0;
menuH[0] = 0;
menuW[1] = 372;
menuH[1] = 256;
menuW[2] = 0;
menuH[2] = 0;
menuW[3] = 0;
menuH[4] = 0;

itemNav = 1;

// Position stuff
lastX = x;
lastY = y;

flames = ds_queue_create();
alarm[1] = room_speed / 2;
And this is where the error is hapenning, in the draw event
Code:
/// Menu window drawing

for(var i=0;i<4;i++)
{
    if (menu[i])
    {
        switch(i)
        {
            case 0: // Main
                //
                break;
            case 1: // Inventory
                var xx = view_xview+menuX[i];
                var yy = view_yview+menuY[i];
               
                draw_set_color(c_white);
                draw_set_alpha(1);
                draw_sprite(sprHUDinventory,0,xx,yy);
               
                var activeItem = database_item_get(itemNav);
                draw_sprite(ds_map_find_value(activeItem,"ItemSprite"),0,xx+12,yy+12);
               
                draw_set_font(ftItemNavActive);
                draw_set_valign(fa_top);
                draw_set_halign(fa_left);
                draw_set_colour(c_black);
                draw_text(xx+136,yy+37,ds_map_find_value(activeItem,"Name"));
               
                var activeItemB, activeItemC;
                if (itemNav == 0) activeItemB = database_item_get(ds_list_find_value(cargo,ds_list_size(cargo)-1));
                else activeItemB = database_item_get(itemNav-1);
                if (itemNav == ds_list_size(cargo)) activeItemC = database_item_get(ds_list_find_value(cargo,1));
                else activeItemC = database_item_get(itemNav+1);
               
                draw_set_font(ftItemNav);
                draw_set_alpha(0.5);
                draw_text(xx+124,yy+12,ds_map_find_value(activeItemB,"Name"));
                draw_text(xx+124,yy+74,ds_map_find_value(activeItemC,"Name"));
               
                break;
            case 2: // Equiped
                //
                break;
            case 3: // Options
                //
                break;
            default:
                break;
        }
    }
}
at the itemNav part.

If anyone could look through my code, it's been almost an hour that Im stuck at this exact point.

Thanks,
Jabe :)
 

jo-thijs

Member
Hi and welcome to the GMC!

I can't directly find what's wrong with your code.
Could you provide more information?
Like, what's the object information (text that appears when clicking on "object information" when editing an object) of the object executing the code above?
And what's the entire error message you're getting?
And is there any other code in your project destroying DS structures?
 
Top