• Welcome to SC4 Devotion Forum Archives.

How to create Plopable items for the Mayor Menu

Started by jeronij, January 13, 2007, 05:03:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chrisadams3997

Quote from: jeronij on January 13, 2007, 05:03:10 PM
Important !!!: Make sure the Exemplar and the PNG do have the same instance ID !!!
;)

Don't know if that' the problem as I've never tried it with them being different, but it's a good start.  Everything else looks right.

Chris

DuskTrooper

arrgarfff!  So, that is what the problem was  :P

Thanks for spotting this dumb oversight; I could have wasted another couple of hours figuring that out.
I probably did not see that notice in the tutorial I found on ST.  Oh well, tally ho!

SC4, forevermore!

Filasimo

Good to see ya around pare hope ya become semi active at some point  :thumbsup:
Plaza Mall Project
http://sc4devotion.com/forums/index.php?topic=2171.0
Coming Soon to the LEX!

NAM Team
What can NAM do for you?
//

Heblem


flame1396

Well cycledogg made god mode tree mods but I dont believe adding single tree plop functionality is possible with god mode
The most astounding and unique aspect of the human race is our fervent application of our ingenuity to kill each other, thus completely defying the near-universally proven fact that the ultimate goal of a member of a species is to ensure the survival of the species.

Chrisadams3997

#45
There are others that know a lot more about this than me(c.p. would be a good source ;)), but I can start to answer your question.  It's not quite as simple as doing mayor mode ploppables.  There are two properties that control how a tree acts in the god mode flora brush.  (note: this is all from my personal experience with modifying tree controllers, and might not be absolutely accurate, just how I've interpretted what I've seen)



First off the flora wild property has to be set to true.  The special case only property may have a role here too, but I haven't tested it.

The first one in green I don't personally understand very well, but it plays a role in how the game places the different models in a given cluster group and the spacing between the models.  My advice is to look at how Maxis and C.P. have used these values, or use an existing mod and insert your models into it with the res key 1 property, making sure to change IID's and the appropriate properties as outlined in Jeronij's tutorial.

The second controls what trees show up in different areas on a map.  If you look at the image above, it has 256 reps, yep that's right 256.  If you look at the flora tuning parameters exemplar, there's a property assigning an elevation range(this is from one of C.P.'s tree controllers, normal is 800 if I recall right)


Basically the Flora Parameters Property divides this into 16 equal elevation areas, in this case, every 60 meters, and within each elevation range there are 16 'climate' areas(my naming), and each value in this array detiremines what trees show up in a specified climate zone in a specified elevation range.  Here's how I normally look at it(just copied to notepad, and broke it up into sets of 16, so each row represents an elevation range)

(this is the dSC4FloraPreferencesProperty values for the Maxis Oak clumps, note it looks drastically different from c.p.'s setups for this property)


As a general rule as I've noticed it, those farthest to the left are the wettest areas(river bottoms, north slopes-yep the maxis weather simulation takes prevailing winds and elevation changes into account in it's moisture simulation) and the right ones are progressively drier(south slopes), though there could be exceptions to this.  Coincidentally, these same climate areas are used for textures.  If you have any c.p. terrain mods, you can actually see the different climate areas and you will notice using his tree mods that the trees change with the textures ;))

