Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: StargateSpankyHam on March 11, 2010, 11:07:57 am
-
The last time I installed the SCP mod, I had a secondary reticule behind my primary one, useful for seeing where the nose of the ship was pointed when flying from the chase view. However, after a system crash and a reinstall of everything, that second reticule is now gone. I seem to be unable to locate the option to reactivate it.
Does someone know how to do this?
-
It was most likely the Velocity Indicator (http://www.hard-light.net/wiki/index.php/Script_-_Velocity_Indicator (http://www.hard-light.net/wiki/index.php/Script_-_Velocity_Indicator)).
Follow the instructions on the page and you'll have it back :)
The new Version of Blue Planet has it in also i think...
-
Yes, it does, as part of the optional glide package.
-
i saw that show up somewhere, i think while testing my particle build. is this thing in the media vps?
also i hope it doesnt clash with other scripts, hope it makes good use of local variables and sufficiently complexly named globals (such as putting a mod prefix in front of them bp_ or nuke_ for example).
my usual practice is to declare global in an init function and set them to nil in an uninit function, then dont put globals anywhere else. if your script uses bitmaps, be sure to free them in the uninit function.
-
Whoa...lots of code... :nervous:
Also, there were no instructions on the page. I have no clue how to go about doing this, as I have no experience whatsoever with scripting.
Anybody have step-by-step instructions?
-
Just copy this text:
#Conditional Hooks
$Application: FS2_Open
$State: GS_STATE_GAME_PLAY
$On Frame:
[
drawvelret = function(x, y)
gr.drawGradientLine(x+10,y+10,x+2,y+2)
gr.drawGradientLine(x-10,y+10,x-5,y+2)
gr.drawGradientLine(x+10,y-10,x+2,y-2)
gr.drawGradientLine(x-10,y-10,x-2,y-2)
end
-- get mission time
if missiontime == nil then
missiontime = mn.getMissionTime()
oldmissiontime = missiontime
end
-- if the time is valid
if missiontime ~= nil then
-- if we are actually doing something
missiontime = mn.getMissionTime()
-- only continue if the time actually progresses
if oldmissiontime ~= missiontime then
plr = hv.Player
-- only continue if we can get valid player handle
if plr:isValid() then
local velocity = plr.Physics.Velocity
local vlenght = velocity:getMagnitude()
-- if we actually some velocity...
local vvector = plr.Position + (velocity/(vlenght/2000))
if vlenght > 5 then
local x
local y
x, y = vvector:getScreenCoords()
-- ok... so now we have the projected velocity vector
-- if it actually is on screen then draw it
if x ~= false then
gr.setColor(100,100,255,160)
drawvelret(x, y)
end
end
end
end
-- make sure oldmissiontime is incremented
oldmissiontime = missiontime
end
]
#End
into an empty text document. Save it as "velindc-sct.tbm" (The file extension needs to be .tbm, not .txt or whatever). Put that file into mediavps\data\tables. The velocity indicator will now be loaded together with the mediavps.
-
Nice! It works great!
Just out of curiosity, not to be picky or anything...but it is sort of difficult to see. Is there a way to make it a bit larger and more visible?
I tried the following change:
from:
gr.setColor(100,100,255,160)
to:
gr.setColor(255,255,255,255)
It didn't actually change the color of the reticule.
-
Whoa...lots of code... :nervous:
you should see some of the monsters im working on, my ui just broke 1000 lines today
-
I'd assume that for making it larger you'd have to change the numbers in this part:
drawvelret = function(x, y)
gr.drawGradientLine(x+10,y+10,x+2,y+2)
gr.drawGradientLine(x-10,y+10,x-5,y+2)
gr.drawGradientLine(x+10,y-10,x+2,y-2)
gr.drawGradientLine(x-10,y-10,x-2,y-2)
end
-
you could also use a bitmap. ive been steering away from procedural hud elements involving large numbers of primitives, and instead try to use models and images.
-
Oh, I didn't know that things like this exists.
Gotta use it in my mod :)
Thanks gus :)