Jump to content

8 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Can you place props (like light and benches and whatever) in the Asset Editor precisely (be it grid snapping, display of coordinates or whatever)?
For now the best I could do - is to check the coordinate values of props while placing them using Mod Tools, without being able to input them numerically.
In Mod Tools there are a bunch of interesting properties found on...
Tool Controller - PrefabInfo - BuildingInfo+Prop
But I dunno if you can make changes made there affect the result?

For now I just place Props and set colors as precisely as I can do it unprecisely (:

Best regards.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

The only way I found is to see the coordinates somewhere in mod tools in move it tool controller, but no way to input your own coordinates.
I also found the prop array/list in mod tools edit prefab info, but those only seem to be loaded and they actually don't change or save while in the asset editor. So there must be some other place where the real prop coordinates are while you are placing it.

It would be really useful to be able to set your own coordinates exactly.

For colors you can use this script: https://gist.github.com/ronyx69/0530f6ad4ee1d85bf2f1222d96a24a07

  • Thanks 1

Ronyx rhymes with electronics...  

Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Thank you for the reply and for the script, I will try using it.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    May it be possible to change "actual" coordinates with the "Instantiate" "metod"?
    I am quite a noob in the C:S scripting language (it is something like C#, I guess?), so I am having trouble even referencing "ToolsModifierControl.toolController.m_editPrefabInfo.m_props[9].m_finalProp" (that line is wrong). The thing I want to try is changing the coordinates in "ToolsModifierControl.toolController.m_editPrefabInfo.m_props.[9].m_finalProp.Instantiate(Object original, Vector3 position, Quaternion rotation);", but even the "var asset_prop = ToolsModifierControl.toolController.m_editPrefabInfo.m_props.[9].m_finalProp as PropInfo;" gives me Error (the array-list part seems the most suspicious to me).
    Maybe there is some basic tutorial somewhere (now checking info here)? Or maybe someone already checked this "Instantiate" thing and knows that trying it is futile?

    P.S. I can run the script to set the colors precisely (it helps, thanks again) somehow only from the console, and the script run as a script gives an error, maybe I need to add some "using Whatever;"? That is not a problem, of course.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    7 hours ago, heu3becteh said:

    May it be possible to change "actual" coordinates with the "Instantiate" "metod"?
    I am quite a noob in the C:S scripting language (it is something like C#, I guess?), so I am having trouble even referencing "ToolsModifierControl.toolController.m_editPrefabInfo.m_props[9].m_finalProp" (that line is wrong). The thing I want to try is changing the coordinates in "ToolsModifierControl.toolController.m_editPrefabInfo.m_props.[9].m_finalProp.Instantiate(Object original, Vector3 position, Quaternion rotation);", but even the "var asset_prop = ToolsModifierControl.toolController.m_editPrefabInfo.m_props.[9].m_finalProp as PropInfo;" gives me Error (the array-list part seems the most suspicious to me).
    Maybe there is some basic tutorial somewhere (now checking info here)? Or maybe someone already checked this "Instantiate" thing and knows that trying it is futile?

    It is C#.

    The correct line for that is: (without the period before the number)

    ToolsModifierControl.toolController.m_editPrefabInfo.m_props[9].m_finalProp

    Still it's irrelevant because of what I said, this prop array represents only what was loaded into the asset editor, it doesn't represent the temporary state where you have placed/moved/removed props, it stays the same, until you save the asset and load it again. Also finalProp just references the prop prefab used. I don't know what instantiate means though.

     

    7 hours ago, heu3becteh said:

    I can run the script to set the colors precisely (it helps, thanks again) somehow only from the console, and the script run as a script gives an error, maybe I need to add some "using Whatever;"? That is not a problem, of course.

    The console is how you run a script, I'm not sure what else you're trying to do. I only expect "using" to be in the code for mods, not scripts.

     

    I am not a developer/programmer though.

    • Thanks 1

    Ronyx rhymes with electronics...  

    Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Thank you for the reply.

    "asset_prop = ToolsModifierControl.toolController.m_editPrefabInfo.m_props[9].m_finalProp as PropInfo;" gives me "Type 'PrefabInfo' does not contain a definition for 'm_props' and no extension method 'm_props' of type 'PrefabInfo' could be found (are you missing a using directive or an assembly reference?)" though.

    The thing I want to check is whether "Instantiate" will set another coordinates for the instance that could be saved. As I understand it: there are "prefabs" - sort of templates, general properties of some prop that are used by "instances" - these props already placed in your asset with coordinates. And "Instantiate" may be the very process that gives some "prefab" "template" the place on your asset with coordinates.
    In Mod Tools "m_editPrefabInfo.m_props[].m_finalProp" have this "Instantiate" "method", but it seems you have to reference "m_props[].m_finalProp" some other way, which I have quite grim hope doing.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I believe it would be possible with "Move it!" mod.
    https://github.com/SamsamTS/CS-MoveIt/tree/master/MoveIt
    https://steamcommunity.com/sharedfiles/filedetails/?id=766190099

    This useful mod already snaps props to the grid in Asset Editor. But now it snaps to full grid cell (8 meters). If it would snap to 0.5 meter - that would be great.

    As I understand, it will work like that just by changing "MoveIt.cs" a bit.

    Now for "// Snap to editor grid" it has:

    >float x = Mathf.Round(testPosition.x / 8f) * 8f;
    float z = Mathf.Round(testPosition.z / 8f) * 8f;


    I assume it would do the magic if there would be:

    float x = Mathf.Round(testPosition.x / 0.5f) * 0.5f;
    float z = Mathf.Round(testPosition.z / 0.5f) * 0.5f;

     

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections