Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Question
Question
2003-01-11, 5:45 PM #1
Is it possible to make a sprite (preferably a sun) connected to a light, that rotates on frames? Which would make a night/day effect, im talkin' coggalicious.... GBK, or anyone else, wouldja know?
2003-01-13, 3:19 PM #2
Sprites are evil!

Say it with me:

Sprites are evil!

Day night, huh?

Okay, first I'll address why NOT to use sprites for a sun (and/or moon) for this effect you want to achieve.

The reason is, that if you switch to 3rd person, it makes it very obvious that your using a sprite because it'll put it at an ackward position/rotation relative to the camera position/rotation.

What you want to do is go ahead and (since your using frames anyhow) rotate it to it's new postion anyhow. Now, you might ask how do I know in what position to rotate it into without a good reference to go by? Well, I'm about to give you a reference, so bare with me a sec.

Now, create your large sector that everything in your level is going to be in. Now, give it solid green textures (make sure it's still +geo 4, though). Yes, you heard me right, solid green, perferably close to the color Massassi uses. Why? Because if you make trees like most everyone else here does, it'll keep that translucent part of the leaves green (flagging 'blocks light' helps with that too).

So what about the sky?

Make a large dome 3do that will incumpus your level, this will be your sky. I recommend getting some good animated sky mats and linking them via a cog, so that you have nice smooth day to night to day sky transitions.

So, you will now use this large dome as a reference point as to where the surface face should be pointing.

To make it the producer of the light...give the thing an added value called EXTRA LIGHT and assign a value in it....I suggest a rather large number if it is your sole provider of light. Only draw back is, this is dynamic lighting, so it doesn't work on JK archi., so you best choice would be to go all 3do.

Hope that little tutorial helped, enjoy.

P.S., if you have any questions, e-mail me.

[edit]Clarification[/edit]

[This message has been edited by Friend14 (edited January 13, 2003).]
Math is infinitely finite, while the universe is finitely infinite. PI = QED
2003-01-15, 1:28 PM #3
Questions on that solution:

You seem to be suggesting that this big sky dome 3DO be textured with animating mats - that's asking alot regarding texture alignment. Then control of the animation via cog is not very flexible (not dealing with sector surfaces) - only by repeatedly stepping through each cell of a multi-celled mat.

Making a level purely out of 3DOs severely limits what you can do with player interaction via cogs (no sectors or surfaces to work with).

------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2003-01-15, 2:15 PM #4
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Sylvicolus:
Making a level purely out of 3DOs severely limits what you can do with player interaction via cogs (no sectors or surfaces to work with).

</font>


Not really. You can have all the sectors you want (within adjoin limits) and 3dos spaced out over several sectors and do what you want to do. Using the "flickering" method (as I like to call it) with the 3do level geometry. Basically you just create and destroy all the things over and over using a cog, and they won't flicker or dissapear. [http://forums.massassi.net/html/smile.gif]
-Hell Raiser
2003-01-15, 6:17 PM #5
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Sylvicolus:
Questions on that solution:

You seem to be suggesting that this big sky dome 3DO be textured with animating mats - that's asking alot regarding texture alignment. Then control of the animation via cog is not very flexible (not dealing with sector surfaces) - only by repeatedly stepping through each cell of a multi-celled mat.

Making a level purely out of 3DOs severely limits what you can do with player interaction via cogs (no sectors or surfaces to work with).

</font>


From my understanding, there is a program that will be released to the JK community that will help with the texturing/stitching issues (I've already beta tested it, if you were wondering).

Let me do some clarifying. This is meant for large open terrain areas with using 1 and only 1 sector (unless you want an underwater area, then it's okay to have a second sector below it). If your doing it for something to look out of a window from your level, then you need to stick with the traditional skyboxes.

A single mat can hold a limit of 16 cels, so, to provide a smooth transition, you will need a cog that simply replaces the subsequent mat with a new mat that has 16 more cels to work with (after the first mat has run 1 time through it's cels). How many different mats you need to achieve this depends on you. For added effect, you can make a sphere with a trans cloud mat and have it rotate around the terrain.

If you need something to be activated by cog (similier to that of crossing an adjoin), then simply place a ghost object and use it for the same purpose.
Math is infinitely finite, while the universe is finitely infinite. PI = QED
2003-01-16, 3:34 AM #6
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Hell Raiser:
Not really. You can have all the sectors you want (within adjoin limits) and 3dos spaced out over several sectors and do what you want to do. Using the "flickering" method (as I like to call it) with the 3do level geometry. Basically you just create and destroy all the things over and over using a cog, and they won't flicker or dissapear. [http://forums.massassi.net/html/smile.gif]</font>


Where might I acquire the cog for this? I'm not working on any levels at the moments and it seems like a simple concept, but I'd still like to look at it.
2003-01-17, 11:58 AM #7
I was also thinking about a large skybox with a rising sun and moon, but the problem is, that those dynamic lights don't have enough range...
You basically move a sun (or moon) template object that has a light and sprite value set. Oh, and you should also make the sky change from blue to starryblack.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2003-01-18, 8:21 PM #8
Quote:
<font face="Verdana, Arial" size="2">Originally posted by zagibu:
...Oh, and you should also make the sky change from blue to starryblack.

</font>


...Yeah, that's the idea behind the animated mats for the skydome. TerraGenes renderings are pretty good for this.


Oh yeah, and I forgot one more thing, give the Skydome an EXTRA LIGHT value (not much, but some). That will help with lighting issues.


[This message has been edited by Friend14 (edited January 18, 2003).]
Math is infinitely finite, while the universe is finitely infinite. PI = QED
2003-01-18, 9:00 PM #9
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Wave_Of_Mutilation:
Where might I acquire the cog for this? I'm not working on any levels at the moments and it seems like a simple concept, but I'd still like to look at it.
</font>


The concept is mind blowingly simple and works perfectly too. Seems JK will render a thing completly once it's created, then do the sector/view thing afterwards. I made this cog for TDiR as we have a level that needs it. (islands that are 3dos and cross a the water and air sectors) It handles 10 things, and if you know your cog, it's insanely easy to add support for more. [http://forums.massassi.net/html/smile.gif]

Code:
# Jedi Knight Cog Script
#
# flicker.cog
#
# Makes it so that 3dos crossing more than one sector don't
# flicker or disappear and also when the player looks at it
#
# Go go Hellcat for explaining this to me. =)
#
# Concept by Hellcat (and GBK?)
# Raped for TDiR by Hell Raiser [Jon Harmon]

flags=0x240

symbols

int			ObjCount			local

thing		ObjThng0=-1
thing		ObjThng1=-1
thing		ObjThng2=-1
thing		ObjThng3=-1
thing		ObjThng4=-1
thing		ObjThng5=-1
thing		ObjThng6=-1
thing		ObjThng7=-1
thing		ObjThng8=-1
thing		ObjThng9=-1

template	ObjTpl0			local
template	ObjTpl1			local
template	ObjTpl2			local
template	ObjTpl3			local
template	ObjTpl4			local
template	ObjTpl5			local
template	ObjTpl6			local
template	ObjTpl7			local
template	ObjTpl8			local
template	ObjTpl9			local

vector		ObjPos0			local
vector		ObjPos1			local
vector		ObjPos2			local
vector		ObjPos3			local
vector		ObjPos4			local
vector		ObjPos5			local
vector		ObjPos6			local
vector		ObjPos7			local
vector		ObjPos8			local
vector		ObjPos9			local

vector		ObjLook0		local
vector		ObjLook1		local
vector		ObjLook2		local
vector		ObjLook3		local
vector		ObjLook4		local
vector		ObjLook5		local
vector		ObjLook6		local
vector		ObjLook7		local
vector		ObjLook8		local
vector		ObjLook9		local

message		startup                                                          
message		pulse                                                            

end                                                                           

code

startup:

	//Get our local player
	player = GetLocalPlayerThing();

	ObjCount=0;

	for(x=0; x<10; x=x+1)
	{if(ObjThng0[x] != -1) ObjCount=ObjCount+1;}

	//Sleep while the level loads
	sleep(0.25);

	//Get the rotation and position and template of the object

	for(x=0; x<ObjCount; x=x+1)
	{
		ObjPos0[x]=GetThingPos(ObjThng0[x]);
		ObjLook0[x]=GetThingLVec(ObjThng0[x]);
		ObjTpl0[x]=GetThingTemplate(ObjThng0[x]);
	}

	//Start our pulse
	SetPulse(0.01);

return;

pulse:

	for(x=0; x<ObjCount; x=x+1)
	{	
		//Destroy the 3do	
		DestroyThing(ObjThng0[x]);

		//Recreate the 3do
		ObjThng0[x]=CreateThingAtPos(ObjTpl0[x], GetThingSector(Player), ObjPos0[x], ObjLook0[x]);

		SetThingLook(ObjThng0[x], ObjLook0[x]);
	}

return;

end
-Hell Raiser
2003-01-18, 11:42 PM #10
Credit goes to GBK for his dynamic lighting discovery. I just stole his idea [http://forums.massassi.net/html/tongue.gif]
Team Battle.

↑ Up to the top!