Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AbrahamR), 717 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Can't Open File? #234017
10/31/08 17:12
10/31/08 17:12
Joined: Apr 2004
Posts: 77
USA
Cactus Offline OP
Junior Member
Cactus  Offline 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: Cactus] #234021
10/31/08 17:24
10/31/08 17:24
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Maybe the file is in read-only state, cause of another app using it?


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Can't Open File? [Re: rayp] #234026
10/31/08 17:44
10/31/08 17:44
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
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 :)
}


Re: Can't Open File? [Re: TechMuc] #234027
10/31/08 17:50
10/31/08 17:50
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Ure right TechMuc...i should read the questions more carefully smile


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
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 Offline OP
Junior Member
Cactus  Offline 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 Offline OP
Junior Member
Cactus  Offline OP
Junior Member

Joined: Apr 2004
Posts: 77
USA
k figured it out, thx for the replies


HI

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1