• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Fediuld76

Major
93 Badges
Sep 13, 2017
518
484
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Dharma
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma Pre-order
  • Crusader Kings II: Holy Fury Pre-order
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars: First Colony Edition
  • Europa Universalis IV: Cradle of Civilization
  • Cities: Skylines - Green Cities
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Hearts of Iron IV: Death or Dishonor
  • Surviving Mars
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - Mass Transit
  • Cities in Motion 2
  • Hearts of Iron IV: La Resistance
  • Hearts of Iron 4: Arms Against Tyranny
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: By Blood Alone
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Europa Universalis 4: Emperor
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Imperator: Rome - Magna Graecia
  • Stellaris: Federations
  • Stellaris - Path to Destruction bundle
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Ancient Relics
  • Cities: Skylines - Campus
  • Imperator: Rome Sign Up
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Holy Fury
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: El Dorado
  • Cities: Skylines Deluxe Edition
Hi,

I am new to modding, read the help file, and some related to buildings.
However there isn't something clear of how to add properties to an existing item I am copying the template for.

For example the Shifts related property which can be found on the eg Mechanical Parts factory, if I want to added in in a item that doesn't have Shifts how do I do it?

Thank you :)
 
Ok had a snag. Didn't picked that the turbine when off accumulates machine parts, something this mod was about.
I have fixed the bug, took me a lot of time and tries trying to figure out how to do so. But is my first mod :)

http://steamcommunity.com/sharedfiles/filedetails/?id=1337771965

I can post the code and classes you might need to stop maintenance if you have something off in your mods, or adding workshifts to objects that have none.
 
So how do you add a property to an item?
 
So how do you add a property to an item?

You mean like work swifts to the wind turbine even when the object had none?

From the code file which you add the inheritance properties.
I am on holidays atm, when back at home on Thursday night I will post here the code file of the Wind Turbines mod I made to see. (if I cannot find the FB post did about this)
 
So how do you add a property to an item?
Ok.

Found my old post of how I made the mod in general lines.

Having fixed the bug, now it time to write a quick tutorial how to change a current Bullding.
In game there is a Mod Editor in the main menu. When you click it it will open a lot of windows of which one of them is the Mod Editor.
Go to it and select File -> New Mod. Add the mod title.
Double click your new mod. On the new screen add to the left the general information.
If you want to upload to Steam you need a png/jpg image of around 512x512 to attach to the Preview Image (see attachment).

Now from the top menu select New Item -> New Building Template.
Name your new building. On the Copy from select Wind Turbine.
(see screenshot).
Change your values or what ever you want.
Save.
At this stage the game will add another object exactly the same plus it's values you have altered. If you want to enhance it.

Select New Item -> New Code.
This is your class. Is preferably to give it the same name you used on the "new building" form.

When you done so. Close everything.

Open Notepad (or better Notepad++), and add the code you need.
In the case of adding workshifts to the turbine I had to make my object inherit from the WindTurbine and OutsideBuildingWithShifts objects.

DefineClass.WindTurbineWithWorkshifts = {
__parents = {
"WindTurbine",
"OutsideBuildingWithShifts"
}
}

After that code what events you need.
There is a basic ingame documentation with will open as soon as you click the Mod Editor in game. Read it and follow the tutorials etc.

The item you are interested is the one added in the code file

DefineClass.WindTurbineWithWorkshifts = {
__parents = {
"WindTurbine",
"OutsideBuildingWithShifts"
}
}

The OutsideBuildingWithShifts is the one that allows the Wind Turbines to have workshifts.

There are dozens of properties like that to be added and there is a list of them in the pages which can be found when you try to open the mod editor
 
What I'm really interested in is extending the Colonist class.