Author Topic: Scale func_static in script?  (Read 311 times)

0 Members and 1 Guest are viewing this topic.

0x29a

  • PD3 Beta Testers
  • Jr. Member
  • *
  • Posts: 51
  • Karma: +3/-19
  • Doom Newbie
    • View Profile
Scale func_static in script?
« on: June 29, 2016, 05:23:21 AM »
Hey!
How do I set a scale/size of func_static model I'm spawning through the script? (using lwo files)
« Last Edit: June 29, 2016, 05:50:08 AM by 0x29a »

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 851
  • Karma: +41/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Scale func_static in script?
« Reply #1 on: June 29, 2016, 07:07:07 AM »
as far as I know you can't.  I'm not sure if you can scale them in code either.

0x29a

  • PD3 Beta Testers
  • Jr. Member
  • *
  • Posts: 51
  • Karma: +3/-19
  • Doom Newbie
    • View Profile
Re: Scale func_static in script?
« Reply #2 on: June 29, 2016, 07:29:40 AM »
Dammit!
Thanks for the answer, Happy Friar, good we can count on you.
Do you have any idea how can I spawn properly scaled weapon/ammo model via script?

argoon

  • Sr. Member
  • ****
  • Posts: 267
  • Karma: +21/-80
  • Doom Newbie
    • View Profile
Re: Scale func_static in script?
« Reply #3 on: January 24, 2017, 08:38:15 PM »
I know this thread is old but if anyone comes with the same question at lest gets more info on this thread.

First You can't really scale objects in code like was said above, BUT you can scale them in the editor, with no need to bring them to a external tool, to do that, you select the static_mesh (afaik only works with meshes not BSP brushes turned into static_objects, to scale those turn them into brushes again), go to the entity tab, in the editor, select the rotation key (if not present just rotate the object and it will show, DON'T use the rotation tool, use the rotation buttons in the toolbar instead) then mess with the values, you will see something like this "100010001" positive or negative numbers is the direction the object is facing (rotation), the numbers them selfs are the object scale in x y  z (I assume), in this case it is at scale "111" or 100%, if you want to scale your object one time up just change the values to "200020002" one time down "0.5 000 0.5 000 0.5".

Some problems:

-> This kills the collision of the object, so to prevent serious bugs or crashes is better to make it non solid, if collision is needed, enclose the object on a brush and assign the collision material to that brush.

-> Objects rotated with the editor rotation tool or not cleanly exported from the 3D tool, don't have their values normalized, instead of 100010001 they have something like -0.990404 0 0.138199 0 -1 0 0.138199 0 0.990404 , this makes it more complicated to scale the model cleanly, but you can do some things to prevent or resolve that, btw this assumes you don't want to scale the object in the external tool, even if you can, (because you want to scale that particular instance of the object only) ONE you scale the object BEFORE rotating, TWO, if the case, re-export the mesh with all values freezed/zeroed from the external tool again (you should always do that anyway), THREE if you rotated the object before scaling you can "normalize" the "scale" values again (make them 1 again, don't change the others), but this also changes the object rotation slightly and i assume will still mess the collision as well, FOUR copy the three "scale" values, one by one and multiply them by the desired scale, like by 2 for example, then past them in again in the right places, this last one has the benefit of not messing with the object rotation itself.


Yes i know, not user friendly and not a option to scale large number of models, but is what we have.   

 
« Last Edit: January 24, 2017, 08:43:51 PM by argoon »

argoon

  • Sr. Member
  • ****
  • Posts: 267
  • Karma: +21/-80
  • Doom Newbie
    • View Profile
Re: Scale func_static in script?
« Reply #4 on: January 26, 2017, 06:05:24 PM »
UPDATE ON THIS!!

greebo the DarkRadiant developer from The Dark Mod implemented true scaling of ASE and LWO models in DR!  ;D

Go give him kudos!

http://forums.thedarkmod.com/topic/18586-darkradiant-220-pre-release-testing/page-2

motorsep

  • Hero Member
  • *****
  • Posts: 959
  • Karma: +74/-127
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Scale func_static in script?
« Reply #5 on: January 26, 2017, 06:23:22 PM »
Only a bit more than a year passed from the moment I was inquiring about that  ::)

You still need engine / dmap update, correct ?

argoon

  • Sr. Member
  • ****
  • Posts: 267
  • Karma: +21/-80
  • Doom Newbie
    • View Profile
Re: Scale func_static in script?
« Reply #6 on: January 27, 2017, 01:39:58 PM »
Only a bit more than a year passed from the moment I was inquiring about that  ::)

You still need engine / dmap update, correct ?

First he did this on his free time with no money compensation so be glad it happen at all.

Second have you clicked the link i posted? I assume not because if you did then you would see this.

Quote
the model is fully functional, even in lighting mode, as the normals are scaled correctly using the inverse transpose matrix. You will still need to dmap for any changes to take effect, of course.

motorsep

  • Hero Member
  • *****
  • Posts: 959
  • Karma: +74/-127
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Scale func_static in script?
« Reply #7 on: January 27, 2017, 02:55:44 PM »

First he did this on his free time with no money compensation so be glad it happen at all.

Second have you clicked the link i posted? I assume not because if you did then you would see this.

Would you shut the fuck up already?! I asked a question. If you don't intend to answer it, don't bother to reply with useless set of letters...

argoon

  • Sr. Member
  • ****
  • Posts: 267
  • Karma: +21/-80
  • Doom Newbie
    • View Profile
Re: Scale func_static in script?
« Reply #8 on: January 27, 2017, 05:14:19 PM »

First he did this on his free time with no money compensation so be glad it happen at all.

Second have you clicked the link i posted? I assume not because if you did then you would see this.

Would you shut the fuck up already?! I asked a question. If you don't intend to answer it, don't bother to reply with useless set of letters...

Go take your pills...