|
|
sprite as sky???
#275350
07/01/09 04:59
07/01/09 04:59
|
Joined: Dec 2008
Posts: 528 Wagga, Australia
the_mehmaster
OP
User
|
OP
User
Joined: Dec 2008
Posts: 528
Wagga, Australia
|
I thought i would solve this one, but i have absolutely no idea! Ok so this is what happens.. 1.I load my first level, without any sprites in it, and the sky shows up fine. 2.I load my second level, with some sprites in it. For some reason the last sprite in the level is set as the sky cube, which i dont want. My loading sequence for the second level is:
main_menu.flags = OVERLAY; // get rid of the menu panel
main_menubuttons.flags = OVERLAY; // get rid of the menu panel
level_load("level1.wmb"); //load the level
wait(4); //wait a bit for the level to load
shadow_stencil = 3; // i want shadows
mouse_mode = 0; // no mouse
camera.pan = -180; // put the camera in the right place
ent_createlayer("clouds.bmp",SKY|CUBE|VISIBLE,10); // create a skycube with all sides the same
Can anyone help? I have A7 Extra V7.77.
|
|
|
Re: sprite as sky???
[Re: the_mehmaster]
#275359
07/01/09 06:13
07/01/09 06:13
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
meh...simple.
NEVER USE ??.FLAGS = SOMETHING Always use the set(??,SOMETHING); if your in lite-c or else use ??.SOMETHING = on; in c-script.
3DGS has hidden flags it uses for handling things inside the engine. And if you use bulldozer-tactics like main_menu.flags = OVERLAY, then overlay get set on, but ALL the other flags get turned off, including the hidden ones! This can have very un-expected and un-diagnosable results, like you are getting now.
So are you lite-c or c-script? I can re-do your posted code so you can see how its done if you want...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: sprite as sky???
[Re: EvilSOB]
#275367
07/01/09 06:38
07/01/09 06:38
|
Joined: Dec 2008
Posts: 528 Wagga, Australia
the_mehmaster
OP
User
|
OP
User
Joined: Dec 2008
Posts: 528
Wagga, Australia
|
Did what you suggested:
reset(main_menu,VISIBLE);
reset(main_menubuttons,VISIBLE);
level_load("level1.wmb");
wait(4);
mouse_mode = 0;
camera.pan = -180;
ent_createlayer("clouds.jpg",SKY|CUBE|VISIBLE,10);
I also replaced similar instances like this. But still doesn't work.
|
|
|
Re: sprite as sky???
[Re: the_mehmaster]
#275385
07/01/09 08:49
07/01/09 08:49
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
WTF, VISIBLE flag? Unless your using an old version, you should use SHOW. Also, when using ent_create() or ent_createlayer(), Im pretty sure that SHOW (or VISIBLE) is ON by default...
And what was the workaround? Cause from that I should be able to figure what was actually wrong. You never know, it may be an engine bug that needs fixing.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: sprite as sky???
[Re: the_mehmaster]
#275679
07/02/09 07:56
07/02/09 07:56
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Hmmm, thats irritating. Im not much of a "level" programmer, just use em for testing scripts. But is the "externally" created skycube actually being removed when you wipe the level? Or is possibly remaining and getting tangled up with the sprite in the next level-load?
Try creating your external skycube with a global pointer and making sure it is remooved before the level-load and see if it makes a difference. You MAY be building layer-upon-layer of no-longer-used skycubes, because the skycube was built externally, the level-load may not wipe it...
I know I have had problems in the past with ANY entities created after a level-load start to behave sporadically and interfereing with new entites brought in with a later level-load. It seems their pointer get tangled somehow.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|