I can't really cover everything I've found(and the more I haven't figured out for that matter) but I'll try to cover a few more basics.

Only one 'cluster' type seems to show up in any 'slot' in the array, which indicates that there is a system that detiremines a 'dominant' tree type for that elevation and climate.  If you look back up at the flora preferences property above, any value from 0 to 1 is valid.  If one tree type had a .6 for one spot in the array, and one had a 1, the one with 1 should appear there.  Where two have the same highest value however, I haven't done enough testing to detiremine how it detiremines the correct one to place, though my guess is it looks to either the left or right in the array till one wins, but that hasn't been tested by me.

Ultimately, this means you don't only have to manage your new flora in terms of this property but have to look at it globally in terms of all trees in your plugin folder with this property.  from a simplistic standpoint, you could set the values for your flora you want to use all to 1's across the board(after taking care of the FloraParameters Property as I outlined above, very important, or you could get some very odd results) such that it will place yours at all elevations and climates.  Then if you wanted to place other flora in some areas, you'd switch it out for another tree controller in your plugins--just make sure the 'pause' button is on in this case as any trees not presently supposed to be there according to the current tree controller will be thinned out at the begining of any new months while in god mode.

Another approach I've taken is to copy the floraprefences property of a flora type in your present tree controller occupying the areas you want your flora to show up in, paste it into your flora, then set the original flora's preferences property all to 0, effectively replacing it with your new flora.

Outside of that, adding it in requires a lot of knowledge and micromanagement of the FloraPreferences Properies.  Hope this helps(and doesn't discourage you) and maybe someone else can shed some more light on the subject to fill in my gaps :D.

Chris

dedgren

#46
We miss you, Chris...

* * *

I have probably memorized every post in this thread by now.  Being able to plop props is such an incredibly powerful tool- it's not something that is a silver bullet, but used wisely one could sufficiently randomize the inevitable regularity that a lot-based game (without regard as to whether that lot is growable or ploppable) imprisons us within.  RL is the ultimate randomization factor.  We can use ploppable props wisely to break out of our lot-based shackles, and it is worth knowing everything we can about this powerful tool.

* * *

I think about this game a lot.  I spend some days just thinking about it (probably when folks would rather have me posting).  Probably the one thing I wish for the most right now is to know whether it is possible to do ploppable seasonal props.  Probably everyone knows why- ploppable seasonal trees would be the 3RR holy grail.  I feel like I sound selfish...

* * *

I've now spent the best part of several days trying to get a four-exemplar seasonal tree ploppable to work.  It doesn't.  Jeronij indicated that this might be possible in his first posts here.  Does anyone have any "Crazy Eddie" [linkie] input here?  Is this possible?  My sense is that the game draws the first plop and then doesn't return to it to refresh with future seasonal iterations.  Has anyone found anything any different?

If you've figured this one out- you are literally guaranteed a seat in 3RR Valhalla.  I'll personally nominate you.


David
D. Edgren

Please call me David...

Three Rivers Region- A collaborative development of the SC4 community
The 3RR Quick Finder [linkie]


I aten't dead.  —  R.I.P. Granny Weatherwax

Skype: davidredgren

jeronij

I cant find all the info atm, but I was able to recover this explanation about this:

Quote from: Jeroni on March 13, 2007, 03:41:18 AM
Hello again,

I dont remember well the RKT4, its been a long time since I worked with them, but the models were changed by some values in a Flora Property.

QuoteQuote from Brian/aka Cycledogg:
Actually, you can control how often the trees change.  Just not very accurately, because of what I already mentioned.  The interval is controlled by the kSC4FloraParametersProperty.  The 6th and/or 7th rep of the kSC4FloraParametersProperty controls the overall interval (in days).  So if you set those to 36500 for example, the total cycle will last 100 years.  The first rep controls the total length of the first two segments of the cycle (and this is apparently split in half to get the length of each of the two individual segments).  So, if you use 7300 for the first rep, each of the first two segments of the cycle will be ten years.


And this works !!!. I have a model somewhere in my HD, whixh is a seasonal plopable tree ;)

This explanation is based on the growable Maxis flora exemplars ( which are plopable) and the use of RKT4 type props. You can contact me if you want so I can give you a hand with that. It would be great to help give 3RR its Holly Grial  ;) ¡¡¡
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


jeronij

Still some more info:

Quote from: c.p.
These trees look great. :D
The problem with seasonal mayor mode (or god-mode) trees is they are flora, not props, so the Simulator Date Interval, etc doesn't apply.  I tried making seasonal god-mode trees a while back, but I eventually gave it up because I could only get them to change "seasons" at random times of the year.
One thing preventing true "seasons" is it seems that the first of every month, the game checks 1/24 of the flora in the city for changes that may need to be made, so that it takes 24 months for all the trees to be checked and changes made (growing trees for example).  This 24 month period can be reduced to one month (I forget the exemplar where you can do this), but the resulting game lag is horrible.  But maybe there is a way around these things?
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


