Looking good!
You still need some headlights though, for otherwise if get's just a little bit more dark then you're basically driving blindly.
Now the million dollar question is: how to create a real spot light?
I managed to create sort of an 'police-sirene' like light, modeled after an example seen here somewhere(can't remember from who- long time ago and one of my first tests, maybe it was you
But that's not exactly the same as a spot light.
//Rotating rooflight(sirene).
// create armature..
Global rooflightstand
rooflightstand = CreateObjectCylinder (60,40,10) //( height, diameter, segments )
SetObjectColor (rooflightstand,155,155,155,255)
SetObjectCastShadow(rooflightstand,1)
Global roofLightBulb
roofLightBulb = CreateObjectCapsule(40.0, 80.0, 90) //( diameter, height, axis )
SetObjectColor (roofLightBulb,255,255,255,50)
SetObjectTransparency(roofLightBulb,1)
SetObjectColorEmissive(roofLightBulb,255,255,255)
MoveObjectLocalY(roofLightBulb, 50)
FixObjectToObject( roofLightBulb, rooflightstand )
// create the mechanics..
Global lightSource
lightSource = CreateObjectBox(10.0, 10.0, 10.0)
SetObjectPosition (lightSource, 0, 0,0)
SetObjectColor (lightSource,0,0,0,50)
SetObjectTransparency(lightSource,1)
SetObjectColorEmissive(lightSource,0,0,0)
FixObjectToObject( lightSource,roofLightBulb )
// bluelightObject and redLightObject are thingies the pointlights are fixed to:
Global blueLightObject
blueLightObject = CreateObjectBox (10, 10, 10)
SetObjectPosition (blueLightObject, getObjectX (lightSource)-200.0, getObjectY (lightSource), getObjectZ (lightSource))
FixObjectToObject( blueLightObject, lightSource )
SetObjectColor (blueLightObject,0,0,255,255)
SetObjectVisible (blueLightObject, 0)
SetObjectCollisionMode(blueLightObject, 0)
blucone=CreateObjectCone(200,160,32)
SetObjectRotation(blucone,90,90,0)
SetObjectColor (blucone,0,0,255,10)
SetObjectVisible (blucone, 0)
FixObjectToObject( blucone, blueLightObject )
MoveObjectLocalY(blucone,100)
SetObjectTransparency(blucone,1)
SetObjectColorEmissive(blucone,0,0,1255)
SetObjectCollisionMode(blucone, 0)
Global redLightObject
redLightObject = CreateObjectBox (10, 10, 10)
SetObjectPosition (redLightObject, getObjectX (lightSource)+200.0, getObjectY (lightSource), getObjectZ (lightSource))
FixObjectToObject( redLightObject, lightSource )
SetObjectColor (redLightObject,255,0,0,255)
SetObjectVisible (redLightObject, 0)
SetObjectCollisionMode(redLightObject, 1)
redcone=CreateObjectCone(200,160,32)
SetObjectRotation(redcone,90,-90,0)
SetObjectColor (redcone,255,0,0,10)
SetObjectVisible (redcone, 0)
FixObjectToObject( redcone, redLightObject )
MoveObjectLocalY(redcone,100) //-20)
//MoveObjectLocalZ(redcone,50)
SetObjectTransparency(redcone,1)
SetObjectColorEmissive(redcone,1255,0,0)
SetObjectCollisionMode(redcone, 0)
// Here's the lights:
Global blueLight as Integer
blueLight = 123
CreatePointLight( blueLight, getObjectWorldX (blueLightObject), getObjectWorldY (blueLightObject), getObjectWorldZ (blueLightObject), 400, 0, 0, 255 )
SetPointLightMode( blueLight, 1 )
Global redLight as Integer
redLight = 124
CreatePointLight( redLight, getObjectWorldX (redLightObject), getObjectWorldY (redLightObject), getObjectWorldZ (redLightObject), 800, 255, 0, 0 )
SetPointLightMode( redLight, 1 )
SetObjectPosition (rooflightstand, GetObjectWorldX(floor3A), GetObjectWorldY(floor3A)+50,GetObjectWorldZ(floor3A))