1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Can't Open File?
#234017
10/31/08 17:12
10/31/08 17:12
|
Joined: Apr 2004
Posts: 77 USA
Cactus
OP
Junior Member
|
OP
Junior Member
Joined: Apr 2004
Posts: 77
USA
|
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
HI
|
|
|
Re: Can't Open File?
[Re: rayp]
#234026
10/31/08 17:44
10/31/08 17:44
|
Joined: Jul 2008
Posts: 894
TechMuc
User
|
User
Joined: Jul 2008
Posts: 894
|
if you want to create a new entity with the filename "again.bmp" that's the correct 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
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 :)
}
|
|
|
Re: Can't Open File?
[Re: TechMuc]
#234098
10/31/08 23:27
10/31/08 23:27
|
Joined: Apr 2004
Posts: 77 USA
Cactus
OP
Junior Member
|
OP
Junior Member
Joined: Apr 2004
Posts: 77
USA
|
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
HI
|
|
|
Re: Can't Open File?
[Re: Cactus]
#234113
11/01/08 01:05
11/01/08 01:05
|
Joined: Apr 2004
Posts: 77 USA
Cactus
OP
Junior Member
|
OP
Junior Member
Joined: Apr 2004
Posts: 77
USA
|
k figured it out, thx for the replies
HI
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|