0 registered members (),
1,438
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
Senior Expert
|
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: jcl]
#82116
07/19/06 06:01
07/19/06 06:01
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
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: Grimber]
#82118
07/20/06 07:36
07/20/06 07:36
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
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: Grimber]
#82120
07/20/06 09:29
07/20/06 09:29
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
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
Grimber
Expert
|
Expert
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
OP
Senior Expert
|
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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|