dedgren

#49
I've been watching with interest jeroni's posts here and a corresponding discussion over at the BSC site- these raise a question: has anyone ever done a central catalog of the "game" environment exemplar properties, such as the one C.P. refers to that controls the flora update interval?  I am familiar with the brief descriptions that are available in the Reader, but these are frequently cryptic to the point of uselessness.  That would seem like really worthwhile knowledge to have at hand.

EDIT:  Here are several properties that sound similar to the one that jeronij's post notes:

Prop Random Chance                 0x4A751AD5      Uint8      Random chance (0-100) of this prop appearing according to time of day and simulator date

Simulator Date Duration            0x4A764564      Uint32     How long in simulator days this prop will stay active once triggered


Note that these refer to props.

Here's an interesting sounding one.

mnMonthsBetweenCellCoverage        0x8761ABD0      Uint32     mnMonthsBetweenCellCoverage


Here, just for the record, are the seasonal prop start and end date properties.

Simulator Date Start               0xCA7515CC      Uint8      Simulator MONTH (1-12) and DAY (1-31) to start this prop's date interval

Simulator Date Duration            0x4A764564      Uint32     How long in simulator days the prop will stay active once triggered

Simulator Date Interval            0x0A751675      Uint32     How often this prop becomes active, in days.



EDIT2:  So it appears finding this exemplar (and perhaps the property buried inside it)


QuoteThis 24 month period can be reduced to one month (I forget the exemplar where you can do this), but the resulting game lag is horrible.  But maybe there is a way around these things?

is critical.  I just spent the better part of the past two hours going through the list, and it wasn't apparent to me.



David
D. Edgren

Please call me David...

Three Rivers Region- A collaborative development of the SC4 community
The 3RR Quick Finder [linkie]


I aten't dead.  —  R.I.P. Granny Weatherwax

Skype: davidredgren

jeronij

#50
Hello again,

After some thinking and much testing, I dont have very good news about this  ::)

I see two ways to get "seasonal" Mayor Mode plopable items, but they are not seasonal the same way that props in a lot are. Props on a lot change depending different simulators dates and parameters which are set in every prop. Plobable items do not allow this sort of configuration. These items ( which are flora regardless of what they look like) allow a certain models change, but it is very limited. They can change up to 3 times, and the change occurs after XXX days, counting from the placement date. So if you place one item on January, and you place the same item again in June, the second will always change six months later than the first.

The two (unsatisfactory) ways that I see to get some sort of seasonal plops:

Use Maxis's RKT5 technique, which allows tree models, but once the cycle is completed, the plop item "dies". I discard this option atm.

Use RKT4 instead the standard RKT1. This allows up to two models, I havent been able to make more models work  :bomb: , but it seems to be logical, since the RTKT4 allows two states for a model in any other circumstances ::) . I have also not been able to control the growth rate the way I want, and I dont have more time to test this atm, so I have attached to this post a working seasonal plop, which places a model which changes up to two times always.

Feel free to use this mod as the basis for your own experimentation. As mentioned in some posts above, you can tweak the 6th and 7th FloraProperties values to change the growth rate, but when I tried to make the rate=1 year, it did fail, and the model didnt change  $%Grinno$%

The mod works on my Trees Prop Pack Vol03 (Seasonal trees)  ;)
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


dedgren

Thanks, jeronij~  I'll be experimenting with your test lot today.


David
D. Edgren

Please call me David...

Three Rivers Region- A collaborative development of the SC4 community
The 3RR Quick Finder [linkie]


I aten't dead.  —  R.I.P. Granny Weatherwax

Skype: davidredgren

SimFox

