Author Topic: A not-so-typical build  (Read 25351 times)

0 Members and 1 Guest are viewing this topic.

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Quote
Originally posted by Bobboau
@WCM:you can probly get very close by useing a diferent light color


Hmm, good idea. Although I'm pretty sick of this part of the code after spending most of the day trying to fix the projection bug...

Here's a new build. Has more new features in the selection screens than you can shake a rat's ass at. :p These include turret ccounting, automatic filling in of various ship information (I think length and maneuverability are the only things that won't be automatically filled in), colored brackets for ship selection, and the lines thingy people wanted.

The build has been updated


Relevant projection bug code:
Code: [Select]
matrix object_orient = IDENTITY_MATRIX;
angles rot_angles;
float zoom = sip->closeup_zoom * 2.5f;

rot_angles.p = -(3.14159f * 0.5f);
rot_angles.b = 0.0f;
rot_angles.h = 0.0f;
vm_angles_2_matrix(&object_orient, &rot_angles);

gr_set_clip(Wl_overhead_coords[gr_screen.res][0], Wl_overhead_coords[gr_screen.res][1], gr_screen.res == 0 ? 291 : 467, gr_screen.res == 0 ? 226 : 362);
g3_start_frame(1);
g3_set_view_matrix( &sip->closeup_pos, &vmd_identity_matrix, zoom);
model_set_detail_level(0);
if (!Cmdline_nohtl) gr_set_proj_matrix( 0.5f*(4.0f/9.0f) * 3.14159f * zoom,  gr_screen.aspect*(float)gr_screen.clip_width/(float)gr_screen.clip_height, MIN_DRAW_DISTANCE, MAX_DRAW_DISTANCE);
if (!Cmdline_nohtl) gr_set_view_matrix(&Eye_position, &Eye_matrix);

light_reset();
vector light_dir = vmd_zero_vector;
light_dir.xyz.x = -0.5;
light_dir.xyz.y = 2.0f;
light_dir.xyz.z = -2.0f;
light_add_directional(&light_dir, 0.65f, 1.0f, 1.0f, 1.0f);
// light_filter_reset();
light_rotate_all();
// lighting for techroom

model_clear_instance(WeapSelectModelNum);
model_render(WeapSelectModelNum, &object_orient, &vmd_zero_vector, MR_LOCK_DETAIL | MR_AUTOCENTER | MR_NO_FOGGING, -1, -1);

//NOW render the lines for weapons
gr_reset_clip();
vertex draw_point;
//vector subobj_pos;
int x, y;
int xc, yc;
polymodel *pm = model_get(WeapSelectModelNum);
int num_found = 2;

//Render selected primary lines
for(x = 0; x < pm->n_guns; x++)
{
if((Wss_slots[Selected_wl_slot].wep[x] == Selected_wl_class && Hot_weapon_bank < 0) || x == Hot_weapon_bank)
{
Assert(num_found < NUM_ICON_FRAMES);
gr_set_color_fast(&Icon_colors[ICON_FRAME_NORMAL + num_found]);
gr_circle(Wl_bank_coords[gr_screen.res][x][0] + 106, Wl_bank_coords[gr_screen.res][x][1] + 12, 5);
for(int y = 0; y < pm->gun_banks[x].num_slots; y++)
{
/*vm_vec_copy_scale(&subobj_pos, &pm->gun_banks[x].pnt[y], 1.0f);
subobj_pos.xyz.z += zoom;
if (pm->flags & PM_FLAG_AUTOCEN)
{
vector temp, delta;
vm_vec_copy_scale(&temp, &pm->autocenter, -1.0f);
vm_vec_unrotate(&delta, &temp, &object_orient);
vm_vec_add2(&subobj_pos, &delta);
}
g3_project_vector(&subobj_pos, &draw_point.sx, &draw_point.sy);*/
g3_rotate_vertex(&draw_point, &pm->gun_banks[x].pnt[y]);
g3_project_vertex(&draw_point);
xc = fl2i(draw_point.sx + Wl_overhead_coords[gr_screen.res][0]);
yc = fl2i(draw_point.sy +Wl_overhead_coords[gr_screen.res][1]);

gr_line(Wl_bank_coords[gr_screen.res][x][0] + 106, Wl_bank_coords[gr_screen.res][x][1] + 12, xc - 4, Wl_bank_coords[gr_screen.res][x][1] + 12);
gr_curve(xc - 5, Wl_bank_coords[gr_screen.res][x][1] + 12, 5, 1);
gr_line(xc, Wl_bank_coords[gr_screen.res][x][1] + 17, xc, yc);
gr_circle(xc, yc, 5);
}
num_found++;
}
}


Edit: Oh, and modders, here's a TXT I made while working on this, shows the various point values for armor classes (Shields and hull are added up in the totals, since that seemed closer to the :V: descriptions)
The top part has hull and (shield) values from all the Terran fighters/bombers. Capital armor classes not included.
Code: [Select]
Light 180 (380) 250 (400) 220 (330) 170 (230) 200 (200) 220 (200)
Average 265 (350) 290 (390)
Medium 275 (700) 275 (700) 200 (450) 300 (530)
Heavy 250 (600) 275 (610) 325 (500) 350 (700) 280 (580)
Very Heavy 475 (700) 550 (850) 325 (850) 325 (850)
Ultra Heavy 425 (650)

L: <= 600
A: 600-700
M: 700-900
H: 900-1100
VH: 1100-1300
UH: 1300+
« Last Edit: January 10, 2005, 11:50:27 pm by 374 »
-C

 

Offline Fury

  • The Curmudgeon
  • 213
I tried the previous build, I have to say it was finally as easy as in vanilla FS2 to drag and drop. :nod: Good stuff.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
the lines arent quite ligning up, i tried in both 640*480 and 1024*768. and they were quite off.

*edit*
but you knew that didnt you :D
« Last Edit: January 11, 2005, 11:30:35 am by 766 »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
On this thread people are talking about having 3D icons for briefings. While I'm not exactly pushing for that how hard would it be to adapt this code so that it could be used for mission briefing icons?

I'm sure I'm not the only person sick of seeing the Lucifer icon appearing to represent an demon etc.

So as not to break backwards compatability I'm thinking along the lines of having an setting in the icon image dropdown called Generate from Ship Type. If used the ship type and icon type would always match.
« Last Edit: January 11, 2005, 03:29:40 pm by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Well, I just posted there :p

Fact is, it would be extremely easy. I made a function that'll display a ship in 3D anywhere you please, all I'd have to do would be change this
Code: [Select]

rot_angles.p = -(3.14159f * 0.5f);
rot_angles.b = 0.0f;
rot_angles.h = 0.0f;


to this
Code: [Select]
rot_angles.p = 0.0f;
rot_angles.b = 0.0f;
if(sip->flags & SIF_FIGHTER || sip->flags & SIF_BOMBER)
rot_angles.p = -(3.14159f * 0.5f);
else
rot_angles.b = -(3.14159f * 0.5f);
rot_angles.h = 0.0f;


and add it into the briefing, and the icon would (theoretically) be the same as the old ones, except with 3D ships. I might have to do some tweaking since I think installations and the Knossos are usually shown head on, considering how they're defined in model files.

Any rotation at all would take the same effort, the p,b, and h variables represent rotation in radians on the x, y, and z axis respectively. I could even make them settable in a .tbl.
-C

 

Offline Flipside

  • əp!sd!l£
  • 212
Holy cow guys, you do realise that in the last few weeks you have taken more quiet steps towards that which should not be named than ever before?

Not being rude to DaveB and all the hard work [V] put in, but you really are honestly blowing them clean out of the water.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Sometimes I wonder if we should email Volition a link to the SCP site.

Or even better, the Hosted Project Collaboration forum. ;7

 

Offline phreak

  • Gun Phreak
  • Moderator
  • 211
  • -1
indeed.  someone needs to get Dave back here
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
Buildy no worky. Crash after pilot select.
Freelance Modeler | Amateur Artist

 

Offline Axem

  • 211
Yeah I had that problem too. It went away after I tried creating a new pilot.

 

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
This is hopefully going to be my second-to-last build on this...I originally wasn't going to post 'til I was fully done, but I wanted to :thepimp: it someplace else...



Enjoy. :D
-C

 

Offline redmenace

  • 211
umm, talk to Sandwich about that.
Government is the great fiction through which everybody endeavors to live at the expense of everybody else.
              -Frederic Bastiat

 
The missiles refer to the gun mounts?
My Sytem

Wer das liest ist doof!

 
Yeah, I noticed that too... odd...
$quot;Only two things are infinite, the universe and human stupidity.  And I'm not sure about the former.$quot;
 - Albert Einstein

$quot;It is foolish and wrong to mourn the men who died. Rather we should thank God that such men lived.$quot;
- Gen. George Patton Jr.

 

Offline FireCrack

  • 210
  • meh...
I havent gotten this build to run so far, it just starts up then after the splash screen CTD's with no error message whatsoever.


EDIT: Seems that this is my [problem entirely, it works but the secondary banks are messed, i've had lines shooting to places off the screen. It seems secondaries are pointing to the primary banks but when there are more secondaries they go all over the place.
« Last Edit: January 12, 2005, 06:52:11 pm by 2073 »
actualy, mabye not.
"When ink and pen in hands of men Inscribe your form, bipedal P They draw an altar on which God has slaughtered all stability, no eyes could ever soak in all the places you anoint, and yet to see you all at once we only need the point. Flirting with infinity, your geometric progeny that fit inside you oh so tight with triangles that feel so right."
3.141592653589793238462643383279502884197169399375105820974944 59230781640628620899862803482534211706...
"Your ever-constant homily says flaw is discipline, the patron saint of imperfection frees us from our sin. And if our transcendental lift shall find a final floor, then Man will know the death of God where wonder was before."

 
Well...
Unfortunately I have problems with ALL 3.6.5 builds :(
I can play the training missions, but after them, FS2 crashes...
It even crashes on most of my self-made missions!
And those missions don't use any custom modesl or SEXPs or something :(
I already tried to change some preferences...
I've tried OpenGL and Direct3D...
But it ALWAYS crashes...

Here's my system:
1333 MHz AMD Athlon Thunderbird on a
ASUS A7V-133 Mainboard
512 MB RAM (PC 133, Infineon, CL2)
GeForce 3 (Creative Labs)
Sound Blaster Live! 5.1 Player

I think I don't need to post my DVD-ROMs and HDDs... ;)

OS: Windows XP Pro with SP2

Well... I didn't know where to post it, so please move it to another forum if I'm wrong here...
Or you tell me where to post it :)

Maybe it's just a Windows Problem (wouldn't be the first time...)
Well... I'm going to reinstall the next days...

EDIT:
I forgot:
I run SCP with my german Version of Freespace 2.
mv_zpack is used...
Nothing else...
« Last Edit: January 12, 2005, 06:41:23 pm by 2173 »

 

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
The German version could be it, do a search in Gen Freespace, I remember a thread involving SCP + German Freespace 2.

You could also try using a debug build (They have _d at the end of the filename) and seeing if you get any errors from it.
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
how do you get the ship to show ant an angle like that, the build in the link worked the same way the previous one did.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Did you run it with the -ship_choice_3D flag?
-C

 

Offline FireCrack

  • 210
  • meh...
^I did, the ship always showed straight down

The icons are nice by the way

(read my edit by the way)
actualy, mabye not.
"When ink and pen in hands of men Inscribe your form, bipedal P They draw an altar on which God has slaughtered all stability, no eyes could ever soak in all the places you anoint, and yet to see you all at once we only need the point. Flirting with infinity, your geometric progeny that fit inside you oh so tight with triangles that feel so right."
3.141592653589793238462643383279502884197169399375105820974944 59230781640628620899862803482534211706...
"Your ever-constant homily says flaw is discipline, the patron saint of imperfection frees us from our sin. And if our transcendental lift shall find a final floor, then Man will know the death of God where wonder was before."