[T1] Ammo Hud for Andrews konfig

twice
01-14-2004, 11:35 PM
im working on customizing it and i need a good ammo hud.. slug for some reason yours does not work which i dont understand so if anyone else has some others or some stand alone ones please link me up

cyclonite
01-15-2004, 08:22 AM
function Ammo::Init()
{
$Ammo::Colour = 0;
$Ammo::Type[13] = "Bullet";
$Ammo::Type[15] = "Plasma Bolt";
$Ammo::Type[17] = "Grenade Ammo";
$Ammo::Type[19] = "Mortar Ammo";
$Ammo::Type[21] = "Disc";
}

function Ammo::Update()
{
AmmoCount(getMountedItem( 0));
Schedule::Add("Ammo::Update();", 0.1);
}


function AmmoCount(%weaponId)
{
%ammo = getItemCount($Ammo::Type[%weaponId]);

if(%ammo)
{
control::SetPosition("Ammo_Text", Stripped::getScreenSizeX( )/2 - 32, Stripped::getScreenSizeY( )/2 + 32);
control::setValue("Ammo_Text", "<F3>" @ %ammo);
}
else
{
if ((%weaponId == "13") || (%weaponId == "15") || (%weaponId == "17") || (%weaponId == "19") || (%weaponId == "21"))
{
control::SetPosition("Ammo_Text", 475, 350);
Ammo::Flash(); //Flash Out of Ammo
}
else
control::setValue("Ammo_Text", "");
}
}

function Ammo::Flash()
{
if ($Ammo::colour > 2) { $Ammo::colour = 0; }
control::setValue("Ammo_Text", "<f"@$Ammo::colour@">Out of Ammo!");
$Ammo::colour++;
}

function Ammo::Show()
{
control::setVisible("Ammo_Text", TRUE);
}

function Ammo::Hide()
{
control::setVisible("Ammo_Text", FALSE);
}


function Ammo::Create()
{
if(!$ConnectedToServer) {
schedule("Ammo::Create();", 1);
return;}

$CountHud = newObject("Ammo_Text", FearGuiFormattedText, Stripped::getScreenSizeX( )/2 - 32, Stripped::getScreenSizeY( )/2 + 32, 0, 0);

addToSet(PlayGui, $CountHud);

Ammo::Update();
}

function Ammo::Destroy()
{
deleteObject($CountHud);
}

Event::Attach(eventExit, Ammo::Destroy);
Event::Attach(eventConnec tionAccepted, Ammo::Destroy);
Event::Attach(eventConnec tionAccepted, Ammo::Create);
Event::Attach(eventConnec ted, Ammo::Init);

** Had to use PHP tags, CODE tags don't seem to work properly...

I quickly ported that over when I still cared about my config. Prolly could clean it up a lot.
Ported a fair bit of other stuff, so just ask if you need.

twice
01-15-2004, 02:39 PM
Stripped::getScreenSizeX( )/2 - 32, Stripped::getScreenSizeY( )/2 + 32, 0, 0);


stripped command? what would this function be in andrews
ok problem fixed thx cyc

twice
01-15-2004, 03:26 PM
What about a clock hud kinda like the one evita used for 1.5 i woudl port it except i am a fucking idiot in codeland

SuperSlug
01-15-2004, 03:32 PM
http://www.ecst.csuchico.edu/~slug/T1/slugHUDAmmo.acs.cs <--AmmoHUD

Also look here: http://www.ecst.csuchico.edu/~slug/T1/ you might like some of the stuff. I made a lot of scripts compatible for Andrew's config (not 15k)

twice
01-15-2004, 03:39 PM
http://www.ecst.csuchico.edu/~slug/T1/slugHUDAmmo.acs.cs <--AmmoHUD

Also look here: http://www.ecst.csuchico.edu/~slug/T1/ you might like some of the stuff. I made a lot of scripts compatible for Andrew's config (not 15k)
i couldnt get it to work
im not running 15k :o thx tho (i grabbed your's a few days ago and couldnt get it working)

[meph]DooM!
01-15-2004, 04:01 PM
i think slug is the only one in the world who actually takes advantage of my hud system (aka strips an existing script of its hud code and adds his own in)

Acer
01-15-2004, 04:30 PM
hmm...i need a killpop hud for andrew's config. i might be able to stick the code in the kill.notify.acs.cs with just the bottomprint command or somethin...can someone whip me one up, or tell me how do stick it in kill.notify.acs.cs? =\

twice
01-15-2004, 04:34 PM
DooM!']i think slug is the only one in the world who actually takes advantage of my hud system (aka strips an existing script of its hud code and adds his own in)
if you would have done it right the first time.. grr :P lol
I am actually almost done
ill post pics :o

twice
01-15-2004, 04:48 PM
OK code didnt work and php makes it look fucked...
How can i port this to andrews! (andrew? :) )



