Page 1 of 1
Fish Questions [Solved]
Posted: Fri Oct 31, 2008 4:04 am
by Sky_216
OK, a few questions about fish in maps.
1) what controls where the fish are placed? I know you spawn them with the lua, but how do you determine where they go????
2) Do fish use a mesh file at all?
3) Can you use higher resolution images for fish? Because 128 x 128 is a bit small, I wanted some bigger ones (require higher resolution). Any way to do this?
Re: Fish Questions
Posted: Fri Oct 31, 2008 4:58 am
by Frisbeetarian
Using the file searcher of Zerted's, the word fish only shows up in the map scripts for 3 worlds and in each of their REQs. The commands used in each of the Lua scripts aren't defined in any other Lua script, which I would take to mean that they are hard coded.
As to where they go, they probably just go in where ever there's water. As to a msh file, it doesn't look like they use one. The way that they are included in the game so that the map script can read them is by the REQ file, and each time, the fish are referred to in the REQ as a texture.
As to your last question, I wasn't too sure what you meant. Do you mean can you use a larger texture? I would guess so, though I haven't tested it, so I don't know for sure. Or do you mean can you have larger fish? I don't know this one, though I'd guess so as well, just play around with the parameters on SetFishType (you can have more than one type, and thus different size fish).
Re: Fish Questions
Posted: Fri Oct 31, 2008 2:22 pm
by Caleb1117
1. Yes, everywhere there is water, no way to restict it so far as I know.
2. Yes, it's just a texture.
3. You could try. Making the texture bigger may increase the size of the fish, or you might just end up with a high res fish. If the image size doesn't affect the size of the fish ingame then there probably is no way to change the physical size.
Re: Fish Questions
Posted: Fri Oct 31, 2008 2:56 pm
by FragMe!
As posted in your WIP
This is truley looking good.
Oh for fishes have a look at Dagoba or Yavin both have them
They are in two places, the Req
Code: Select all
REQN
{
"texture"
"dag1_map"
"bird"
"bird2"
"leaf"
"fish"
}
and the LUA
Code: Select all
-- Fishies
SetNumFishTypes(1)
SetFishType(0,0.8,"fish")
SetMaxFlyHeight(20)
SetMaxPlayerFlyHeight (20)
I think the two numbers in the lua might be, depth below water and scale (lol fish scale) it has been a while since I played with them and turned the fish into rats.
Oh and don't forget the texture, I did and had a bunch of white squares swimming around
Re: Fish Questions
Posted: Fri Oct 31, 2008 4:58 pm
by Sky_216
Thanks for the help guys! Worked perfectly! I've only done textures with power of two (128, 256, 512) but they all support fish. Effect resolution, not size. The second value in the lua is size, no idea what the first one is.
Oh and these need some work but...

My theory on fish values in the LUA
Posted: Fri Oct 31, 2008 5:39 pm
by AceMastermind
Code: Select all
-- Fishies
SetNumFishTypes(1)
SetFishType(0,0.8,"fish")
Since I don't use fish my theory on the above lines/values is this:
Code: Select all
SetNumFishTypes([how many types]) -- 3 types max?
SetFishType([type #],[scale],"texture") -- the first type starts at 0(zero), second is 1, third is 2
Example using 3 types of fish:
Code: Select all
SetNumFishTypes(3)
SetFishType(0,0.8,"fish")
SetFishType(1,0.8,"anotherfish")
SetFishType(2,0.8,"andyetanotherfish")

Re: Fish Questions
Posted: Fri Oct 31, 2008 5:49 pm
by Sky_216
Yep ace, you're right. The first numbers must have at least 1 in between them (eg can be 0.5, 1.5, 2.5) to get all the fish to work. The second is the scale, the last is the texture.
Fish are sorta 3d. The two sides of the texture are angle into a vaguely 3d shape (the shape of the stock fish). However, there are flat bits at the bottom and top, so using these I created these:

Only in CTF mode in my map. They're sea garfish ( a real species).
Re: Fish Questions
Posted: Fri Oct 31, 2008 6:21 pm
by obiboba3po
this is really useful

bookmarking this
