6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Panel below Entities
#276862
07/06/09 20:07
07/06/09 20:07
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
I asked for a new function of panels here: Panel.layer = lower than ent => below ent!?So i tried:
#include <acknex.h>
#include <default.c>
//========================================================================
BMAP* testbmap = "flatplane.tga";
//========================================================================
PANEL* test =
{
layer = -1;
bmap = testbmap;
flags = SHOW;
}
//========================================================================
function main()
{
fps_max = 60;
video_mode = 8;
level_load(NULL);
wait(3);
ent_create("cube.mdl", vector(0,0,0), NULL);
camera.tilt = -50;
camera.pan = 90;
camera.z = 500;
camera.x = 0;
camera.y = -250;
}
but the panel is still shown ABOVE the model... Do you know any way to show panels i want BELOW Entities?
|
|
|
Re: Panel below Entities
[Re: Joozey]
#277132
07/07/09 21:57
07/07/09 21:57
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
ok.. while iw ait for the the other topic.. Another question: How am i able to readout the bitmapname of a panel...? I need the name to be written into a my.string1 Problem: There´re many Panels.. and i need the filename of every panel ^^. Sylar said, i should use Structs.. but i´ve no clue how they work... That´s what i tried at the moment:
//=================================================================================================================================
// //
// DAS MAINSCRIPT //
// ^^^^^^^^^^^^^^ //
// //
//=================================================================================================================================
// //
// EINBINDEN DER UNTERORDNER UND SCRIPTS //
// """"""""""""""""""""""""""""""""""""" //
// //
//=================================================================================================================================
#define PRAGMA_PATH "Graphics\Characters"
#include <acknex.h>
#include <default.c>
//=================================================================================================================================
// //
// FUNKTIONEN //
// """""""""" //
// //
//=================================================================================================================================
typedef struct
{
STRING* name;
BMAP* bitmap;
} PANELMAP;
PANELMAP* mypanmap;
//=================================================================================================================================
// //
// DAS MAINSCRIPT //
// """""""""""""" //
// //
//=================================================================================================================================
function main()
{
fps_max = 60;
d3d_antialias = 9;
video_set(1024,768,32,0);
video_window(vector(10,10,NULL),NULL,48,"@-´-,-´-,-´-,- NEVERTOLD -,-`-,-`-,-`-@ ");
screen_color.red = 1;
screen_color.green = 1;
screen_color.blue = 1;
sky_color.red = 1;
sky_color.green = 1;
sky_color.blue = 1;
level_load(NULL);
wait(3);
str_cpy(mypanmap.name, "Gegner_Weißer Drachenreiter_stehen.png");
mypanmap.bitmap = bmap_create(mypanmap.name);
PANEL* test = pan_create("bmap = mypanmap.bitmap; flags = SHOW;", 10);
error(mypanmap.name);
}
But it only gives me an "E1513" Error.. Need help!!!
Last edited by Espér; 07/07/09 23:46.
|
|
|
Re: Panel below Entities
[Re: Joozey]
#277151
07/07/09 23:46
07/07/09 23:46
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
Sylar said, i should use Structs.. but i´ve no clue how they work... That´s what i tried at the moment:
//=================================================================================================================================
// //
// DAS MAINSCRIPT //
// ^^^^^^^^^^^^^^ //
// //
//=================================================================================================================================
// //
// EINBINDEN DER UNTERORDNER UND SCRIPTS //
// """"""""""""""""""""""""""""""""""""" //
// //
//=================================================================================================================================
#define PRAGMA_PATH "Graphics\Characters"
#include <acknex.h>
#include <default.c>
//=================================================================================================================================
// //
// FUNKTIONEN //
// """""""""" //
// //
//=================================================================================================================================
typedef struct
{
STRING* name;
BMAP* bitmap;
} PANELMAP;
PANELMAP* mypanmap;
//=================================================================================================================================
// //
// DAS MAINSCRIPT //
// """""""""""""" //
// //
//=================================================================================================================================
function main()
{
fps_max = 60;
d3d_antialias = 9;
video_set(1024,768,32,0);
video_window(vector(10,10,NULL),NULL,48,"@-´-,-´-,-´-,- NEVERTOLD -,-`-,-`-,-`-@ ");
screen_color.red = 1;
screen_color.green = 1;
screen_color.blue = 1;
sky_color.red = 1;
sky_color.green = 1;
sky_color.blue = 1;
level_load(NULL);
wait(3);
str_cpy(mypanmap.name, "Gegner_Weißer Drachenreiter_stehen.png");
mypanmap.bitmap = bmap_create(mypanmap.name);
PANEL* test = pan_create("bmap = mypanmap.bitmap; flags = SHOW;", 10);
error(mypanmap.name);
}
But it only gives me an "E1513" Error.. Need help!!!
|
|
|
Re: Panel below Entities
[Re: Espér]
#277152
07/07/09 23:51
07/07/09 23:51
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
You only have a pointer to your struct (PANELMAP* mypanmap;) and not the actual object. So you want to fill a bitmap pointer than doesn't exists (the bitmap pointer only exists in an actual object, not in an empty pointer). Either use PANELMAP mypanmap;, or fill mypanmap with the object in your function (mypanmap = malloc( sizeof(PANELMAP) );)
Also, when referencing pointers, say: PANELMAP* mypanmap; mypanmap.bitmap = NULL;
Then always use the arrow notation: PANELMAP* mypanmap; mypanmap->bitmap = NULL;
Last edited by Joozey; 07/07/09 23:54.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Panel below Entities
[Re: Joozey]
#277244
07/08/09 13:37
07/08/09 13:37
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
oh man.. structs are hell of shit to code... and the manual is actually not really good.. a few sentences and many examples wich said nonsense... HWERE THE HELL, are some really examples and a good manual to this..
seems like i use entity definated strings/bitmaps.. because i´ve really no clue how structs work..
Last edited by Espér; 07/08/09 13:42.
|
|
|
Re: Panel below Entities
[Re: Espér]
#277257
07/08/09 14:34
07/08/09 14:34
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Do you really need the REAL filename? Or would "Gegner_Weißer Drachenreiter_stehen_png" do for "Gegner_Weißer Drachenreiter_stehen.png"? Try error(mypan->bmap->link.name); (once the panel mypan is created of course)
ALSO: Just tested paanel behind entities. Panel must be negative layer AND sky_color must = 0,0,0
Last edited by EvilSOB; 07/08/09 14:56.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Panel below Entities
[Re: Espér]
#277265
07/08/09 15:02
07/08/09 15:02
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
ok.. this is my structcode:
//=================================================================================================================================
// //
// DIE BITMAPS //
// ^^^^^^^^^^^ //
// //
//=================================================================================================================================
//=================================================================================================================================
// //
// STRUCKTUREN //
// """"""""""" //
// //
//=================================================================================================================================
typedef struct
{
STRING* name;
BMAP* bitmap;
} PANELMAP;
//=================================================================================================================================
// //
// STRUCKTURENPOINTER //
// """""""""""""""""" //
// //
//=================================================================================================================================
PANELMAP* mypanmap;
//=================================================================================================================================
// //
// STRUCKTURENFUNKTION //
// """"""""""""""""""" //
// //
//=================================================================================================================================
PANELMAP* panelmapSetup(PANELMAP* inpanel)
{
str_cpy(inpanel.name, "test");
inpanel.bitmap = bmap_create(testobjekt);
}
//=================================================================================================================================
// //
// STRUCKTURENMEMORY //
// """"""""""""""""" //
// //
//=================================================================================================================================
mypanmap = malloc(sizeof(PANELMAP));
panelmapSetup(mypanmap);
and this is called right after level loading in the main function:
level_load("leer.wmb");
wait(3);
vec_set(camera.x, vector(0,-250,500));
vec_set(camera.pan, vector(90,-50,0));
error("str_cpy(mypanmap.name, Weisser_Drachenreiter_1+4.tga);"); ///////////
str_cpy(mypanmap.name, "Weisser_Drachenreiter_1+4.tga");
error("mypanmap.bitmap = bmap_create(mypanmap.name);"); /////////////////////////////
mypanmap.bitmap = bmap_create(mypanmap.name);
error("PANEL* testerpanel erstellen"); //////////////////////////////////////////////
pan_create("pos_x=300; pos_y=150; bmap = mypanmap.bitmap; flags = SHOW;", -10);
error(mypanmap.name);
What i get? a Crash in main right after the first error-message.
|
|
|
|