Can't Open File?

Posted By: Cactus

Can't Open File? - 10/31/08 17:12

Ok I wrote this piece of code I'm not good at c-script but I thought hey this should be easy enough.
Here is what the code is suppose to do: when you click the button it is supposed to display an entity onto the screen however when I click on the button it says cannot open file, I checked and my file is in the right folder so I dont know what to do here, mabey I did somthing wrong, heres my code:


ENTITY again_ent =

{
type = "again.bmp";
layer = 2;

x = 20;
y = 0;
z = 0;
}




function button_3()
{
ent_create(again_ent,temp,NULL);
}

BMAP background_bmp = "background.bmp";



PANEL background_pan =
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = background_bmp;
button (550, 134, "button_3.bmp", "button_3_over.bmp", "button_3_over.bmp", button_3,NULL, NULL);
flags = OVERLAY | VISIBLE;
}

Help with this would be greatly appriciated.
Thanks, Cactus
Posted By: rayp

Re: Can't Open File? - 10/31/08 17:24

Maybe the file is in read-only state, cause of another app using it?
Posted By: TechMuc

Re: Can't Open File? - 10/31/08 17:44

if you want to create a new entity with the filename "again.bmp" that's the correct code:

Code:
function button_3()
{
   ent_create("again.bmp",temp,NULL); 
}


if you want to show the VIEW-ENTITY you've defined above, that's the correct code
Code:
function button3()
{
   set(again_ent,VISIBLE); //you've already created the VIEW ent (note: that's not the way you decalare
//a normal level entity!) by declaring the struct, so you just have to make it visible :)
}

Posted By: rayp

Re: Can't Open File? - 10/31/08 17:50

Ure right TechMuc...i should read the questions more carefully smile
Posted By: Cactus

Re: Can't Open File? - 10/31/08 23:27

I tried the oode you gave me exactly and it gave me errors.
I have since modified the code to display a txt intead of an entity, still using the method you gave me and it gives me the same errors heres my code:

Bad or missing perameter is the error it gives


STRING try_again_str = "Try Again";

TEXT again_txt =

{
pos_x = 300;
pos_y = 250;
layer = 3;

string (try_again_str);
flags = INVISIBLE;
}

function button_3()
{

set("again_txt",VISIBLE);

}

BMAP background_bmp = "background.bmp";



PANEL background_pan =
{
pos_x = 0;
pos_y = 0;
layer = 0;
bmap = background_bmp;
button (550, 134, "button_3.bmp", "button_3_over.bmp", "button_3_over.bmp", button_3,NULL, NULL);
flags = OVERLAY | VISIBLE;
}


Thanks,
Cactus
Posted By: Cactus

Re: Can't Open File? - 11/01/08 01:05

k figured it out, thx for the replies
© 2024 lite-C Forums