View Full Version : Test My Script
pigdart
2003-08-23, 10:21 AM
hello,
I need help testing my script on diff. setups. Its a zoom power hud(eg 2x,5x). Download the zip and put the cs file in your autoexec folder. Load up a map and press the cycle zoom key. 'z' by default.
http://www.pigdart.netfirms.com/legends/pi...oomPowerHud.zip (http://www.pigdart.netfirms.com/legends/pigZoomPowerHud.zip)
heres what i need to know any errors
your resoultion in game
the postion on the screen. It should be right, bottom of the reticle but not covering the reticle
what the different zoom levels say on your computer (eg 2x,5x)
And anything else you want to say about it. Hows the posistion should it be on the other side of the reticle?
that link is acting weird so
http://www.pigdart.netfirms.com/legends/index.htm
and click on the 'pigZoomPowerHud.zip' link
MrSniper
2003-08-23, 01:04 PM
You are my new hero! :) Thanks for writing this script, its been badly needed. Anyway here is what I found:
I use windowed 1024x768 32bit res. The scripts works fine, except its positioning is above the reticle to the left. Thats EXACTLY where I want it though, so its not a bad thing :). Just letting you know it didnt position like you said it should.
// pigZoomPowerHud.cs by pigdart
// TEXT COLOUR IN RGB(red green blue)[default="255 255 255"]
$pigZoomPowerHudTextColour = "255 255 255";
// Speed in seconds that the hud will be displayed[default=2]
$pigZoomPowerHudSpeed = 2;
// ----------------------------------------------------------------
// ------------------ NOTHING TO SEE MOVE ALONG -------------------
// ----------------------------------------------------------------
// ---- my funcs ----
function pigZoomPowerHudUpdate()
{
//cancel the hide hud schedule if already running
if($pigZoomPowerHudHideSchedule != 0) cancel($pigZoomPowerHudHideSchedule);
pigZoomPowerHud.setVisible(true);//on
//get the zoom power
%res = getWord($pref::Video::resolution, 0);
%power = ($pref::player::defaultFov / $pref::player::currentFOV);
%power += (%power/4);
%zoom = mFloor(getWord(PlayGui.extent, 0) / %power);
//update the hud
pigZoomPowerHudText.setValue(mFloor(%res / %zoom) @ "x");
//schedeul to hide the hud
$pigZoomPowerHudHideSchedule = pigZoomPowerHud.schedule($pigZoomPowerHudSpeed*100 0, setVisible, 0);
}
// ---- gui ----
new GuiControlProfile ("pigZoomPowerHudTextProfile")
{
fontType = "Arial";
fontSize = 16;
fontColor = $pigZoomPowerHudTextColour;
justify = "right";
};
new GuiControl(pigZoomPowerHud)
{
profile = "GuiDefaultProfile";
horizSizing = "center";
vertSizing = "center";
position = "0 0";
extent = "512 512";
minExtent = "8 8";
visible = "1";
new GuiTextCtrl(pigZoomPowerHudText)
{
profile = "pigZoomPowerHudTextProfile";
position = "410 310";
extent = "32 16";
visible = "1";
};
};
playGui.add(pigZoomPowerHud);
// ---- overwrite ----
package pigZoomPower
{
//trigger update when changing FOV with other scripts
function zoomTo(%fov)
{
parent::zoomTo(%fov);
pigZoomPowerHudUpdate();
}
//trigger update when cycling FOV levels
function cycleZoom(%val)
{
parent::cycleZoom(%val);
pigZoomPowerHudUpdate();
}
};
activatepackage(pigZoomPower);
Changed the text hud to be a child of a centered hud of a 512 by 512 extent. Change the position of pigZoomPowerHudText instead, and it should stay in the same place to the reticle when you change resolution.
Given the hide schedule a var, which is canceled when you show the hud before it has been hidden.
Should now be compatible with other scripts that change the FOV.
Hope you don't mind the changes, pigdart.
pigdart
2003-08-24, 03:35 AM
Thanks ilys, those are great improvments. Thank you*2
MrSniper, thank's for your reply. ilys code will help with the position, I have the numbers based on the new code so just a little more time and you'll be able to choose the corner of the ret. you want it in.
vBulletin® v3.6.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.