lowzei wrote:Let's say my unique ID of a ceiling lamp is named magic_stopper_1, how can i access the property lightColour of the LightSource component of this entity?
Without having actually done this, from reading the official
modding helpsheets, it sounds like you would have to create a custom object with the cloneObject function.
So you would add an entry in the relevant lua file (I don't have the editor installed here so can't check which)
Code: Select all
cloneObject {
name = "prision_ceiling_lamp_purple",
baseObject = "prison_ceiling_lamp",
}
Within that cloned object you would then use the following commands to change the Position, colour etc.
LightSource:
lightPosition: a 3d vector specifying the origin of the light source in entity’s local space.
lightRange: the range of the light source in meters.
lightColor: a 3d vector specifying the RGB color of the light source in range 0-1.
brightness: scales the intensity of the light source.
castShadow: a boolean which turns dynamic shadow rendering on and off.
particleSystem: (optional) name of a particle system to attach to the light source.
placement: must always be set to “floor”.
finally, when you loaded the editor your custom ceiling light asset would be listed and you would use that to add
prision_ceiling_lamp_purple_1 to your map.