// Clock
// Evita
// ported from MrPoops version.

$clock::Xoffset = "54";
$clock::Yoffset = "18";

function Clock::Init() {

if($Clock::Loaded)
return;

$Clock::Loaded = true;

$Clock::Container = newObject("Clock_Container", SimGui::Control, 0, 0, 86, 19);
$Clock::HUD = newObject("Clock_Text", FearGuiFormattedText, 4, 0, 66, 19);

addtoset($Clock::Containe r, $Clock::HUD);
}

function Clock::Update(%min, %sec) {

$ClockHud::Hour = floor(%min / 60);
$ClockHud::Min = %min % 60;
$ClockHud::Sec = %sec;

$ClockHud::CountingDown = true;

schedule::Add("Clock::Iterate();", 1);

Control::setValue("Clock_Text", "<f2>" @ LZero($ClockHud::Hour) @ ":" @ LZero($ClockHud::Min) @ ":" @ LZero($ClockHud::Sec));
}

function Clock::SetReverse() {

$ClockHud::Hour = $ClockHud::Min = $clockHud::Sec = 0;
$ClockHud::CountingDown = false;
}

function LZero(%number) {

if (%number < 10)
return "0" @ %number;
else
return %number;
}

function Clock::Iterate() {

if(!$Mode::PlayMode)
return;

if($ClockHud::CountingDow n) {

if($ClockHud::Sec > 0) {
$ClockHud::Sec--;
}

else {
$ClockHud::Sec = 59;

if ($ClockHud::Min > 0) {
$ClockHud::Min--;
}

else {
$ClockHud::Min = 59;
$ClockHud::Hour--;
}
}

} else {

if ($ClockHud::Sec < 59) {
$ClockHud::Sec++;
}

else {
$ClockHud::Sec = 0;

if ($ClockHud::Min < 59) {
$ClockHud::Min++;
}

else {
$ClockHud::Min = 0;
$ClockHud::Hour++;
}
}
}

schedule::add("Clock::Iterate();", 1);

Control::setValue("Clock_Text", "<f2>" @ LZero($ClockHud::Hour) @ ":" @ LZero($ClockHud::Min) @ ":" @ LZero($ClockHud::Sec));
}

function Clock::GuiOpen(%gui) {

if(%gui != playGui)
return;

addToSet(playGui, $Clock::Container);

$clock::PosX = ($scr_x-$clock::Xoffset);
$clock::PosY = ($scr_y-$clock::Yoffset);

control::setPosition("Clock_Container", $clock::PosX, $clock::PosY);
}

function Clock::GuiClose(%gui) {

if(%gui != playGui)
return;

removeFromSet(playGui, $Clock::Container);
}

function Clock::Set() {

$ClockHud::Hour = $ClockHud::Min = $clockHud::Sec = 0;
schedule("ClockHud::Iterate();", 1);
Control::setValue("Clock_Text", "<f2>" @ LZero($ClockHud::Hour) @ ":" @ LZero($ClockHud::Min) @ ":" @ LZero($ClockHud::Sec));
}

function Clock::Destroy() {

removeFromSet(playGui, $Clock::Container);
deleteObject($Clock::Cont ainer);
}

onCall(GuiOpen, Clock::GuiOpen);
onCall(GuiClose, Clock::GuiClose);
onCall(Connected, Clock::Set);
onCall(ExitGame, Clock::Destroy);
onCall(MatchStarted, Clock::SetReverse);
onCall(UpdateTime, Clock::Update);

Clock::Init();

twice
01-15-2004, 04:58 PM
Heres what it looks like so far
http://www.aletheiagaming.com/3232.jpg

SuperSlug
01-15-2004, 05:23 PM
KillPop: http://www.ecst.csuchico.edu/~slug/T1/slugKillPop.acs.cs

[meph]DooM!
01-15-2004, 05:24 PM
i had a clock i made for spy i think
i wonder if i still have it

[meph]DooM!
01-15-2004, 05:30 PM
http://www.team5150.com/~andrew/scripts/Clock.cs

Acer
01-15-2004, 06:27 PM
KillPop: http://www.ecst.csuchico.edu/~slug/T1/slugKillPop.acs.cs
says "Victim: False Weapon: False"


wtf?

twice
01-15-2004, 06:38 PM
DooM!']http://www.team5150.com/~andrew/scripts/Clock.cs
thank ye kind sir

Acer
01-15-2004, 07:19 PM
says "Victim: False Weapon: False"


wtf?
fix it :[

twice
01-15-2004, 08:17 PM
ok im almost done thanks for help slug and cyc and andrew!

SuperSlug
01-16-2004, 03:52 AM
If you need anything that I don't have, I might be willing to do it in the next hour or so.