Page 1 of 1

How do I add a sun to the sky? (FAQ)

Posted: Sat Nov 24, 2007 12:59 pm
by [SBF]ATATFIGHTR
I want to have a Sun in the sky, I've got a the lighting, but how do I add the sun in the sky?

Re: Where is the Sun!?!?

Posted: Sat Nov 24, 2007 1:13 pm
by aYo.4.YaYo
i think u have to edit the skys .tga and draw one in...

Adding a sun to your map

Posted: Sat Nov 24, 2007 1:15 pm
by AceMastermind
You need to insert some code into your ABC.fx file located in your world1 folder, this file is your world's environment effects file, if you don't have one then create one or copy one from the assets.

Insert this code into your ABC.fx file(replace ABC with your 3 letter modID):

Code: Select all

SunFlare()
{
	Angle(120.000000, -30.000000);
	Color(255, 255, 255);
	Size(5.0);
	FlareOutSize(40.0);
	NumFlareOuts(40);
	InitialFlareOutAlpha(70);
	HaloInnerRing(0.0, 255, 255, 255, 255);
	PC()
	{
		HaloMiddleRing(10.0, 255, 200, 0, 128);
	}
	HaloOutterRing(40.0, 255, 127, 0, 0);
	SpikeColor(230,230,0,128);
	SpikeSize(9.0);
}

Re: Where is the Sun!?!?

Posted: Sat Nov 24, 2007 1:23 pm
by trainmaster611
Does the Angle line define the location of the sun on the dome model?

Re: Where is the Sun!?!?

Posted: Sat Nov 24, 2007 3:44 pm
by [SBF]ATATFIGHTR
Do I need files from the assets folder?

Re: Where is the Sun!?!?

Posted: Sat Nov 24, 2007 4:59 pm
by AceMastermind
No, just the code.
If you don't have a <modID>.fx file in your world1 folder then create one, and copy and paste the code into it, then munge.

Re: Where is the Sun!?!?

Posted: Sat Nov 24, 2007 6:45 pm
by [SBF]ATATFIGHTR
It isn't working! Could it be because I copied the hoth fx file and deleted everything in it and put the sun code in it?

Re: Where is the Sun!?!?

Posted: Sat Nov 24, 2007 7:01 pm
by trainmaster611
Did you rename it to your modID name?

And you're going to want to put back that stuff you deleted.

Re: Where is the Sun!?!?

Posted: Sat Nov 24, 2007 7:08 pm
by [SBF]ATATFIGHTR
So I don't have to make another tread I will ask my other question here, How does Foliage Mode in Zeroeditor work? I read the documentation and it isn't really making any sense to me.
I just want to add grass to my map.

EDIT2: ok, I have fixed the snow problem and gotten the sun working.

How to add foliage to your map

Posted: Sat Nov 24, 2007 8:14 pm
by Taivyx
Ah, yeah. The foliage in zeroeditor........

Well, it's pretty complicated.

Let me see if I can lay down the basics for ya......


1) Copy the .prp file from any map (in the world1 folder) that has grass in it.
2) Open it up. In it, it should have one or more section(s) similar to this:

Code: Select all

Layer(0)
{
	SpreadFactor(0.2);
	Mesh()
	{
		GrassPatch("nab1_prop_grass_tall.odf", 80);
		File("editor_grasspatch.msh", 80);
		Frequency(100);
		Scale(1);
		Stiffness(0.0);
		ColorVariation(0.1);
		CollisionSound("");
	}
}


This basically defines the foliage for each foliage layer in the editor.
The GrassPatch("nab1_prop_grass_tall.odf", 80); line defines what odf to use for the grass.
You can change that to your liking. I dunno what the number next to it is for (the 80, in this example).
The other values I'm sure you can figure out on your own.

So, in the editor's Foliage tab, to the right of the screen, there are 4 layers, right?
Select the layer specified above (at the top of the code), and it will use the foliage you defined for that layer.

Well, that's it in a nutshell. Feel free to ask questions, but make sure to first check if it's answered in the Zeroeditor guide.

Re: Where is the Sun!?!?

Posted: Sat Nov 24, 2007 8:26 pm
by [SBF]ATATFIGHTR
That doesn't seem so complicated when you put it that way :wink: I will try it out :D