Modding, Mission Design, and Coding > FS2 Open Coding - The Source Code Project (SCP)

Has someone implemented....

<< < (2/2)

Unknown Target:
No, like having a ship actually have a moving part. For instance, in Homeworld. some ships have opening missle bays, or rotating parts, I mean like that;)

EdrickV:

--- Quote ---Originally posted by Unkown Target
No, like having a ship actually have a moving part. For instance, in Homeworld. some ships have opening missle bays, or rotating parts, I mean like that;)
--- End quote ---


Rotating parts do exist, though you don't really control them. Other moving part things probably won't be put in for a while. That'd be a complicated mess and would probably require modifications to the POF format and programs which edit it. But Kazan wants to do stuff like that, as he mentioned previously in one of the FSF threads.

penguin:

--- Quote ---Originally posted by EdrickV


I haven't looked through the whole thruster code, but I do know that in the code that loads the textures if it sees "thruster" or "invisible" in a texture name that it will not try to load the textures. They're handled somewhere else.
To map animations onto a model as textures, we'd probably have to insert our own special case code and specify a string for it to search. For example: If ani maps are named animap- have it search for "animap-" within the texture name. If so handle it with special code modified from whatever code actually draws thrusters. And incidently, explosions are also anis. But mapping an ani to a model normally does not work just yet. Unless someone's edited that feature into their own copy.
(Warp holes are another special case, the pof isn't even texture mapped.)
--- End quote ---

The code to draw the thruster textures is in the ship_do_thruster_frame() routine (Ship/Ship.cpp:3566)  There's also a ship_do_weapon_thruster_frame() routine for missle thrusters.

Any subobject with 'thruster' in the name is treated this way (see Model/ModelRead.cpp:1496)

Hacking it to permit an ANI as a texture for any poly would be a little more complicated, since it's handled at the subobject level right now.  But since the code to draw and update an animated texture is already there, some cutting and pasting and minor tweaking might get you where you need to go.

EdrickV:

--- Quote ---Originally posted by penguin

The code to draw the thruster textures is in the ship_do_thruster_frame() routine (Ship/Ship.cpp:3566)  There's also a ship_do_weapon_thruster_frame() routine for missle thrusters.

--- End quote ---


Oy. That's a lot of code to render a single thruster frame for a single object. And that has to be done multiple times for each ship/weapon who's thruster glow you can see. I had a feeling it would do it frame by frame like that. (Saw something referencing it somewhere while looking for other stuff.) That submodel thing, and how the texture is actually "applied" will also raise the complexity of doing anis as textures. It doesn't really use the texture data in the model, and from what I've seen apparently doesn't apply the thruster ani to the submodel faces. Unless I missed something. In any event, it's up to other people to code that mess at least for now 'cause I can't compile it yet.

Navigation

[0] Message Index

[*] Previous page

Go to full version