• Welcome to SC4 Devotion Forum Archives.

Retaining walls for NAM

Started by Xyloxadoria, February 16, 2008, 12:18:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sithlrd98

Xyloxadoria, I am very happy that you were able to accomplish this. I have been attempting this for a while and had asked many for help. I would really like to know how you were able to find the location value to attach your models as I was unable to. It helps to be able to actually see the item that you are trying to T-21!

Jayson

Xyloxadoria

Well i figured out what one of the errors was but the props are still not showing up at all. The error I had was that 0x5020A702 was alredy taken. (there was another T21 i didn't see)  I increased it to the next available value, and its still not showing up at all. The 0x00 doesn't seem to be the issue because it is not showing up in any zone types at all. The piece that I'm doing it to is the road over blank terrain.

I think it might have something to do with my prop. I put it on a blank lot, then copied the Lotobject to my t21 file, and deleted the old one. After a re index lot config and a resave it still seems to be doing noting.

smoncrie

Xyloxadoria, I did a quick check and found 4 T21s for 0x5020A700 that add streetlights.  If you want to add a prop, you will need to add it to all four T21's and then add a fifth T21 with the properties set so it will only be used when there is no street light on that tile.

Jayson, the puzzle piece is: RoadxStraight Blank PuzzlePiece

sithlrd98

Quote from: smoncrie on February 01, 2009, 04:14:58 PM
Xyloxadoria, I did a quick check and found 4 T21s for 0x5020A700 that add streetlights.  If you want to add a prop, you will need to add it to all four T21's and then add a fifth T21 with the properties set so it will only be used when there is no street light on that tile.

Jayson, the puzzle piece is: RoadxStraight Blank PuzzlePiece

Problem is , I have no idea how to get it visible to actually attach the wall models ...importing as 3ds and then rendering doesn't work (for me anyway even doing what Swamper suggested to me ) , and from what I was told , no one seems to have the actual models anymore. I can figure out the rest if I had something as a reference. That was why I was wondering how he was able to get a prop placement , cause I am clueless.

Jayson

smoncrie

Jayson, to find reference points on an S3D I use the vertex data in reader.  To check if I have found the vertex I want, I often add 10 to one of the coordinates, if this makes it move, then I have found it.

It is also possible to make an S3D into a prop.   The prop exemplar must use Resource Key type 0 (not Resource Key type 1). You must also add the property: kSc4BuildingModelRotationProperty to the prop exemplar.  I don't think the value of the property maters, but it makes more sense to give it a value of 1.

sithlrd98

Quote from: smoncrie on February 01, 2009, 05:14:34 PM
Jayson, to find reference points on an S3D I use the vertex data in reader.  To check if I have found the vertex I want, I often add 10 to one of the coordinates, if this makes it move, then I have found it.
Wayyyy over my head, sorry  ()what()
Quote from: smoncrie on February 01, 2009, 05:14:34 PM
It is also possible to make an S3D into a prop.   The prop exemplar must use Resource Key type 0 (not Resource Key type 1). You must also add the property: kSc4BuildingModelRotationProperty to the prop exemplar.  I don't think the value of the property maters, but it makes more sense to give it a value of 1.

Now, I understand that...I noticed that the puzzle piece instances all had Resource Key type 0 so I thought that might be something (I also had tried Resource Key Type 3 , as I also noticed that on a few exemplars for other stuff.) 

Jayson

sithlrd98

#86
I really suck at BATting!!!!


But at least its T-21 ed  :P

And I know this looks messy but....





Jayson

Xyloxadoria

Hey you figurred it out. Thanks for all the help guys. Oh and about your BATing, its kind of hard it took me a while to get where I am now. Its probably the same for modding. Anyway if you could attach the files that you used, ill look at them and i can figure out what i did wrong (I think) Ive made compltley new models sicne thoose (they were too blue) so i can put them on now that its figured out.

sithlrd98

#88
Just in case anyone else wants to see...i've already e-mailed Zylo , but here you go.

Jayson

smoncrie

#89
Jayson,

I am afraid your solution is not correct - you can see that there always a streetlight on every tile.

I have listed the important data from the 4 current T21s:


#1:Exemplar Name                                       lights_odd_RoadxStraight_Blank_PuzzlePiece

kPropertyID_NetworkPlacementPattern             0x04,0x08,0x01,0x02

LotConFigPropertyZoneTypes                         0x01,0x02,0x03,0x04,0x05,0x06,0x08,
                                                                0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F

LotConfigPropertyWealthTypes                       0x00,0x01,0x02,0x03

kPropertyID_RotationsAllowed                         0x03

Prop Position:                                              (7.7, 2.5)



#2:Exemplar Name                                       lights_even_RoadxStraight_Blank_PuzzlePiece

kPropertyID_NetworkPlacementPattern             0x01,0x02,0x04,0x08

LotConFigPropertyZoneTypes                         0x01,0x02,0x03,0x04,0x05,0x06,0x08,
                                                                0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F

LotConfigPropertyWealthTypes                       0x00,0x01,0x02,0x03

kPropertyID_RotationsAllowed                         0x03

Prop Position:                                              (7.7, 13.6)





#3:Exemplar Name                                       lights_odd_R_RoadxStraight_Blank_PuzzlePiece

kPropertyID_NetworkPlacementPattern             0x04,0x08,0x01,0x02

LotConFigPropertyZoneTypes                         0x01,0x02,0x03,0x04,0x05,0x06,0x08,
                                                                0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F

LotConfigPropertyWealthTypes                       0x00,0x01,0x02,0x03

kPropertyID_RotationsAllowed                         0x0C

Prop Position:                                              (7.7, 13.6)




#4:Exemplar Name                                       lights_even_R_RoadxStraight_Blank_PuzzlePiece

kPropertyID_NetworkPlacementPattern             0x01,0x02,0x04,0x08

LotConFigPropertyZoneTypes                         0x01,0x02,0x03,0x04,0x05,0x06,0x08,
                                                                0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F

LotConfigPropertyWealthTypes                       0x00,0x01,0x02,0x03

kPropertyID_RotationsAllowed                         0x0C

Prop Position:                                              (7.7, 2.5)



Now in all 4 you can see they are valid for any wealth and any zone except None and Farms.

All of them are valid for only two rotations, but #1 and #2 are valid for different rotations than #3 and #4.

All of them are valid for only one out of four tiles (placement pattern), but the valid tile for #2 is offset by two tiles compared to #1.   There is the same offset between #4 and #3.

#1 and #3 are the same except for rotation and prop is on the opposite side.
#2 and #4 are the same except for rotation and prop is on the opposite side.


To sum up together these 4 T21s will place a streetlights every two tiles but each successive streetlight is on the opposite side of the road.  The reason 4 T21s are needed is that the Prop is rotated to the other side when the puzzle piece is rotated by 180 degrees.  The extra two T21s compensate for this.

Now if you want a prop on every tile, you certainly need to have the prop on every tile that has a street light, so you need to add it to the 4 current T21s.

The Prop will then only be on every other tile.  So there must be a fifth T21 with a kPropertyID_NetworkPlacementPattern of 0x0A,0x05,0x0A,0x05 (every other tile; the ones without streetlights) and a kPropertyID_RotationsAllowed of 0x0F (all rotations; you don't need to place the prop on alternate sides of the road, and so puzzle piece rotation does not matter, at least I hope it doesn't matter)

Oh yes we still don't have the prop for zones None and Farms, so we need a sixth T21 for this case.   kPropertyID_NetworkPlacementPattern sould be 0x0F,0x0F,0x0F,0x0F (all tiles) kPropertyID_RotationsAllowed should be 0x0F (all rotations) and LotConFigPropertyZoneTypes  0x00,0x07 (None and Farms)


sithlrd98

#90
I was merely trying to get the walls to appear in game and to give Xyloxadoria a basis so he could see that particular exemplar setup. I didn't change the other exemplars , except for the addition of the wall prop info. I am still learning T-21 , and the only real experience I have is doing the NAM curves. But I agree if your gonna do it , do it right :thumbsup: Thanks for the heads up on the other exemplar setups as it will make it easier to correct the thrown together .DAT !

One question, for Prop Position: are those the values you were trying to explain earlier with finding reference points on S3D vertex data in reader? I really need to learn that trick!

Jayson


Edit Alright , so after looking through NAM .dat3 again , I noticed I made a mistake with numbering of the instance 0x5020A700....and I also looked through the exemplars and noticed the 4 that were originally noted. So , I re-numbered my original mistake and added the last two that you had noted to be needed. Somewhere I have missed something because the lights are still on every tile , on one side. Please keep in mind that the only change to the existing exemplars : 0x5020A700 , 701,702,703 was the addition of the wall prop. So at this time here are the details.

0x5020A704         every other tile; the ones without streetlights
                         kPropertyID_NetworkPlacementPattern       0x0A,0x05,0x0A,0x05
                         LotConfigPropertyZoneTypes                    0x01,0x02,0x03,0x04,0x05,0x06,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F
                         LotConfigPropertyWealthTypes                 0x00,0x01,0x02,0x03
                         kPropertyID_RotationsAllowed                    0x0F
                       

0x5020A705         None and Farms
                         kPropertyID_NetworkPlacementPattern      0x0F,0x0F,0x0F,0x0F
                         LotConfigPropertyZoneTypes                   0x00,0x07
                         LotConfigPropertyWealthTypes                 0x00,0x01,0x02,0x03
                         kPropertyID_RotationsAllowed                  0x0F 


Also, every exemplar kPropertyID_LotConfigNetworkTileId  is pointing to 0x5020A700
Do you see something I missed?

Jayson

sithlrd98

#91
OK , I feel real dumb right about now.....I forgot one simple thing , power. When the pieces are plopped now , they appear to be working incorectly (like previous pic) but once a lot is placed next to it ....
*Still using jacked-up prop placement cause I still can't BAT  :) *


So at least it is working more correctly than it was , just not sure about the original plop state?

Jayson

Edit: Attached corrected (kinda) .DAT

Haljackey

It looks like things are coming along!

You've been working on this project since like forever Xyloxadoria!  Everyone can't wait to use this!  But, of course, take your time with it.  Its great to see others helping out with this project too!   :thumbsup:

All the best,
-Haljackey

choco

hey jayson......

i received a very good explanation from cogeo in a PM some time ago...i thought it may be useful to help you locate the props correctly.  :)

