Switching Object Models in a MOD

For Descent, Descent II and Descent3 level editing and modification assistance.
Post Reply
User avatar
Floyd
DBB Captain
DBB Captain
Posts: 561
Joined: Sat Apr 26, 2003 2:01 am
Location: Germany
Contact:

Switching Object Models in a MOD

Post by Floyd »

is it possible to switch from one OOF to another for an existing object in a running game?
if yes, how do i do that with a mod?

help would be much appreciated, thanks.
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

In the process of a game you want to swap out one polymodel for another? Or do you want the polymodel to be changed throughout the course of the game, from start to finish?

If it's the latter, then just put a polymodel with the same name in your HOG file.
User avatar
Floyd
DBB Captain
DBB Captain
Posts: 561
Joined: Sat Apr 26, 2003 2:01 am
Location: Germany
Contact:

Re:

Post by Floyd »

DCrazy wrote:In the process of a game you want to swap out one polymodel for another?
this one. an alternative was to change he light emissions (color). it will be used to distiguish to which team it belongs.
User avatar
Floyd
DBB Captain
DBB Captain
Posts: 561
Joined: Sat Apr 26, 2003 2:01 am
Location: Germany
Contact:

Post by Floyd »

after a while of looking how to change light values, i eventually found out how to switch models too. :D

thanks anyway.
User avatar
Floyd
DBB Captain
DBB Captain
Posts: 561
Joined: Sat Apr 26, 2003 2:01 am
Location: Germany
Contact:

Post by Floyd »

ok. i can switch polymodels for objects. but i can't find out the polymodel number of an (custom) object with no currently active instance in the level.

there is an ugly workaround: to just put one instance of the object in the level outside, so that it's just there for reference, and/or destroy it after aquiring the model number.

but since the necessary object should be loaded anyway on levelstart, it must be somehow possible to determine it's polymodel number, even if it's not \"alive\".
although .id is referenced as \"polygon model number. (Index in Poly_models)\" in polymodel_external.h, i have had no luck with this:

Code: Select all

poly_model *pmodels=NULL;
pmodels=DMFCBase->GetGamePolyModels();
[...]=pmodels[i].id;
anyone?


sorry for triple posting ...
User avatar
WillyP
DBB Ace
DBB Ace
Posts: 461
Joined: Sat Feb 11, 2006 9:57 pm
Location: NH
Contact:

Post by WillyP »

I am thinking you could have, say object 'A' and object 'B' in the level at start. 'B' is ghosted at level start. Player can interact with 'A' until you want to switch, then you copy location of 'A' to clipboard, ghost 'A' then copy 'B' to the location stored in clipboard, and unghost 'B'.
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

WillyP: We're talking about using DMFC (C API), not DALLAS.

Floyd: if an instance of a polymodel isn't in a level at load time, I believe the polymodel is not loaded into memory. You could try looking at the functions that manipulate tablefiles and see if you can find otherwise. Maybe you could instantiate an object on demand, copy its polymodel to the player's ship object, then delete the temporary object. That's how the OG3 ship selection code worked.
User avatar
Floyd
DBB Captain
DBB Captain
Posts: 561
Joined: Sat Apr 26, 2003 2:01 am
Location: Germany
Contact:

Re:

Post by Floyd »

DCrazy wrote:...
You could try looking at the functions that manipulate tablefiles and see if you can find otherwise.
thanks, i'll look into that.
Maybe you could instantiate an object on demand, copy its polymodel to the player's ship object, then delete the temporary object. That's how the OG3 ship selection code worked.
i kind of do it this way currently, but i placed the objects outside of the level shell, this way i can spare the spawning and deleting.
though i can read the polymodel list, which spits out all ~850 polymodels. the only thing i wonder about is why the polymodel id is different to the polymodel number of the object, which changes the actual polymodel ...
i'll see what i can do with your first suggestion.

thanks for the input. :)

UPDATE: polymodel ids are actually object polymodel numbers :oops:.
i think it didn't work, because the polymodel name is the complete file name, but i searched the pmodels array for the object table.gam name entries...
sorry.

i will verify if that works. if anyone is interested how that works, i can post that afterwards. :)
User avatar
Floyd
DBB Captain
DBB Captain
Posts: 561
Joined: Sat Apr 26, 2003 2:01 am
Location: Germany
Contact:

Post by Floyd »

woohoo, it works! :D
turns out that my search routine was majorly flawed besides the above mentioned, which was not too obvious :oops:
but the nomenclature is inconsistent and thus misleading :/ (once it's .model_num, then it's .id)

anyway, my guess is, that D3 loads the table completely, as a list of all polymodels is in memory. and currently unused models are probably loaded on demand.

sorry for the inconvenience, and thanks for the input everyone :)
Post Reply