Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/23/26 21:52
WFO Training with parallel cores Zorro64
by Martin_HH. 02/23/26 15:29
Camera always moves upwards?
by clonman. 02/21/26 09:29
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (AndrewAMD), 6,385 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Panel error #66375
03/14/06 14:41
03/14/06 14:41
Joined: Feb 2006
Posts: 43
S
shady Offline OP
Newbie
shady  Offline OP
Newbie
S

Joined: Feb 2006
Posts: 43
Code:
string file_name = "t";
string file_type = ".pcx";
string file;
string file_number;

panel transform_l01_normal
{
flags = d3d, visible;
layer = 11;
}

function random_panel()
{
var i;
i = int(random(3))+1;
str_cpy(file,file_name);
str_for_num(file_number,i);
str_cat(file,file_number);
str_cat(file,file_type);

transform_l01_normal.bmap = file;
}


i have some files (t1.pcx, t2.pcx, t3.pcx,....).
where is the error?
the game crashes if i call this function...

Last edited by shady; 03/14/06 14:42.
Re: Panel error [Re: shady] #66376
03/14/06 14:50
03/14/06 14:50
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
transform_l01_normal.bmap = file; This is the problem. You're trying to assign a string to a bmap. Try this:
bmap* bmap_ptr; // define this outside of the function.

bmap_ptr = bmap_create(STRING* name);
transform_l01_normal.bmap = bmap_ptr;

Re: Panel error [Re: Excessus] #66377
03/14/06 15:01
03/14/06 15:01
Joined: Feb 2006
Posts: 43
S
shady Offline OP
Newbie
shady  Offline OP
Newbie
S

Joined: Feb 2006
Posts: 43
error:
"non existing/empty function bmap_create"

and instead of "STRING* name" i have to write "file", as this is my filename-string. am i right?

Re: Panel error [Re: shady] #66378
03/14/06 15:03
03/14/06 15:03
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Yes you are right. To use this instruction you'll need the 6.40 beta version I think.. You can find it in the updates & announcements forum.

Re: Panel error [Re: Excessus] #66379
03/14/06 15:36
03/14/06 15:36
Joined: Feb 2006
Posts: 43
S
shady Offline OP
Newbie
shady  Offline OP
Newbie
S

Joined: Feb 2006
Posts: 43
isn't there another way? i don't really want to install a beta update.

Re: Panel error [Re: shady] #66380
03/14/06 15:40
03/14/06 15:40
Joined: Aug 2005
Posts: 199
houston
S
seneca Offline
Member
seneca  Offline
Member
S

Joined: Aug 2005
Posts: 199
houston
you can do it the long ugly way. define all the panels seperately with the separate bitmaps and then use a random to view the different panels each time you call the panel.

long and ugly, but it'll do ya!


a8 commercial
Re: Panel error [Re: seneca] #66381
03/14/06 15:49
03/14/06 15:49
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Yea, you could define all bitmaps and store their handles in an array. Something like this:

bmap t1 = <t1.bmp>;
bmap t2 = <t2.bmp>;
bmap t3 = <t3.bmp>;
var bitmap_array[3];
starter store_bmaps()
{
bitmap_array[0] = handle(t1);
bitmap_array[1] = handle(t2);
bitmap_array[2] = handle(t3);
}

then in the function use:
function random_panel()
{
var i;
i = int(random(3))+1;
bmap_ptr = ptr_for_handle(bitmap_array);
transform_l01_normal.bmap = bmap_ptr;
}


Gamestudio download | 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