My latest attempt is as follows and it is ugly in console. And now the lights don't even move. I just keep trying things and now I cant even get back to having the spotlights move. They just stay fixed and stay on.
Code: Select all
******************************************************************
while(1)
{
//local.range = 10240 //dont seem to need this but I bet its hurting me
local.groundtarget.origin = trace $bomber1.origin
local.s_vec = ( local.groundtarget.origin - local.spot.origin)
local.s_ang = vector_toangles(local.s_vec)
local.s_ang[1] = (local.s_ang[1] - 180)
local.s_ang[0] = (local.s_ang[0] * -1)
local.spot.angles = local.s_ang
local.spotlight.angles = ( 0 local.s_ang[1] 0 )
local.light.origin = local.spot.origin + local.spot.forwardvector * -8
local.light show
local.flare show
local.beam show
if(level.airstrike == 0)
{
wait 2
local.beam hide
local.light hide
local.flare hide
break
}
waitframe
if(local.spot.destroyed == 1)
break
}
end
******************************************************************And here is where I gave the plane a targetname in strafe.scr and placed a variable to let me know when the bomb hits the target. Which is also when I want the spotlights to stop shining.
Code: Select all
waitthread plane_init local.set 1 level.strafenode[local.set][1].planescale
level.plane[local.set] show
level.plane[local.set].targetname = bomber1 //added this line Here is where I added the variable to let me know when the bomb drops. Which does work for the other reason I needed to. It is accessible in my main level script.
Code: Select all
movedone:
self.movedone = 0
self waitmove
self.movedone = 1
level.airstrike = 0 // added this to help my main script out
endObviously probably to you this is not how to go about achieving this goal I have. But I wanted to give it a try. If you have any tips on how I can attain my goal I would appreciate it. And I fully understand if this is not something you want to dive into.
Peace,
G3mInI
