Thanks aWac9. This version is for "manual placement". In the future I hope to make also a version for "automatic placement" so that bigger cities can be illuminated.
Also the fact is that the present version to work best needs some lines of code to be added to vehicles.
This is needed so that "active lights" become visible when the camera is near enough (<300m). In principle it should be also added to planes and boats but for planes/boats its less important as they usually "fly/navigate" far away enough from streetlights. The code "clamps" the in game camera (igc) used by the streetlights to the vehicle.
Unfortuntaely for characters this is not possible, so bypass the issue you need to exit (press shift+ENTER) and re-enter(press ENTER) if you feel you "walked into the dark". (this will reset the icg position to the current character position and so activate again the active lights around you).
I hope in the future to find a way to avoid this complication.
Anyway the lines of code to be added to vehicles are the following.
var $igc;
function init_vehicle()
{
$igc = this.$query_interface("ot::js::igc.get");
this.geom = this.get_geomob(0);
...
}
function update_frame(dt, engine, brake, steering, parking)
{
if (this.get_camera_mode() != 256){ // if camera associated to some vehicle
$igc.set_pos( this.geom.get_pos(), this.geom.get_rot());
}
....
}