• Welcome to SC4 Devotion Forum Archives.

Creating a Single Prop from Multiple Models

Started by c.p., May 11, 2014, 04:16:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

c.p.

I don't know if this is new information or not, but after searching, I wasn't able to find it anywhere.  The purpose is to show how to create a prop exemplar that shows 2 models simultaneously, especially for slope-friendly props you want to put into prop familes.  (FrankU and vortext were asking about this in another thread).

NOTE: in order for this little trick to work, your two models must have the same GroupID (and consequently differing Instance IDs.)  Therefore it will require some advanced tweaking of either your models or gmax, and is likely to be useful only in extraordinary situations.

The following picture shows a single prop on an empty 2x2 lot.  The building and foundation are separate models.  But there is only one prop exemplar.  Note, The building casts shadows, and the foundation doesn't.


Here is the prop exemplar (as shown in ilive Reader).  It is a standard prop exemplar, except that the Resource Key Type 1 property has been replaced by Resource Key Type 4.  In this case, the Resource Key Type 4 property has 16 "reps".  (To do this yourself in ilive reader, you can copy and paste the Resource Key Type 4 property from another prop into your prop exemplar, and delete the Resource Key Type 1 property.)


The Resource Key Type 4 "reps" are organized in groups of 8, with each group of 8 representing one model.  So a Resource Key Type 4 with 16 "reps" will refer to 2 models.
The next picture shows the contents of the Resource Key Type 4 property for the above prop.  Each of the hexidecimal numbers shown is a "rep". (There wasn't enough room to show the first 2, which were both 0x00000000.) 

Note that the first "rep" of each group of 8 (i.e. the 1st and 9th reps) are both 0x00000000.  This means they are both "on", which, in this case, simply means they will both show in-game when the lot is plopped or grown.  (In the PIM-X lot editor, only the first model will show, but both will show in-game.)
The first model will cast a shadow in game.  The second one won't.  So if your prop consists of an "above-ground" model and a "below-ground" model, the 1st 8 reps should be used for the above-ground model and the 2nd 8 reps should be used for the below-ground model.  If you use the values shown in the following picture, but replacing the Group and Instance IDs, where shown, with those of your models, it should work.

(Note: where it says "Building Model", that is the shadow-casting model.  Where it says "Foundation Model" that is the model that doesn't cast a shadow).

If your prop consists of multiple models, but you want the models all to change to different models under certain circumstances, such as the abandonment of the lot, that is possible too.  In that case, you would add another 8 "reps" for each of the alternate models.  So if your prop consists of 2 models, you would add another 16 "reps" to the Resource Key Type 4 property, for a total of 32 "reps".  The first rep in the The 3rd and 4th group of reps, in this case, (i.e. the 17th and 25th reps), should be set to 0x00000001, signifying that this is a model to show in the off state.  You fill in the Group and Instance IDs with the numbers from your models, just as you did with the first 16 "reps".  Below is the exemplar for the two- model prop, modded to show abandoned building and abandoned foundation models when it abandons.  Note, the Resource Key Type 4 property now has 32 reps, and the "Active Lot State" property has been added, and set to "Occupied".  (Meaning the "on" state is shown when the lot is occupied, and when it is not occupied, the "off" state is shown.)



And here is the prop with both models abandoned:


FrankU

Hi Brian,

This is a very simple thing and a useful tutorial.
On the other hand: for making a foundation beloning to a prop, you can also make a foundation exemplar. I could even do it with SC4-Pim, so probably a lot of others can do that too.
But I guess it is also possible to add two models together into one prop, so that this combination can be used in prop families. Like a manure pit combined with a conveyor, or a horse and a horseman leading it by hand, or... a lot of other possibilities that I yet do not have thought of.

In that case it might be handy to point to this thread where I explain how models can be offset with RKT4 props. Shadow problems do appear though...

And of course you could also make timed props.

vortext

Quote from: FrankU on May 12, 2014, 02:58:12 AM
On the other hand: for making a foundation beloning to a prop, you can also make a foundation exemplar.

As far as I know a foundation can only be attached to a building exemplar though, not to a prop exemplar.

At any rate, this will come in handy as I'm working on Alex' medieval houses at the moment and they all have foundations. Looks like I'll spend an evening turning them into rkt4 props.  ::)  :thumbsup:
time flies like a bird
fruit flies like a banana

FrankU

Quote from: vortext on May 12, 2014, 04:36:45 AM
Quote from: FrankU on May 12, 2014, 02:58:12 AM
On the other hand: for making a foundation beloning to a prop, you can also make a foundation exemplar.

As far as I know a foundation can only be attached to a building exemplar though, not to a prop exemplar.

At any rate, this will come in handy as I'm working on Alex' medieval houses at the moment and they all have foundations. Looks like I'll spend an evening turning them into rkt4 props.  ::)  :thumbsup:

Oh, yes. I think you are right. I forgot. Sorry.

NCGAIO

#4

Well .. In fact the "problem of Shadows" is due solely in wanting to do something at odds with the way the game produces them and that were widely discussed in several threads on this and other forums so do not know if it should be treated exactly as a problem


Don't understand what is the difference in make a building as prop with foundation using RKT4 instead of using it really like a building with foundation and choose one family to variations in the manufacture of the lot but anyway ...


Since the inappropriate use of rkt4 already caused some problems and unexpected results to several other mods maybe read with more attention the post of Ripple jet about key parameters would be a good providence.


For those who want to have the job of modeling the object to minimize the presentation of the shadow plane in unwanted places just open the original model of transition ElRail to subway and will realize what to do though for curved planes the result may not be as effective

vortext

#5
I gave this trick a go too and ran into the same trouble as romualdillo. That is, the RKT4 prop won't show two models at once.

Funny enough, only the last model will show (verified by switching the order around). Looking at your tutorial the one thing which stands out is the difference in IDs. Ordinarily models have instance ID 0x00030000, yours don't. Moreover, your model and foundation have the same Group ID. Somehow I suspect this has something to do with it. . &Thk/(

Quote from: NCGAIO on May 22, 2014, 09:03:28 AM
Don't understand what is the difference in make a building as prop with foundation using RKT4 instead of using it really like a building with foundation and choose one family to variations in the manufacture of the lot but anyway ...

To have mutliple building props with foundation on a lot, without the hassle of having to add building and foundation as two individual props. Remember you can only have one proper building per lot.
time flies like a bird
fruit flies like a banana

romualdillo

#6
As recommended by vortext, I post my message here again.

I've repeated all the process several times, without any positive result. When only the superior model is present in the RKT4, the prop shows it without any problems. If there are two models, the prop only shows one (or the box, when the basement is exported from gMax as foundation. The brown box seems to be given by the superior model of the prop. I could see the basement through the box when placing it).  Here are the pictures showing all the TGI numbers of models, buildings and props used in the lot. I only know the basics about TGI numbers, so i can't see if there are any problems. My computer is running with Windows7, if it matters.

Invisible building model


School model


Basement model. First exported as building and second as basement (instance 0x00031000).


Prop TGI


RKT4


The lot in lot editor, showing the superior part of the prop. I don't know if it's normal this "unknown resource key" message


The lot in game


Thank you very much for your help. I'm sorry if I'm being tedious with my problems.

vortext

#7
Alright, so my hunch seems to be correct. I changed the Group ID for both model and foundation to 0x01234567, then prefixed the foundation Instance ID with ABC and . .



. . succes!  ()stsfd()

So, this is great news for romualdillo because I'd reckon he can mark an option somewhere to render model & foundation with the same Group ID, yet different Instance IDs of course.

It's bad news for me however because I'm not going to change all the material IDs manually. . Maybe Alex can take this into account in the future, given there're quite a few rendering errors in the models anyway. Otherwise I'll make shift and use individual props for model and foundation. Kinda gotten accustomed to it by now .  :D
time flies like a bird
fruit flies like a banana

c.p.

Just to confirm this, I ran the reverse test.  I re-rendered my schoolhouse and foundation with different GIDs and 0x00030000 as the IID, and had the same problem as romauldillo.

Actually, for romauldillo's particular building, why not just make standard building and foundation exemplars?  (And no invisible building.)  There is really no advantage to using this trick in this particular instance, as far as I can see.

Quote from: NCGAIO on May 22, 2014, 09:03:28 AM

Don't understand what is the difference in make a building as prop with foundation using RKT4 instead of using it really like a building with foundation and choose one family to variations in the manufacture of the lot but anyway ...

In my case, I am making all of my buildings so they show an abandoned version when the lot abandons.   This requires them to be props rather than buildings (and RKT4).  I am also making foundations for all of my buildings.  I want the buildings to be in families, and to show the matching foundation along with the building.  This trick is the only way to accomplish this, as far as I know.

romualdillo

Congratulations vortext  &apls

Well, if I have understood correctly, both models must have the same Group ID and have different Instance ID to show up in the prop. Seems legit.

vortext: Did you change Group ID and Instance ID in every file of the model, or is there any other system? I think that´s a lot of work to do it with every rendered model. I don't know if there is an option in old gMax to assign a determined Group and Instance IDs to the models, perhaps in BAT4Max, but I don't use it (for now).

c.p.: I started with the school building because it was the next on my list, I know I can make standard building and foundation exemplars. I want to use your system for my 8m-wide row houses, becase I need them as props if I want two of them in every lot... (and be independent)  :P

vortext

#10
Quote from: romualdillo on May 22, 2014, 11:58:13 AM
vortext: Did you change Group ID and Instance ID in every file of the model, or is there any other system? I think that´s a lot of work to do it with every rendered model. I don't know if there is an option in old gMax to assign a determined Group and Instance IDs to the models, perhaps in BAT4Max, but I don't use it (for now).

Yes, I changed the IIDs by hand in the Reader. However, I strongly advice you to find out if it's possible to assign Group IDs in old gMax and if not, maybe even make a switch to new software. You'd be better off in the long run to have it automated. Changing it manually is tedious and error prone work indeed. Moreover it appears to ruin the LE preview in SC4PIM.
time flies like a bird
fruit flies like a banana

eggman121

Quote from: vortext on May 22, 2014, 03:24:53 PM
Quote from: romualdillo on May 22, 2014, 11:58:13 AM
vortext: Did you change Group ID and Instance ID in every file of the model, or is there any other system? I think that´s a lot of work to do it with every rendered model. I don't know if there is an option in old gMax to assign a determined Group and Instance IDs to the models, perhaps in BAT4Max, but I don't use it (for now).

Yes, I changed the IIDs by hand in the Reader. However, I strongly advice you to find out if it's possible to assign Group IDs in old gMax and if not, maybe even switch to new software. You'd be better off in the long run to have it automated because changing it manually is tedious, error prone and appears to ruin the LE preview in SC4PIM.

You actually can change the TGI's in Gmax itself but you need to do an export beforehand for the option to become available. In the bridge modeling I am doing I have to manually assign the Group ID and the Instance ID for the bridges I am making in Gmax itself.

I would recommended you do the following:

1) Use the draft Batch export in ALN BAT4max utilities package in gmax which you can get off the LEX if you do not have it already and just draft export to speed through the process.

2) Than for all you models you can go to "File" -> "File properties" Than it will open up a tab with summary, content and custom. You want to click on custom

3) Under custom you can select Model ID and that contains you TGI's which you can change.

Hope this helps.

-eggman121

romualdillo

#12
Finally, it seems to work properly  ;D



Thank you vortext and c.p. for your help and patience!!!!

eggman121 thank you for your advice. I will download the BAT4max and investigate about it.