Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
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
0 registered members (), 1,438 guests, and 5 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
Page 1 of 2 1 2
Scene flag for skies - invalid parameter? #82114
07/19/06 01:35
07/19/06 01:35
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
It's stated and used in the manual in many areas. In my level that has a sky block, I set an entity with the scene flag on and it doesn't work. If I set the scene flag like this:

my.scene = on;

I get a compiler error saying of an unknown parameter. Why is it doing this? Does this flag even exist? If it doesn't exist, then why is it stated often in the manual? If it does exist, why is it saying that it's an unknown parameter and why doesn't it work? The scene flag places the entity at the back end of the Z-buffer so that it's always drawn behind everything. I'm using 6.40.5 Commercial.

Download my sample project here (ZIP file - 418 KB) and add the "my.scene = on;" line after the first while loop of the only action near the bottom.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Scene flag for skies - invalid parameter? [Re: ulillillia] #82115
07/19/06 05:29
07/19/06 05:29
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
See manual -> sky -> scene. Sky flags are for sky definitions only.

Re: Scene flag for skies - invalid parameter? [Re: jcl] #82116
07/19/06 06:01
07/19/06 06:01
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
It still doesn't work. Have you seen the project. I defined the scene flag in a sky definition and it still doesn't work at all.

Edit: This is how I have the sky defined:

Code:

sky skysphere // define the sky object - only works if a block with a sky texture is given
{
layer = 3; // pick a number, any number (or is it card?)
flags = scene, visible; // scene flag - puts this object in the back end of the Z-buffer to make it infinitely distant
}



Then in the action, I have this:

Code:

action scaled_sky
{
proc_late(); // required to prevent odd effects from occurring
my.skill1 = 16; // change this to the scaling value you want - at 64, the area becomes 64 times larger than the model and at 4, it becomes 4 times larger than the model
skysphere = me;

while (!skysphere) // wait until pointer is valid
{
wait(1);
}

while(1)
{
my.x=camera.x/my.skill1*(my.skill1-1);
my.y=camera.y/my.skill1*(my.skill1-1);
my.z=camera.z/my.skill1*(my.skill1-1);

/*
my.x = 4/camera.x; // play with the 16 and see what effect it has.
my.y = 4/camera.y; // at 64, the sky sphere should be 4 times bigger than with this
my.z = 4/camera.z; // at 4, the sky sphere should be 4 times smaller than this and 16 times smaller than if 64
*/
wait(1);
}
}



The scene flag still does not work.

Last edited by ulillillia; 07/19/06 06:06.

"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Scene flag for skies - invalid parameter? [Re: ulillillia] #82117
07/19/06 07:42
07/19/06 07:42
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
i don't think ent_creating a level entity ( which is what ent_create does) then trying to assign it to a defined sky definition works like that.

try using the ent_createlayer to dynamicly create a sky defined entity

Re: Scene flag for skies - invalid parameter? [Re: Grimber] #82118
07/20/06 07:36
07/20/06 07:36
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
For some reason, ent_createlayer isn't working either. How do you get it to set the sky and scene flags? The manual is so vague about it. It has a number instead.

skysphere = ent_createlayer(skysphere_mdl, scene, 3);
// flags = sky, scene; // how do I put this into the flags part?

I need to assign the action to it so that it moves at a slower speed than the camera to get the great distance I'm after.... It's what my main intent is.

I try adding the entity into WED and assigning the action (and pointer) in there, and it still doesn't work. My main intent is to have this object drawn behind everything else (the function of the scene flag), but to move with the camera at a slightly slower speed to give the sense of an extreme distance.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Scene flag for skies - invalid parameter? [Re: ulillillia] #82119
07/20/06 09:10
07/20/06 09:10
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
you don;t assign an action to a sky ( just like you don;t to a view entity)

you have to referance it by pointer

entity* myobject;

my_object = ent_creatlayer("skysphere.mdl",scene,3);


then a function to manipulate your sky entity created above

function move_skyent()
{
my_object.x +=5;
...
}

Re: Scene flag for skies - invalid parameter? [Re: Grimber] #82120
07/20/06 09:29
07/20/06 09:29
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
I've tried that, it says "parameter unknown: scene".

Code:

entity* skysphere;

function scaled_sky()
{
proc_late(); // required to prevent odd effects from occurring
my.skill1 = 16; // change this to the scaling value you want - at 64, the area becomes 64 times larger than the model and at 4, it becomes 4 times larger than the model
skysphere = me;

while (!skysphere) // wait until pointer is valid
{
wait(1);
}

// my.scene = on;

while(1)
{
my.x=camera.x/my.skill1*(my.skill1-1);
my.y=camera.y/my.skill1*(my.skill1-1);
my.z=camera.z/my.skill1*(my.skill1-1);

/*
my.x = 4/camera.x; // play with the 16 and see what effect it has.
my.y = 4/camera.y; // at 64, the sky sphere should be 4 times bigger than with this
my.z = 4/camera.z; // at 4, the sky sphere should be 4 times smaller than this and 16 times smaller than if 64
*/
wait(1);
}
}

function main()
{
fps_max = 200; // gives me 64 fps in both fullscreen and windowed mode

wait(3);

level_load(samplelvl); // load the level
wait(3);

camera.x = -1024;
camera.y = -2560;
camera.z = 0;
camera.pan = 67.5; // face north-northeast at startup
skysphere = ent_createlayer("skysphere.mdl", scene, 3); // scene is an unknown parameter
scaled_sky();
wait(1); // registers this data
move_camera(); // allow for camera movement
}



As I said, it doesn't work.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Scene flag for skies - invalid parameter? [Re: ulillillia] #82121
07/20/06 10:24
07/20/06 10:24
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
you can't use ent_createlayer in c-script like that . you need to build a dll for it ...the remarks under the ent_createlayer in the manual state that

Last edited by Grimber; 07/20/06 10:26.
Re: Scene flag for skies - invalid parameter? [Re: Grimber] #82122
07/20/06 10:37
07/20/06 10:37
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
So how do I use the scene flag using C-script, or is it even possible at all? I ran into this issue in May or so of 2005 when I was working on my 3D game. I still haven't resolved the issue and ran into it again when I made that small demo.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Scene flag for skies - invalid parameter? [Re: ulillillia] #82123
07/20/06 12:04
07/20/06 12:04
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
im pretty sure flags like cube, dome, scene, cylinder have to be set during definition only, not changable during runtime.

of course i've yet to run into a situation so far where i needed to change them.
I've only used ent_createlayer like 2 times and then found it not worht the hassle ( at least untill c-lite) as its easier to figure out max number of sky definitions you need visible at any given time on screen and define that many (if you have your project propoerly planned out). then change the alterable values as needed.

i.e.
define 1 skycube then chnage teh type= value for differnt images vs maming 1 defien for each image
define 8 sky model entities and morph the models as needed

Page 1 of 2 1 2

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