LotConfigPropertyLotObject

you should be familiar with this line of the T21 to some degree....

here's how cogeo explained it to me:

Quote1: Always 0x00000001 for props (0=building, 1=prop, 2=texture, 4=flora, 7=TE)
2: Level of detail (set to 0x00000000 to have the prop displayed in all cases)
3: Rotation, values 0x00000000-0x00000003
4: X-Position of the prop (centre)
5: Z-Position of the prop (set to 0 for ground-level placement)
6: Y-Position of the prop (centre)
7: X-Position of the blue rectangle's upper-left corner
8: Y-Position of the blue rectangle's upper-left corner
9: X-Position of the blue rectangle's bottom-right corner
10: Y-Position of the blue rectangle's bottom-right corner
11: Don't know, but I think it's always zero
12: Sequence. Better use LE-generated IDs here.
13: Instance ID of the prop exemplar
14+: Optional, list of additional prop IDs, the game chooses randomly which one to display when the lot is plopped/grown.

So in order to move a prop you have to edit reps 4-10. The prop's position is basically reps 4-6 (X-Z-Y). The origin of coordinates is the upper-left corner of the lot. Please note that the first four digits contain the coordinate value in whole meters, while the rest four are subdivisions, ie sth like the digits after the decimal point in decimal notation, but here in hex. So a value of, say, 3.5m would be entered as 0x00038000 (0x00008000 is half a meter), 3.25m (ie 3 and 1/4) would be 0x00034000 and so on. A value of 0x00001000 is 1/16 of a meter (that simple!). A value of 0x00080000 would move the prop to the centre of the tile (they are 16m large).

