Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (AndrewAMD, fogman, Grant, juanex), 972 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
sprite as sky??? #275350
07/01/09 04:59
07/01/09 04:59
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline OP
User
the_mehmaster  Offline 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:

Code:
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] #275354
07/01/09 05:51
07/01/09 05:51
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline OP
User
the_mehmaster  Offline OP
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
Ok this is REALLY starting to annoy me now..

When i get rid of the sky definition on the first level, the one on the second level works as it should.

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 Offline
Expert
EvilSOB  Offline
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 Offline OP
User
the_mehmaster  Offline OP
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
Did what you suggested:
Code:
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] #275375
07/01/09 07:45
07/01/09 07:45
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline OP
User
the_mehmaster  Offline OP
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
Ok i just programmed myself a workaround. Not perfect but works..

Thanks for your help.

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 Offline
Expert
EvilSOB  Offline
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: EvilSOB] #275661
07/02/09 06:46
07/02/09 06:46
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline OP
User
the_mehmaster  Offline OP
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
I'll give you a rundown of the problem then solution if you want:

1.load one level without a sprite
2.load a skycube from an external function. (this works fine)
3.wipe the last level with a new level_load function that loads a level with a sprite
4.load a skycube from an external function. (This DOES NOT work)
It stuffs up on the last step.

But if I:
1.load one level with a sprite
2.load a skycube from an external function. (this works fine)
3.load another level with a sprite
4.load a skycube from an external function. (this works fine)
works fine.

In other words if you want to load levels in succession with a skycube, they must all have a sprite or the must all not have a sprite. it cannot be mixed.

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 Offline
Expert
EvilSOB  Offline
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
Re: sprite as sky??? [Re: EvilSOB] #275716
07/02/09 08:45
07/02/09 08:45
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline OP
User
the_mehmaster  Offline OP
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
the skycube pointer is set to NULL in the next level if that's what you mean..


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