Hi i have been banging my head against this all night and just can`t figure a way to do it
I have a function which creates a grid, another which allows a player to select some ships so he can make a fleet, when a ship is selected from the image menu i use ent_create to get a model which i then want the player to place on the grid, so i kinda need a function which will actually create the ship only when the player clicks on the grid? could someone please help me out
here is the code which makes the grid
function tile_position
{
my.tilt = 90;
my.oriented =on;
my.transparent = on;
while(1)
{
my.alpha = 80+20*sin(my.x+my.y+total_ticks*15);
wait(1);
}
}
function create_table
{
var i;
while(i<table_width*table_width)
{
you = ent_create(tile_map,nullvector,tile_position);
your.x = (i%table_width)*tile_size-(table_width*tile_size)/2;
your.y = int(i/table_width)*tile_size-(table_width*tile_size)/2;
i+=1;
}
}
and this is the panel and current make ship code
function ship_selected()
{
if(bmapno == 1)
{
galor_class();
}
if(bmapno == 2)
{
keldon_class();
}
}
function ship_function()
{
my.enable_click = on;
if(mouse_left == 1)
{
ship_pan.visible = on;
}
}
function galor_class
{
ent_create(cgc_a, nullvector, ship_function);
}
i click on a button to get the ent_create to work, also for some reason my.enable_click does not seem to work