News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Scale func_static in script?

Started by 0x29a, June 29, 2016, 05:23:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0x29a

Hey!
How do I set a scale/size of func_static model I'm spawning through the script? (using lwo files)

The Happy Friar

as far as I know you can't.  I'm not sure if you can scale them in code either.

0x29a

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

#3
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.   


argoon

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

Only a bit more than a year passed from the moment I was inquiring about that  ::)

You still need engine / dmap update, correct ?

argoon

Quote from: motorsep 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 ?

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.

Quotethe 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

Quote from: argoon on January 27, 2017, 01:39:58 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

Quote from: motorsep on January 27, 2017, 02:55:44 PM
Quote from: argoon on January 27, 2017, 01:39:58 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...