Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Omniscaper on March 01, 2005, 03:32:49 pm
-
Possible spoiler for the US BSG audience......
(http://www.game-warden.com/bsg/staff_images/Colonial Mover/ColMDock.jpg)
(http://www.game-warden.com/bsg/staff_images/Colonial Mover/ColMDock2.jpg)
(http://www.game-warden.com/bsg/staff_images/Colonial Mover/ColMDock3.jpg)
(http://www.game-warden.com/bsg/staff_images/Colonial Mover/ColMDock4.jpg)
After 6 hours of tweaking and blindly messing with dock modding (which is still frustrating me), I at least got these screenshots to show off Goober's uber skillz, and the Colonial Mover, Sikotik_Psyphi's first low polygon (will also have a 5k version) contribution to the project.
Now we could use an animation code for landing gear movement. I'd rather not use "change model" in fred. Its too abrupt.
-
See Omni, that's what you get for not looking at existing examples for how to make dockpoints :p Had I known you were only using one per point I could have saved you 5 hours of work.
-
Whats with the time warp!!!! How did Strat get first post!?
I'll warn users of the 3dsmax puggin that Styx failed to mention and include a second docking point in his sample model. Thats what I get for abandoning PCS for conversions. I'm sure Kazan is laughing now.
-
Dude, you really need to upgrade that butt-ugly stock sun that appears in a lot of your shots...
-
its just there for nastalgia!
-
bob's animation code should handle landing gear. he would just need to implement a landing trigger, one might already exist but im not sure.
-
We of the BSG team wub Goober5000 and hope he will have our babies! :D
-
Hehe, hey Omni, up to putting landing struts on the vipers? :drevil:
-
I would if it were a usefull addendum.... I'll wait till Bob perfects that code.
-
WooT! Now this is why I added the feature. Great job. :)
-
BTW what ambient level are you using in those shots?
BTW2, please check your PMs.
-
Originally posted by Omniscaper
Whats with the time warp!!!! How did Strat get first post!?
I'll warn users of the 3dsmax puggin that Styx failed to mention and include a second docking point in his sample model. Thats what I get for abandoning PCS for conversions. I'm sure Kazan is laughing now.
I'm just good like that ;)
It never occured to me that the sample file had enough or not enough dockpoints, as I have always known that it takes two to make the dock act like you expect it to. I'd guess it's defaulting forward because for most of the transports that makes the most sense (so that they don't push their cargo broadside into a jump hole) but the fact that it didn't break must have been really annoying to find the cause.
-
Now there should be a way to disable the thrusters.
-
Originally posted by Overlord
Now there should be a way to disable the thrusters.
Damage-subsystem sexp would do it, I think.
Albeit I thought there was suppossed to be an 'idle' setting for thrusters, i.e. at 0 throttle you'd only see a very small, faint glow.
-
Originally posted by StratComm
It never occured to me that the sample file had enough or not enough dockpoints, as I have always known that it takes two to make the dock act like you expect it to. I'd guess it's defaulting forward because for most of the transports that makes the most sense (so that they don't push their cargo broadside into a jump hole) but the fact that it didn't break must have been really annoying to find the cause.
I think the thing is that when most of us wanted to learn how to do something like dockpoints we posted or looked in one of the tutorials.
I'm pretty surprised it worked with one dockpoint too. I would have expected a CTD or error message. I wonder what would have happened if he'd tried to dock the ships in game instead of having them start off docked.
-
I guess... maybe if the error was path related, it simply doesn't bother its arse to check?
-
So much on my mind, its tough to keep track of EVERY SINGLE PROCESS involved with modding. I got used to dishing out trek conversions which kept my focus on a singular ship, without worrying about everything else. Last time I put all my focus on a a singular release was the Galaxy class model, which was roughly 6 months ago. Very few times have I actually implemented docking points.
Perhaps next time I'll refer to the wisdom of this community and not rely solely on Styxx's plugin. So much Truespace and Pcs PAIN I've experienced during my Trek conversions which made me biased toward alternative solutions.
So let me get this straight.
The first docking point determines the docking location.
The normal for that point determines one axis of its orientation (typically "roll").
The second docking point determines heading.
The normal for that point determins.... pitch?
-
No, the line between the first and second point determines orientation (sort of).
Here's the actual code...
void set_goal_dock_orient(matrix *dom, vector *docker_p0, vector *docker_p1, vector *docker_p0_norm, matrix *docker_orient, vector *dockee_p0, vector *dockee_p1, vector *dockee_p0_norm, matrix *dockee_orient)
{
vector fvec, uvec, temp;
matrix m1, m2, m3;
// Compute the global orientation of the dockee's docking bay.
// get the rotated (local) fvec
vm_vec_rotate(&fvec, dockee_p0_norm, dockee_orient);
vm_vec_negate(&fvec);
// get the rotated (local) uvec
vm_vec_normalized_dir(&temp, dockee_p1, dockee_p0);
vm_vec_rotate(&uvec, &temp, dockee_orient);
// create a rotation matrix
vm_vector_2_matrix(&m1, &fvec, &uvec, NULL);
// get the global orientation
vm_matrix_x_matrix(&m3, dockee_orient, &m1);
// Compute the matrix given by the docker's docking bay.
// get the rotated (local) fvec
vm_vec_rotate(&fvec, docker_p0_norm, docker_orient);
// get the rotated (local) uvec
vm_vec_normalized_dir(&temp, docker_p1, docker_p0);
vm_vec_rotate(&uvec, &temp, docker_orient);
// create a rotation matrix
vm_vector_2_matrix(&m2, &fvec, &uvec, NULL);
// Pre-multiply the orientation of the source object (docker_orient) by the transpose
// of the docking bay's orientation, ie unrotate the source object's matrix.
vm_transpose_matrix(&m2);
vm_matrix_x_matrix(dom, &m3, &m2);
}
I'm not 100% sure I understand it myself, actually. ;)
-
I see,... it all makes sense now. ::takes a shot of vodka::.... GULP... YES!!! It makes perfect sense. :)
-
omni you realize when you use the 3ds plugin you _Are_ using pcs?
he used the PCS source as reference and i think borrowed code from it
PCS2 should have native read-support for 3DS max is someone gets me some decent documentation of the format and lays out terminology so i know the terminological TS equivilents of 3ds terms
-
Basically the game docks so that the 1st and second docking points are in exactly the same place as the 1st and 2nd dock point on the second model.
I've always found it best to simply think of it that way and then position the dockpoints accordingly :D
-
Originally posted by Kazan
omni you realize when you use the 3ds plugin you _Are_ using pcs?
he used the PCS source as reference and i think borrowed code from it
PCS2 should have native read-support for 3DS max is someone gets me some decent documentation of the format and lays out terminology so i know the terminological TS equivilents of 3ds terms
More kudos to you then. I just have a major problem using Truespace. Its just so alien to my comfort level with 3dsmax.
BTW, I still heavily use PCS and Modelview. Hey Kazan, any plans of having a MOI setting in PCS 2.0?
-
Well, almost. The distance between the dockpoints is arbitrary and doesn't matter at all. The way I've always understood it (as backed up by the actual code) the first dockpoint's normal determines the line which the other docked ship matches its normal to, as you're describing it Omni, yes, pitch. The second dockpoint is used to calculate a second normal which lines up the docker's rotation around the primary normal, and for fighters controls heading. That's only about 80% accurate; there is convention to how dockpoints are placed on ships, particularly fighters, so that things aren't just random when you try to dock two ships together; if you think about the docking surface as the plane in which the docker is traveling though, then the second point defines "forward," by :v: convention.
Since it doesn't crash without the second point, maybe it's defaulting to (0,0,0) and it just happened to look like it was pointing forwards on Omni's model. Because it definitely requires that second dockpoint for orientation.
-
Originally posted by karajorma
Basically the game docks so that the 1st and second docking points are in exactly the same place as the 1st and 2nd dock point on the second model.
You sure about that? If that's the case then that's a much simpler explanation. :)Originally posted by Kazan
omni you realize when you use the 3ds plugin you _Are_ using pcs?
he used the PCS source as reference and i think borrowed code from it
What gave you that idea? :wtf:
Styxx looked at the PCS source, yes, just like he looked at the ModelView and FSMM source. But he wrote the POF code from scratch based solely on the POF spec documentation.
-
Originally posted by Goober5000
You sure about that? If that's the case then that's a much simpler explanation. :)
It's an assumption. I've never really worried about orientation when I've added dockpoints on my models though. Maybe it's just a lucky coincidence with the few models I've made that the orientations were correct for that to be true.
-
I'm pretty sure you're correct. That's the way the orientation matrix is constructed... the vector from the second point to the first point determines which way it faces, and the normal of the first point determines its tilt.
So while the points may not match up precisely, the lines from point to point do. :)
-
I've always put my Dockpoints 1m apart like [V] did so that's probably why. :)
-
I've got a question about the "ai-dock" sexp in Fred. The option is greyed out for fighters.
How can I have AI wingmen dock/undock with the freighter. The screen shots were taken with the fighters INITIALLY docked with the freigter. At the moment they are "stuck" on the freighter. When I give them a command, its hillarious, they take the freghter with them!
-
Dock-undock AI commands are only possible through the use of sexps.
You could of course rig it up so such a sexp could be triggered by a keypress and put that in the objectives list window, if you wish to have it appear the player ordered it. Or they could just do so automatically.
-
Thats the problem, I can't even give the fighters the sexp... its greyed out in fred.
Is there a specific set up in the fighter's ships.tbl entry and pof settings that I'm missing? All docking points are there. i' guessing its a TBL issue.
-
That's an AI-type problem. You might have to change the flags on the freighter to a different type, or you might have to have the undock sexp apply to the freighter, so IT undocks, not the fighters.
EDIT: Timewarped again...
-
It's actually a code issue. Some ships can't dock with other ships. I'm actually thinking about removing this restriction so that any ship can dock with any other ship.
FRED should still allow this for fighters, though. Try editing the file in Notepad and see what happens.
-
The fighter with the sexp doesn't even show up in the mission. The only ship in fred that allows for ai-dock/undock sexp is the support ship.
The freigter has the ai-dock/undock greyed out as well.
Putting a "jettison-carg0" sexp on the freighter crashes the mission loud up.
The Freighter has a "capital" flag, could that be it? Is there a specific ship flag I'm suppose to use to use ai-dock/undock sexp's?
BTW I'm using the "features" build.
-
Yeah transports should be labeled "transport" in order to dock. Capitals can't dock with anything.
-
Ok, that works... sorta. I changed their flag to "freighter" The Freighter can now undock, but the sexp only undocks with last fighter of 8 docked. Unless I'm supposed put 8x sexps.
But fighters are still an issue. They cannot perform docking at all via SEXP (still greyed out). It would be silly to see that huge freighter perform 8 docking maneuvers, orientating itself to the fighters.
-
Unfortunately that's how the code is structured right now. A fighter is small enough that it should be able to dock with anything, but docking restrictions are there so that large ships can't act stupid. For undocking though, you want jetison cargo. That will dump all of the fighters without the freighter going back out along each dockpath.