I guess I'm very thick, but could someone give me some explanations regarding this tutorial, particularly some terminology used here.
I'm getting confused right from the start. The very first instruction tells to open "existing mod file". Exactly what is that "mode file" and where one has to get it? What if it is freshly made model? Should it be a prop prior to these manipulations? Something else?
Instance ID's. Where does one get those? Should One just make them up? What are the problems if someone will accidentally create the same exact IDs?
LTEXT, where does this come from? I don't have it in my own made BATs/Models... I assume one can skip it as long as only one language is involved, am I correct in that assumption?
Another thing, I see exemplar type to be Flora. Where does that come from? In Plug-in Manager I can't find that type of object to be created... Apart from Civic and RCI buildings I only see Foundations and Props.
Sorry if that is common knowledge and I'm really thick about it... It's not intentional....

Andreas

Modding very often means to open an existing file in the Reader, either an in-game one like SimCity_1.dat or another mod of the same type - the latter one is obviously easier, since you only have the exemplar files, LTEXT files etc. that you really need. So the best way to start your own mod is downloading an existing one, examining it closely, and then start to modify it - it's called "modding" for a reason. ;)

As for the instance IDs, there's an index for textures and one for prop families, but as far as I can see, there isn't one for Mayor Mode items. But I'd say it would be appropriate to use the same ID range that you can aquire from the prop family index, this should be "random" enough that there aren't any ID conflicts coming up. Make sure to write down all IDs you're using, this could be helpful if someone reports a problem later.

For creating a new LTEXT file, simply copy an existing one, change the IDs and then the contents of the file. You can do the same for a flora exemplar file and virtually any other file. You don't need the Plugin Manager for creating a prop exemplar file, for instance, but you can copy an existing one, determine the ID of your model, and edit the exemplar file accordingly.

Since the Plugin Manager doesn't allow to create anything else but building, prop and foundation exemplar files, you have to copy an existing file and edit it afterwards. You could even create a lot manually (without the Lot Editor) if you'd knew all LotConfig properties from memory, but that would be very tedious, obviously. ;)
Andreas

SimFox

So, if I want to create a Flora tree I have to export model, Make it into a prop, then open Desc File and change there examplar to Flora. Right?

Andreas

You don't really have to make a prop exemplar file (with the Plugin Manager) in the first place if you don't want to use the model as a prop, but it might be easier to do so for copying the necessary values (such as the Resource Key ID). The flora exemplar file looks different, so you should copy an existing one and then edit the IDs and properties.
Andreas

Girafe

excellent tutorial  thanks to all and jero

I have try and i obtain this  :) :



Can I translate this tutorial in french for TSC  ??
The Floraler

This is the end, hold your breath and count to ten, feel the earth move, and then...

*   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *    *   *   *   *   *    * 

jeronij

Quote from: Girafe on July 19, 2009, 06:41:11 AM
excellent tutorial  thanks to all and jero

Can I translate this tutorial in french for TSC  ??

I please you to do so  ;)

I am glad you got it to work  :thumbsup:
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


bap

As I have not previously seen a mention to this and as I believe this is a proper place for it, I shall remark that the thirteen rep of the kSC4FloraParametersProperty entry controls the minimum distance (in meters) allowed between the current plopable item and the other ones. For example, in the picture shown in ChrisAdams3997 reply a few messages above this, the number is set to 2m. This means it would not be possible to plop another Mayormenu flora (be it a tree, a boat or a plopable water piece) closer than 2 m from that particular Aspen 1 flora.

Therefore, if one creates a given Mayormenu flora and wishes to have it plopped very close together in a row, one suggestion would be to edit that thirteen rep to a number equal to or smaller than the width of the given flora. By selecting a number smaller than the actual width of the flora, one is entitled to nice blending and superposition of different flora exemplar, p.ex. different water brushes, or being able to put close together different types of plopable grass and trees.

Sorry if this has already been posted somewhere else and just escaped my attention.

Bap

Chrisadams3997

