Author Topic: Use Ship or Weapon as CBAnim - DONE - Get the DIFF while its hot!  (Read 5049 times)

0 Members and 1 Guest are viewing this topic.

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Use Ship or Weapon as CBAnim - DONE - Get the DIFF while its hot!
Yes, another feature request :rolleyes:.  CBAnims seem rather cumbersome as it is, so I was thinking that it would be cool if you could just specify a ship or weapon (a weapon with a model) to use as a CBAnim.  It would basically be the same as the tech room or the loadout screen, where you have the model rotating.  I would try to do this myself, but I know next to nothing about graphics and something tells me that there is more to it than draw_model_rotating() ... :shaking:

So is this possible?
« Last Edit: June 16, 2008, 09:34:45 pm by blowfish »

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Feature Request: Use Ship or Weapon as CBAnim
Actually, there might not be. draw_model_rotating is a function I made to replace the techroom ship and weapon selection ANIs with rotating models. If you could check for a POF extension, then have it load the model rather than the ANI, and then check if the model variable was set and the ANI variable wasn't, you should be able to toss the function in and it'll work how you'd expect. You should probably call model_unload for each stage the model is used in (Basically every time you call model_load) once you're done with the command screen. There's probably an existing function to do that for ANIs.

The only unusual thing about the function is the rotation_buffer. That's a pointer to a float that you should define as a static variable in the function that calls draw_model_rotating. That lets the function save the position of the ship for each frame for that instance of rotation (otherwise it would just sit there, because the function has no other way of telling where it's being called from).
-C

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Feature Request: Use Ship or Weapon as CBAnim
So basically this is what I would need?:

When the stage is initialized:

-load the model
-page in the textures

For every frame of the stage:

-call draw_model_rotating (what to the four integer coords represent?)

When the stage is done:

-unload the model

----

And there is no additional graphics setup that has to be done beforehand?

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Feature Request: Use Ship or Weapon as CBAnim
Noop, it's all contained in the function (see g3_start_frame/g3_end_frame). The four integer coords represent the upper left corner of the model 'window', and the lower right corner of the model 'window'.
-C

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Feature Request: Use Ship or Weapon as CBAnim
Looks like this may actually be doable...

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Feature Request: Use Ship or Weapon as CBAnim
Is this a mod requirement, or one of those things you just thought of but never plan to use?

  

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Feature Request: Use Ship or Weapon as CBAnim
I'm not entirely sure ... I do have my own mod in the works (who doesn't :P), but I'm not sure if I would use this feature or not.  So basically it is not a mod requirement.  Why do you ask?

BTW - I am working on coding this.

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: Feature Request: Use Ship or Weapon as CBAnim
For some of us less code inclined, what benefit will it server or to phrase it better...
what are some examples of the effect this could have?
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Feature Request: Use Ship or Weapon as CBAnim
Basically, for the command brief, instead of the animation, you could specify a ship or weapon model, and it would rotate, like in the techroom.  Saves you the trouble of creating an ANI yourself (a good amount of work).

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: Feature Request: Use Ship or Weapon as CBAnim
I would probably use it in one of my mods. Would also be useful for INFA, cause we only have static anis right now.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Feature Request: Use Ship or Weapon as CBAnim
Would also reduce the workload / or increase the "polished" feel of any new mods that decided to make use of this feature.  Right?

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Feature Request: Use Ship or Weapon as CBAnim
I think SWC would use it too, as GalEmp just made us some very pretty high-detailed meshes for our secondaries, we could use them there as well.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: Feature Request: Use Ship or Weapon as CBAnim
Also we wouldn't need to keep making new .anis when high-poly models come out.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Feature Request: Use Ship or Weapon as CBAnim
If you can supply a background image/ani for the model to rotate on top of it could look pretty good in fact.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Admiral Nelson

  • Resurrecter of Campaigns
  • 211
  • The GTA expects that every man will do his duty.
Re: Feature Request: Use Ship or Weapon as CBAnim
I would certainly make use of it, too. :)
If a man consults whether he is to fight, when he has the power in his own hands, it is certain that his opinion is against fighting.

 

Offline CaptJosh

  • 210
Re: Feature Request: Use Ship or Weapon as CBAnim
I can see as how it would make the job of the other modders much easier too. No more need to either tediously make CBanims or reuse old ones.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 
Re: Feature Request: Use Ship or Weapon as CBAnim
I never knew primary weapons had models :rolleyes: .We would have to create a model for primary weapons ?
for secondary weapon it already exist (see use 3dmodel/ship selection in your launcher)

but this feature would be nice for command briefing though (but not for primary weapons).

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Feature Request: Use Ship or Weapon as CBAnim
I'm assuming he's aware primaries don't have models, and probably intended this more for secondaries or for anyone wanting to make a model for a primary, in fact you'd probably be defining the model manually and wouldn't even need it to be tied to the weapon directly, it could just be a separate model altogether.  So no need to roll your eyes :P

Also, that's what a CBAnim is.  Did you read the post?  He specifically mentions it would be like the loadout screens.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: Feature Request: Use Ship or Weapon as CBAnim
sorry I didn't mean to say this feature already exist, I just wanted to show that we could use the feature used by the loadout screen. I don't think it's very hard to call the source code used by loadout screen for command briefing.
maybe something separated from the game who would create a ani file and then use iy in your vp file. (I'm interessted I'll check the source code for this)

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Feature Request: Use Ship or Weapon as CBAnim
sorry I didn't mean to say this feature already exist, I just wanted to show that we could use the feature used by the loadout screen. I don't think it's very hard to call the source code used by loadout screen for command briefing.
maybe something separated from the game who would create a ani file and then use iy in your vp file. (I'm interessted I'll check the source code for this)

Porting the code over actually isn't that hard to do.  WMC made a function that gets the model to rotate (the draw_model_rotating thing we were talking about earlier) which handles all of the graphics stuff (the hard part).

Since there seems to be demand for this, I'll try to get it working this week.