• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

Making Models for Transit Networks: Some General Specifications

Started by Tarkus, February 22, 2008, 05:33:12 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

mtg


mtg

Ok, I still can't get it to work  :'( Maybe somebody sees something out of the ordinary in these screen shots and be able to help me out. I also still don't know where the piece should show up in game, is it a stand alone puzzle piece or part of an existing one, or something I didn't think of jet?












Jonathan

It should show up at the end of a section of MIS (the stub).
So just plop the MIS starter, and drag MIS at the end of where you dragged it should be you piece. (Only when it's straight though not when it's diagonal)

I can't see anything wrong in that, do you have a folder in your plugins which comes alphabetically fter the one your dat is in?

Maybe if you send the file to me I can see if it works on mine and then we know if it's a problem with the file or not?

mtg

It's the last folder in my plug-in folder, there is some stuff following it but that shouldn't matter does it?



I would like to attach the file in a post but, I don't know how to do that??

Korot

Mtg, it's better to be safe then sorry. However, it does load last, because the game loads files before folders.

Also, the attach file is underneath the additional options for people with the right to attach files, these are subscribers, members of a team, and the staff. If I'm not mistaking, you're neither. I guess you'll have to email it to Jonathan, or have the NAM team make you a member, or at least associate.

Regards,
Korot

mtg

Korot, thanks for the advise, since i'm way not good enough to be a member or even an associate (though I learned allot these day's) I'll PM it to Jonathan. and try to run the game without the stuff in my Plug-in folder.  :thumbsup:


mtg


mtg

No weird looking stubs, so it must be something I forgot or so



mtg

Another question, because i'm just pushing the buttons you guys tell me to push at this stage, I don't have a clue what I'm doing any more and when I get stuck ,like I am now, I can't figure out my self what I'm doing wrong. So could somebody tell me what are the  type/group and instance numbers?
What does the exemplar file do exactly, what is a recourse key type? and so on..

Korot

The TGI is used to identify an exemplar, s3d file, etc. in a .dat/.SC4Lot/.SC4Desc/.SC4Model file.
An exemplar file contains a lot of properties, what kind of properties depends on what the exemplar file is used for.
The recourse key type, or RKT, is used to refer to a model by an exemplar file.
Any more questions?

Regards,
Korot

Jonathan

I took a look at the files, tried them in game it didn't work. So changed the IID in the exemplar and the S3D and tried again and for some reason it worked in game. Why I should figure out why.

But I can tell you the MIS lane is the correct width and the model is correct/good.

Type Group and Instances (TGIs).
The proper number for these are Type ID(TID), Group ID(GID) and Instance ID(IID)

Type is what tells the reader/game what the file is. For instance all FSH files have a Type ID of 7AB50E44.
If you change the Type to something else (say 00000000) then save, close the dat and reopen it the reader will not recognize the file as FSH.