Therefore in order to have a consistent set of values, you have to set reps 4-6 to the desired prop's position, AND reps 7-10 according to the prop's dimensions. As the latter doesn't really matter so much, you can make things simpler, eg make the blue rectangle exactly 1x1m large, so it's upper-left and bottom-right corner would be 0.5m off it's centre. So if reps 4-6 were:
4: 0x00012000
5: 0x00000000
6: 0x00070000
then reps 7-10 would be:
7: 0x0000A000  (0x00012000-0x00008000)
8: 0x00068000  (0x00070000-0x00008000)
9: 0x0001A000  (0x00012000+0x00008000)
10: 0x00078000 (0x00070000+0x00008000)

I don't think it's needed to make accurate conversions from and to decimal numbers, it should be more than enough to try playing with the 4th and 5th digits only (set all others to 0), this has enough range (covering the whole tile) and gives you an accuracy of 1/16th of a meter which is very satisfactory. I mean you can move your props in steps of 1/16 of a meter (0x00001000). Also it's not necessary to make the prop 1x1m while you are testing for the best position, as calculations can be puzzling. You can instead make them 2x2, in this case the rectangle's corners would be 1m off the centre, so calculations would be easy. After you are done positioning the props you can make the rectangle 1x1 again.

hope this helps some....

-ryan

smoncrie

Jayson, I had a look at your zzz WallForNAM.dat file.  Everything is looks fine, except that you included the streetlights in the last two T21s.  They were added for the cases were you don't have streetlights, so they should not add more streetlights!  Without the extra streetlights everything looks OK.

As Choco said, the prop positions in my previous post were from the LotConfigPropertyLotObject property.


You can convert the coordinates in LotConfigPropertyLotObject using the Windows calculator in scientific mode.  To do this, put the calculator in Hex mode, paste in the hexadecimal coordinates, switch the calculator to Dec mode, and divide the number by 65536 (This is Hex 10000).  The result will be the coordinate in meters.  There is an additional step required if the value is negative (if the first hex digit is greater than 7):  In this case, before you divide by 65536, you must first subtract 4294967296 (This is Hex 100000000). E.g. 00008000 should give you 0.5 and FFF90000 should give you -7.

To go the other way, Put the calculator in Dec mode, enter the number, multiply it by 65536, and put the calculator in Hex mode.  If the number was negative, there will be a bunch of leading "F"s.   Ignore them and just use the last 8 digits.

sithlrd98

Thanks Choco...I had come across that awhile back but at the time , most of it was far more info than I needed. It helped me to understand a few things when it came to messing with lots.
smoncrie Thats what happens when you get flustered and rush I guess! :D I am slightly busy with r/l for a couple of days and plan on actually trying to get the models I have from the original project correctly done so that Xyloxadoria  can decide which direction to go. Thanks for your extra knowledge on this ! :thumbsup:

Jayson

Xyloxadoria

#96
Thanks for your help. I got it to work. The lamposts still work, i just didn't bother putting any lots in the pic for some reason


sithlrd98

Great job! If you still need a little help , I think I know what I'm doing now! :D

Jayson

Xyloxadoria

I havent been posting in here because ive been busy with other projects regading RTMT now that im on the team. This project isn't dead yet, but its on hold for now.