Jump to content
         

ized

Member
  • Content Count

    10
  • Joined

  • Last Visited

Community Reputation

7 Good

About ized

  • Rank
    Freshman
  1. The problem of C# is that methods are sealed by default, that means you can not override them. Ahh! Good point. I haven't written any C# since 1.0 so still relearning and didn't notice that. Thanks for the heads up.
  2. I wouldn't be surprised if they had no idea what kind of modding response to expect. So it makes sense they have put out a limited API for now and might be expanding it at a later date. I was a bit sadened to see how small the API was. So I did like so many others and just decompiled the game DLLs, and started digging through the source. It's been frustrating but also a fun exploration using reflection and figuring out how things are put together. Still a long process of learning, no doubt. I'd say we are stuck in our current Modding state for at least majority of the year, especially since paid mods are out the window now.
  3. For anyone interested, V10lator shared the solution. First you'll need a BulldozeTool object. Then using reflection, you'll want to get the "DeleteBuildingImpl" method. The reason we have to use reflection is because "DeleteBuildingImpl" is a private method of the BullDozeTool. Then simply invoke the method and pass it the buildings ID that corresponds to it's array key in Buildings.m_buildings. This was a first attempt at doing this. I tried invoking "DeleteBuilding" but it didn't do anything, so I skimmed the source and then tried "DeleteBuildingImpl". Waalaa! Bulldozed with animation and all. Code: bulldozeTool = GameObject.FindObjectOfType<BulldozeTool>(); method = bulldozeTool.GetType().GetMethod("DeleteBuildingImpl",BindingFlags.NonPublic | BindingFlags.Instance); method.Invoke (bulldozeTool, newobject[] { (ushort) buildingID } );
  4. I've been digging through API and writing a first mod to learn the system. Running Xamarin on a Mac and with the Assembly Browser I'm able to dig through Assembly-CSharp, ColossalFramework, ICities, UnityEngine, etc. I started with the BuildingManager and all it's objects. Got a basic mod up an running and slowly expanding what it can do. So far I've been able to: get an instance of Assembly-CSharp.BuildingManager iterate over buildings in BuildingManager.m_buildings get everything I needed from building.Info created a Unity GUI window with a scrollView. List each buildings info in textareas implement a button that onClick will give me the building ID so I can do something with it Thing is I don't know how to do anything at this point. I've seen PanelInfoWindows, Release & Destroy classes but haven't figure how to interact with them yet and what ll is available to interact with. I've looked over the code for ModTool, TrafficManager, CSLStatsPanel, TrafficReport, and a few others. Now I want to programmatically: using the ID, call a call to send the focus on the building and have it's info panel display using the ID, call a class that will bulldoze that specifiic building. I was looking over the bulldoze tool but couldn't figure out how to use it. I don't remember where but I remember seeing some animation related classes to bulldozing and some Release and Destroy methods. Any ideas? Any help is much appreciated. Thanks!
  5. Looking like the Empire State Building without the tower on top.
  6. great work.. Might be strange seeing your home popping up all over the place :-P
  7. I spent many a summer sweating my ass off on a lake living in these kinds of home.. Great work! You brought back so many memories.
  8. Just an FYI. This is a Mac specific post, but can be migrated easily to PC if you are having the same issue. Hopefully it won't last for long. Running Yosemite 10.10.3 on most recent CSL update. Since the update, I'm having intermittent errors at the Main Menu in Cities when recompiling a mod. My mod works fine, it just appears there is an occasional error and it can't reload the new dll. I'm not doing anything fancy: simple UIPanel & component creation and some Reflection on ManagerObjects similar to what ModTools does. I got tired of quitting and restarting Cities. So I created a shell script to either start or gracefully quit the app and start it again. Using Xamarin, I created a custom command to run the script during the build process, after my mod is recompiled. Script below or you can check out the gist here. After running it with the "Run on External Flag" checked, It was failing out on me on occasion. Maybe 3 out of 10 times. Turns out CSL didn't want to quit sometimes. I was also getting tired of closing the Terminal window everytime, otherwise the next Build would hang waiting for the prior terminal to close. So, I took the gloves off for the sake of getting stuff done and would just kill the app if it refused to close. Keep in mind I was using a scene with 8 buildings and zero need to save. The restart was decently quick. Note: I have a custom command that deletes the old dll and copies the new one in its place before running the script. So simple copying over (which I heard about) isn't an issue here. Really simple to run: $ /PATH/TO/SCRIPT/sh restartCities.sh restartCities.sh #!/bin/bash # Check if the CSL app is running pid=$(ps -ax | grep -m1 'Cities_Skylines/Cities.app' | grep -v grep | awk '{print $1}') if [[ $pid ]] then echo "Cities is running under pid: $pid" echo "Quitting Cities.." osascript -e 'quit app "Cities"' sleep 4 # CSL was being stubborn on occasion. Not quitting as asked. No more nice guy. pid=$(ps -ax | grep -m1 'Cities_Skylines/Cities.app' | grep -v grep | awk '{print $1}') if [[ $pid ]] then echo "Cites won't quit. Killing process #$pid.." kill $pid sleep 2 fi fi echo "Starting Cities.." open ~/Applications/Cities\ Skylines.app/
  9. Very interested in joining the team if there is still some space. Got fed up with SimCity and stumbled on CSL. Absolutely loving the game. After a couple days of learning the game play I started digging into modding. Started my mod hunt Sunday afternoon. Was so glad to see they were open to mods and didn't obfuscate the code base. Found a number of mods with source on Github to learn from but there was very little in the way of tutorials and quality Q&A. What a long 2 days of free time it's been, but making progress. Haven't written a lick of C# in a long time but it's all coming back to me now. Currently have from today: - FirstMod that lays over a button in the UI that upon click event: grabs the BuildingManager instance and allows me to get the m_buildings objects stored within. Things are still weird though. The array of 735 Building objects is strange. Mostly empty Police Stations objects with the occasional 4x2 sweatshop. Not the array of 735 buildings in my scene I was expecting. Much to learn. Planning on: - Getting an initial mod working as a learning experience on buildings that will be auto bulldozer. Have many future ideas for it. But the goal is to dig deep into the BuildingManager and learn the objects and how they interact. This is the intro that will then expand to VehicleManager, NetManager, CitizenManager, etc.. - Write a tutorial on setting up a solid dev environment using Xamarin on the Mac and linking to previous posts for the PC and Visual Studio 2013. - Tutorial on a simple new mod, using Xamarin on the Mac with all necessary assemblies. - Tutorial on exploring the assemblies (Assembly-CSharp, Unity,ColassalManaged, etc) in Xamarin and how to use code completion to improve development. - Tutorial on how to use ModTools to learn the CSL game objects - Tutorial on the auto bulldozer I made (might be multi-part) that teaches: basics of organizing a mod, a Log class for logging to a file instead of Debug window, learn how to get an instance of the main game objects (specifically BuildingManager to start with) - And on from there.. Let me know if there is space for another. As far as modeling: I couldn't model a paper bag to get myself out of but I've got a lot of experience coding. I also have a number of specific and general ideas on the game itself when it comes to game play, modding functionality & AI behavior. Be fun to get into deep convos on topics of current game behavior and future directions. What a glorious couple months since launch
×