Group IDs are like subcategories of the Type. So all FSH textures that re used on S3D files for 3D networks (like El-Rail) or just as texture for a 2D network (like Road) must have a Group of 1BE787D. FSHs that are used on S3Ds for BATs have a random GID(I believe the GID is based on what date and time the model is rendering in BATSomeone please correct me if I'm wrong)

Instance ID is to identify a file. There are no set numbers, you choose what IID you want. However if you want to replace an existing file you give the file the same IID (and GID and TID) as the file you want to replace.
For example many of the maxis textures for networks were incorrect, so to fix them we have to get the IID of the texture we want to replace, make a new correct texture, put the new texture in a new dat and give it the same IID as the one we want to replace.
Note: For files that are to be used in the NAM the IID must always begin with 5(this is just to avoid conflicts), unless it is replacing a file made by maxis.

Exemplars are used for many things. The one you have been using is for linking RULs with S3Ds.
So in the RUL files we define that when a road is dragged over Rail we what the game to place a model with the IID 0x12345678 we must then create an exemplar which has the IID 0x12345678 (and the correct Type and GroupID). Inside an exemplar there are properties. The Resource Key Type 0 (RKT0) is a property. This is what links the exemplar to the S3D file. There are different type of Resource Key Types(RTK). 0 is the most common one for network uses. RKT0 has 3 values (or reps as they are called) the first is the TypeID of the S3D file you want to link to. The second is the GroupID and the thrid is the InstanceID.

Mostly the IID of the S3D will be exactly the same as the IID of the exemplar. So in the RULs we defined the piece 0x12345678 to be drawn when Road is dragged over Rail. So we give the Exemplar the IID of 0x12345678. Then because it's just easier to give the S3D the same IID as the exemplar we give the S3D an IID of 0x12345678. Now to link the Exemplar and the S3D we have to add a Resource Key Type property to the exemplar, and set it's first value to 5AD0E817 (this is the TID of all S3D files) then set the second value to 1ABE787D (this is the GID of all S3Ds used for networks) and the 3rd value is the IID of S3D (so in this case 0x12345678)

There are some formats to IIDs.
As I've mentioned all files in the NAM range must begin with 5 (unless theres a reason not to)
All the maxis network textures/S3Ds begin with 0.

Exemplar GIDs:
The GID of the exemplar depends on what network the exemplar/S3D is for.
eg All models in the RHW network (MIS, RHW-4, RHW-2, etc all part of the RHW network). Their exemplar's GID must be 6Be08658. (the GID of the exemplar is also called a NSGID which stands for Network Specific Group ID, this because each network has its own specific GID.)

When the exemplar is for a puzzle piece (the things you can TAB through in game) it's GID must be A8434037.

Texture based networks (like Road, MIS, all the flat networks) don't need exemplars, if you put one in it won't use it and will make the filesize bigger.

Also every single dat file (even files in your plugins that end in .SC4Model , .SC4Desc, etc) which has a compressed file in it (almost all files are compressed in a dat) must have a DIR file, the reader creates and edits this for you automatically so you can just ignore it (basically it stores the TGI of every compressed file and the size of each compressed file when it is uncompressed, the DIR means Directory)

That should be most of what you've been doing. Just ask if you don't understand what I've written (I don't write/explain in the best way)

(ok Korot answered your question much shorter, but It's a long post so I'll post it anyway :) )

Jonathan

Korot

This is what I don't understand:

Quote from: JonathanI took a look at the files, tried them in game it didn't work. So changed the IID in the exemplar and the S3D and tried again and for some reason it worked in game. Why I should figure out why.

You didn't explain why it worked when you changed the IID. The obvious reason is that the RUL pointed to a different file, or was the IID changed the one in the RKT?

Regards,
Korot

mtg

Thank Korot  :thumbsup:
Anymore questions you ask me!? I have tons of questions! :D But I'm trying to post just one at a time  ;)
But if I'm not mistaking these numbers always should be the same shouldn't they?



As they are that's not the problem in my brave attempt.

What i also still don't understand in how does the game know i'm modelling a stub piece?

Jonathan

QuoteYou didn't explain why it worked when you changed the IID
That is because I don't know why it worked.
I changed the IID the RTK linked to (and therefore had to change the S3D IID as well).

You are correct those number should be the same.

In the RUL file (which defines what IIDs get drawn in which circumstances) it says when there is an MIS stub draw the piece (the collective term for a S3D and Exemplar) 5de00100.

Maybe this picture explains (except this is not for the MIS Stub, but it works exactly the same)?

Jonathan

Korot

Quote from: Jonathan on February 08, 2010, 11:18:58 AM
That is because I don't know why it worked.
I changed the IID the RTK linked to (and therefore had to change the S3D IID as well).

What is the S3D IID of the 'standard' MIS stub? Perhaps you changed it to that?

Regards,
Korot

Jonathan

This is the files I have that work (note the textures for the S3D are in another DAT but this has no effect at all), which also shows the relations between the files:
That is the actual RULs for the MIS.



Jonathan

Korot

Perhaps the IID used by MTG is also used for another NAM piece, causing the override not to function properly? Or perhaps network overriding is the opposite of all other files: What ever loads first, remains loaded?

Regards,
Korot

Jonathan

btw, this is the model in game (I just lowered the the end of the ramp to check the lanes matched up)


No as with everything the file order is the same as everything else. Last remains loaded.
But I think your right, the IID 5EFFFF00 is the same IID as the end stub for RHW-6 (or-8), so that could've been it.
But the test files loaded last so it should have worked.

Jonathan

mtg

 :thumbsup:
That looks great!! Thanks all of you for the help, it gives me enough ammo to give it another shot!!
It looks though that I have to re model my ramp a bit so that the road deck fits the rest of the ramp!