Author Topic: EScort Reticle script  (Read 8653 times)

0 Members and 1 Guest are viewing this topic.

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: EScort Reticle script
m!m you are a king.
Thanks mate.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: EScort Reticle script
Things after a # are shown on the script...
I don't think that should be happening or people can see right through the microjump tricks etc.

Notice that the ship "FRX-00#1" in the escort list appears as FRX-00 as it should, but appears on the reticle boxing thingy as FRX-00#1



that and it still appears to be drawing for the targeted ship (I got this off the Wiki not so long ago)
(´・ω・`)
=============================================================

 
Re: EScort Reticle script
m!m updated the script a couple posts back

Here you go:
Code: [Select]
#Conditional Hooks

$Application: FS2_Open
$On Game Init:
[
function string.filterInvisible(str)
    local index = str:find("#", 0, true)

    if (index ~= nil) then
        str = str:sub(1, index - 1)
    end

    return str
end

function drawReticle(ship)
local r, g, b = ship.Team:getColor()
gr.setColor(r, g, b, 120)

local l, t, r, b = gr.drawTargetingBrackets(ship, true)

if l ~= nil then
local dist = ship.Position:getDistance(hv.Player.Position)
local distString = string.format("%.0fm", dist)

gr.drawString(ship.Name:filterInvisible(), r + 3, t)
gr.drawString(ship.Class.Name:filterInvisible())

local hit_x = r + 3
local hit_y = b - gr.CurrentFont.Height
local percentage = ship.HitpointsLeft / ship.HitpointsMax

local hitpointsString

if (percentage <= 0) then
percentage = 0
end

hitpointsString = string.format("%.1f%%", percentage * 100)

if (t + 2 * gr.CurrentFont.Height > b - gr.CurrentFont.Height) then
gr.drawString(hitpointsString)
else
gr.drawString(hitpointsString, hit_x, hit_y)
end

gr.drawString(distString, r - gr.getStringWidth(distString), b + 3)
end
end
]

$On HUD Draw:
[
if missiontime == nil then
   missiontime = mn.getMissionTime()
   oldmissiontime = missiontime
end

if missiontime ~= nil then
if hu.HUDDrawn then
missiontime = mn.getMissionTime()

if oldmissiontime ~= missiontime then
if mn.EscortShips ~= nil then
local NumberEscorted = #mn.EscortShips
for i= 1,NumberEscorted do
local escortedship = mn.EscortShips[i]
if escortedship.Position:getScreenCoords() ~= false and escortedship ~= hv.Player.Target then
drawReticle(escortedship)
end
end
end
end
end

oldmissiontime = missiontime
end
]

#End
 

Disclaimer: Script not tested in current state but used code has been in use for some time so it should work.

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: EScort Reticle script
Well why isn't that on the wiki? :/
(´・ω・`)
=============================================================

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: EScort Reticle script
Well you could have read the first page before posting  :p
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: EScort Reticle script
I did, and I thought that the Wiki would have been updated, seeing as well, it is linked on the first page >.>
(´・ω・`)
=============================================================

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Okay, did some more test runs with the script and noted several deficiencies:

- Alt name isn't being read, the class name is always the default
- Brackets are not sensitive to change-IFF-color sexps (they always stay the team color)

That really wrecks a lot of the "FRED hacks" for missions...
(´・ω・`)
=============================================================

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Okay, did some more test runs with the script and noted several deficiencies:

- Alt name isn't being read, the class name is always the default
- Brackets are not sensitive to change-IFF-color sexps (they always stay the team color)

That really wrecks a lot of the "FRED hacks" for missions...

*bump*
(´・ω・`)
=============================================================

 

Offline AndrewofDoom

  • In A.D. 2366 war was beginning
  • 29
  • Permanent yuri goggles.
    • Skype
    • Steam
    • Twitter
That's because neither of these have accessors in scripting, so you're out of luck in those until someone adds them to the scripting API.
My Efforts:
SF Knight

20:08:19   AndrewofDoom: Though I find it mildly disturbing that a loli is giggling to mass destruction.
20:10:01   Spoon: I find it mildly arrousing
20:10:07   AndrewofDoom: Woah
20:10:15   Spoon: sound like my kind of loli
20:10:21   Spoon: and im not even a lolicon