Prototypes creation
Posted: Fri Apr 24, 2015 10:54 pm
I have a question about creation of prototypes.
According to wiki we should use the data:extend method as preferred solution - I see small drawback in it for objects that have a lot of attributes.
Will I run into any trouble using the old assignment method with code like this:
Using this way I can easily create nice group of objects/techs(for example few tech levels of similar items).
Only thing that would need to be added separately are the object names/descriptions for locale.
According to wiki we should use the data:extend method as preferred solution - I see small drawback in it for objects that have a lot of attributes.
Will I run into any trouble using the old assignment method with code like this:
Code: Select all
towerCopy = deepCopy(data.raw["ammo-turret"]["gun-turret"])
towerCopy.max_health = 500
towerCopy.name = "gun-turret-1"
towerCopy.minable.result = "gun-turret-1"
data.raw["ammo-turret"]["gun-turret-1"] = towerCopy
Only thing that would need to be added separately are the object names/descriptions for locale.