Download Script: TrackTor (Stat Tracking)

Arch

Legions Developer
I need a bit of help. I'm attempting to add the BG image behind the text of the script. I currently have this:
Code:
function HudOverlay::AddHudElements(%this)
{
parent::AddHudElements(%this);
%index = %this.AddHudElement();
%this.setHudElementTexture(%index, "mods/autoexec/TrackTor/tracktor");
%this.setHudElementPosition(%index, 200, 300);
%this.setHudElementPositionAnchor(%index, "Left", "VCenter");
%this.setHudElementParent(%index, $HudElement::BaseContainer);
%this.setHudElementRenderWhenDead(%index, true);
$HudOverlay::TrackTorBackground = %index;

parent::AddHudElements(%this);
%index = %this.AddHudElement();
%this.setHudElementPosition(%index, 10, 10);
%this.setHudElementParent(%index, $HudElement::BaseContainer);
%this.setHudElementPositionAnchor(%index, "Left", "Top");
%this.setHudElementRenderWhenDead(%index, true);
$HudOverlay::TrackTor = %index;
}
};
activatepackage(TrackTor);

It seems to hide the whole script as well as conflict with the FlagHud script and wipes out the text of that script; leaving just the BG of FlagHud script. What am I doing wrong? I have a bit of knowledge of scripting by just looking over them and interpreting the code but I have no clue why this is doing this.
 

Volt Cruelerz

Legions Developer
I'm going through the process of teaching myself C# and was wondering how easy it would be for me to make this save persistently in .txt files or better yet, .xls. Is this feasible? I'm sure .txts are, but I don't know about modifying a .xls, though that would be much preferred since you could just load up excel and graph your performance over time.
 

RockeyRex

Legions Developer
File handling in TS takes up annoyingly large ammounts of processing time. But if you were to do it, for example, at the end/start of the mission, why not.
I was planning on such things in the past but never got around doing them.
 

Delpicy

Member
%this.setHudElementPosition(%index, 10, 10);
Mess with these lines to move it. If I'm correct, its coordinates according to that line start at (10,10)
 

Delpicy

Member
Notepad++ is your best bet. Its free, and it makes everything super readable. As for where those lines of code are, they ought to be in the mod itself. After you run legions with the mod, it will create a .cs and a .dso file in the mods folder named tracktor. open up the .cs one with notepad++, change what we said, save it, and I think you will have to remove the tracktor zip file from the live folder or else I think it will just overwrite what you just changed (can't hurt to remove the .dso file as well, as a new one will just be created).
 

Arch

Legions Developer
Notepad++ is your best bet. Its free, and it makes everything super readable. As for where those lines of code are, they ought to be in the mod itself. After you run legions with the mod, it will create a .cs and a .dso file in the mods folder named tracktor. open up the .cs one with notepad++, change what we said, save it, and I think you will have to remove the tracktor zip file from the live folder or else I think it will just overwrite what you just changed (can't hurt to remove the .dso file as well, as a new one will just be created).
It can also be temporarily moved in-game by opening up the console and pasting this is there. Changing the values to what you want.
Code:
HudOverlay.setHudElementPosition($HudOverlay::TrackTor, 10, 10);
Although it does move it in-game, it will not save that to the cs file. So just open up the file and replace the two values there with the ones you used.
 

Jordahan

World Leader of The 21st Century
Just explore the .zip with WINRAR and change the .cs value then press save and winrar will say "changes have been made, update?" and hit yes. Then yer good to go.
 

Arch

Legions Developer
Just explore the .zip with WINRAR and change the .cs value then press save and winrar will say "changes have been made, update?" and hit yes. Then yer good to go.
Zip? All you have to do is open the TrackTor.cs file that is in your mods folder.
 

Delpicy

Member
Jordan is explaining it in a way if the zip file is in your live folder, like Rockey says how you can just leave the zip file in the live folder and itll work. The problem is that if you just change the tracktor.cs file, it will be overwritten by the zip file. So, you can either do it jordan's way, or delete the zip file while the tracktor files are in the mod folder and do it your way
 

Arch

Legions Developer
Jordan is explaining it in a way if the zip file is in your live folder, like Rockey says how you can just leave the zip file in the live folder and itll work. The problem is that if you just change the tracktor.cs file, it will be overwritten by the zip file. So, you can either do it jordan's way, or delete the zip file while the tracktor files are in the mod folder and do it your way
Oh, I see.
 

k e v i n

Private Tester
don't think i'm doing this right....
so i tried using winrar, and i open it live/tracktor but i can't edit it
downloaded notepad++ and i open live/mods/autoexec/tracktor.cs and this is what it looks like

notepad.png

also, i don't know how to open console...and even if i did, i wouldn't want to constatly be changing it every time i play legions
 

Jordahan

World Leader of The 21st Century
You opened the .dso, which is the compiled version.
You wanna open and edit the .cs

*Note: your .dso file may say .cs at the end but you wanna look in the info off to the right side which says the actual file type. Make sure it's .cs*
*ALSO: Go download Firefox. Internet Explorer sucks donkey balls*
 
Top