Weird MODELDEF behavior with OBJ (or probably FrameIndex)

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Weird MODELDEF behavior with OBJ (or probably FrameIndex)

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

by Marisa the Magician » Fri Aug 09, 2019 1:28 pm

Yeah, this is user (or modder, more like) error.

The fact that it works despite being incorrect, however... that's another story.

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

by Major Cooke » Fri Aug 09, 2019 8:24 am

He was referring to setting it wrong in Spooktober's MODELDEF file. Talon1024 is the one you want if something with OBJs is broken. He's the one I had to contact when I discovered that the triangle loader was backwards and he fixed it.

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

by Graf Zahl » Fri Aug 09, 2019 1:38 am

Marisa Kirisame wrote:Ah, that was a typo from my part it seems. I was meant to set the model indices to 0 and 1 but instead I set the frames. (I'm surprised it worked anyway)
So what about a fix?

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

by boris » Wed Jun 12, 2019 1:29 pm

Marisa Kirisame wrote:(I'm surprised it worked anyway)
Exactly! It just accepts anything you throw at it, it's not even printing out an warning.

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

by Marisa the Magician » Wed Jun 12, 2019 3:08 am

Ah, that was a typo from my part it seems. I was meant to set the model indices to 0 and 1 but instead I set the frames. (I'm surprised it worked anyway)

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

by boris » Tue Jun 11, 2019 8:52 am

Well,

Code: Select all

Model SchoolTable
{
   Model 0 "models/table1.obj"
   Model 1 "models/table2.obj"
   Skin 0 "FLOWTEX9"
   Skin 1 "FLOWTEXA"
   Scale 0.5 0.5 0.6
   FrameIndex STIM A 0 -1
   FrameIndex STIM A 1 0
}
still renders both models for me.

Re: Weird MODELDEF behavior with OBJ (or probably FrameIndex

by Cherno » Mon Jun 10, 2019 10:55 am

The wiki entry for MODELDEF sems to be incorrect regarding the option to "turn off" a model for certain actor frames if the model's frame is -1. I noticed that before and it makes things like guns that should only show a muzzleflash sub-model for one frame a hassle because you have to have two MODELDEF entries for that (one with all frames without the muzzleflash, one for the single frame with the muzzleflash).

[MD3] Using "-1" for model frame numbers to hide them

Weird MODELDEF behavior with OBJ (or probably FrameIndex)

by boris » Mon Jun 10, 2019 3:50 am

So I'm in the process of adding OBJ support to GZDB-BF, and I noticed that OBJ models are handled in an weird (and as I understand incorrect way).

As a test case I used Spooktober, which has a table made ob OBJ models. The table is made from two OBJs, one for the legs, one for the top of the table. The MODELDEF looks like this:

Code: Select all

Model "SchoolTable"
{
	Path "models/flow"
	Model 0 "table1.obj"
	Model 1 "table2.obj"
	Skin 0 "FLOWTEX9"
	Skin 1 "FLOWTEXA"
	Scale 0.5 0.5 0.6
	FrameIndex TABL A 0 0
	FrameIndex TABL A 0 1
}
So, according to the FrameIndex lines it uses Frame 0 and 1 of model 0, which doesn't make sense. However, it works fine in-game. I played around a bit with FrameIndex, and it looks like it's completely irrelevant what you set as model and frame, it always displays all specified models. Even if try to use different models for different frames it will always display all models.

I made a bare-bones example (see attachment) that displays the whole table, even though the FrameIndex line doesn't make sense whatsoever:

Code: Select all

Model SchoolTable
{
	Model 0 "models/table1.obj"
	Model 1 "models/table2.obj"
	Skin 0 "FLOWTEX9"
	Skin 1 "FLOWTEXA"
	Scale 0.5 0.5 0.6
	FrameIndex STIM A 3 -894898
	//FrameIndex STIM A 0 12
}
So model 0 and 1 are defined, FrameIndex says to display frame -894898 of model 3... and it displays model 0 and 1 in-game.
Attachments
wonky.zip
(10.33 KiB) Downloaded 44 times

Top