#59
I always considered writing a tutorial on the FloraParametersProperty, but never got around to it, but since you bring up rep 13, I thought I'd mention that rep 11 is a related property that works similarly.  The difference is that while rep 13 sets an area* around a given placed flora within which the center of another flora item cannot be placed, rep 11 defines a similar square area that is checked before a flora is placed--or, in the case of clusters, the given flora model progresses to the next in the cluster.  If the center of another flora model exists in the area defined by Rep 11, then the model cannot be placed and/or the cluster won't upgrade.

The implications of this difference are too great to discus without writing something much more thorough, as it opens a lot of possibilities, but I'll touch on it.  Lets take two extreme scenarios:

A) Actual Model Size = 5m
    Rep 11 = 5m
    Rep 13 = .2m

Here, the rep 11 is scaled to fit the exact size of the model (5m would be about the size of a small to medium tree or bush).  This means that given that other flora are already placed in the area we are trying to place our tree, it requires an area at least as large as the model itself in which both:
   1.) The center of no other flora model (or prop) falls into the 10mx10m area covered by the Rep 11
   2.) The spot we are trying to place the model does not fall into any other flora models Rep 13 area (or a prop's Occupancy Size, which also                      occludes flora placement)

Now, if we placed a number of these in an open area (no other flora, etc. in it to begin with), these will typically end up approximately 5 meters from each other (slightly more if at diagonal due to the square region, see '*' at bottom).  This is because The Rep 11 precludes them from placing any closer in this case.  But if I come back with a different type of flora with a smaller value in Both Reps than 5m, There is plenty of room left in between the original placed flora for the new, smaller flora to fit into.  Think pouring sand into a jar of rocks, it fits into the cracks.

B.) Actual Model Size = 5m
     Rep 11 = .2m
     Rep 13 = 5m

Imagine this is the same model as before, we've just flip-floped the Rep 11 and 13 values.  We'll start again looking at where it could be placed where other flora already exists.  The two conditions needed to place the flora are:
   1.) The center of no other flora model (or prop) falls into the 0.4m x 0.4m area covered by the Rep 11
   2.) The spot we are trying to place the model does not fall into any other flora models Rep 13 area (or a prop's Occupancy Size, which also                      occludes flora placement)

So immediately you see that it requires much less space in between other flora or props to initially be placed.  However, placing them in an open section like in the above example, again you'll find that they place 5 meters apart, just like before.  This is because the Rep 13 is now the larger is therefore is the first of the two properties to exclude additional models from being placed any closer than 5 meters.  Given only one model is being placed into a space, the larger of the Rep 11 or 13 for that model will always define the average spacing of models, the difference between using one or the other as the larger value(if they are not kept equal) is only seen when interacting with other models within or without the model in questions cluster.

To make a good example, we again look at what happens when we try to place a different, smaller flora model (example: Rep 11 & 13 both equal 1m) in between the originally placed models.  Despite the fact that they are still 5 meters apart from each other as in Scenario A, now each of those placed flora broadcasts a 10x10m Rep 13 around itself into which nothing else can be placed.



To Wrap it up, I'd say that in most cases, you don't necessarily need to specialize a flora one way or the other, it's sufficient to remember that when increasing or decreasing Rep 13, Rep 11 needs to be changed as well.  If there is reason however, it is possible to create varying degrees of the two situations I described (in extremity albeit) above, as well as have further interaction with differing max cluster sizes for clustered flora, the possibilities are quite large if the time is taken to think it though.

Hope that wasn't too confusing ;)
Chris



*The area defined by Reps 11 and/or 13 is not a circular diameter, but rather a square whose sides are located the length of the rep 13 value from the center of the placed flora, e.i. rep 13 = 2m, then it's a 4x4 square around the placed flora.  The primary implication of this is that the distance a Rep 11 or 13 area covers from the center of the flora it surrounds is somewhat greater at a diagonal angle than in a straight line, by up to 1.41  times the distance at 45 degrees (which is the square root of 2, derived from the pythagorean theorem).