Posts: 22
Threads: 5
Joined: Oct 2012
Reputation:
0
11-20-2012, 16:31
(This post was last modified: 11-20-2012, 16:39 by Ra3shed.)
(11-18-2012, 22:02)DidUknowiPwn Wrote: Okay whatever my only conclusion it's the Custom HUD we have. Anyone mind checking this?
Code: weaponHudInit()
{
level.weaponicon = [];
// precache
precacheShader("hud_us_grenade");
precacheShader("hud_us_semtex");
precacheShader("hud_icon_claymore");
precacheShader("hud_icon_c4");
precacheShader("weapon_attachment_tactical");
// equipment
level.weaponicon["frag"] = "hud_us_grenade";
level.weaponicon["semtex"] = "hud_us_semtex";
level.weaponicon["claymore"] = "hud_icon_claymore";
level.weaponicon["c4"] = "hud_icon_c4";
level.weaponicon["throwingknife"] = "weapon_attachment_tactical";
}
getWeaponIcon(name)
{
base = strtok(name , "_")[0];
ret = level.weaponicon[base];
if(!isDefined(ret))
return "None";
return ret;
}
AmmoHud()
{
self endon("disconnect");
self endon("death");
if(!isDefined(self.ammoBoard))
{
self.ammoBoard = self createFontString( "default", 1.7 );
self.ammoBoard setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -55, -40);
self.ammoBoard.HideWhenInMenu = true;
}
if(!isDefined(self.stockBoard))
{
self.stockBoard = self createFontString( "default", 2 );
self.stockBoard setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -18, -40);
self.stockBoard.HideWhenInMenu = true;
}
if(!isDefined(self.slash))
{
self.slash = self createFontString( "default", 1.9 );
self.slash setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -45, -40);
self.slash.HideWhenInMenu = true;
}
if(!isDefined(self.nadeseperator))
{
self.nadeseperator = self createFontString( "default", 1.9 );
self.nadeseperator setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -43, -60);
self.nadeseperator.HideWhenInMenu = true;
self.nadeseperator.sort = -9999999;
}
if(!isDefined(self.equipmentcount))
{
self.equipmentcount = self createFontString( "default" , 1.9);
self.equipmentcount setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -30, -60);
self.equipmentcount.HideWhenInMenu = true;
self.equipmentcount.sort = -9999999;
}
// do every time you spawn to make sure it resets
self.nadeicon destroy();
self.grenade = level.nadetypes[self.nadetype];
self.nadeicon = self createIcon(getWeaponIcon(self.grenade), 16, 16);
self.nadeicon setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -55, -60);
self.nadeicon.alpha = 1;
self.nadeicon.sort = -9999999;
self.nadeicon.HideWhenInMenu = true;
lastequipment = self.grenade;
while(1)
{
self.grenade = level.nadetypes[self.nadetype];
if(self.team == "axis")
{
self.grenade = "throwingknife_mp";
self.nades = 0;
}
self.Clip = self getWeaponAmmoClip(self getCurrentWeapon());
self.Stock = self getWeaponAmmoStock(self getCurrentWeapon());
if(self.Stock >= 100)
{
self.stockBoard.fontscale = 1.7;
}
else
{
self.stockBoard.fontscale = 2;
}
self.ammoBoard setValue(self.Clip);
self.stockBoard setValue(self.Stock);
//self.slash setText("/");
self.nadeseperator setText("x\n/");
nadeclip = self getWeaponAmmoClip(self.grenade);
if(!isDefined(self.nades))
self.equipmentcount setValue(0);
else if (!isDefined(nadeclip))
self.equipmentcount setValue(self.nades);
else
self.equipmentcount setValue(self.nades + nadeclip);
if(lastequipment != self.grenade)
{
self.nadeicon destroy();
self.nadeicon = self createIcon(getWeaponIcon(self.grenade), 16, 16);
self.nadeicon setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -55, -60);
self.nadeicon.alpha = 1;
self.nadeicon.sort = -9999999;
self.nadeicon.HideWhenInMenu = true;
}
wait 0.1;
}
}
Or http://pastebin.com/shgVQLbm
Dude, do you know what does Parent Script Variables even mean?
I don't
@EDIT: Ok now I know what does this means,
It means that you too have many parent variables( level.thing, or self.thing) for the game to handle, try to reduce those kind of variables and you may replace them with child script variable:
Code: MAMA = mother.thing
PAPA = father.thing
//MAMA and PAPA are child script variables now
And AFAIK, parent variables are variables that you can use in the whole mod, child variables are the one that is only used in the same function, or else there will be unidentified variable error
Posts: 1,741
Threads: 93
Joined: Mar 2012
Reputation:
26
(11-20-2012, 16:31)Ra3shed Wrote: (11-18-2012, 22:02)DidUknowiPwn Wrote: Okay whatever my only conclusion it's the Custom HUD we have. Anyone mind checking this?
Code: weaponHudInit()
{
level.weaponicon = [];
// precache
precacheShader("hud_us_grenade");
precacheShader("hud_us_semtex");
precacheShader("hud_icon_claymore");
precacheShader("hud_icon_c4");
precacheShader("weapon_attachment_tactical");
// equipment
level.weaponicon["frag"] = "hud_us_grenade";
level.weaponicon["semtex"] = "hud_us_semtex";
level.weaponicon["claymore"] = "hud_icon_claymore";
level.weaponicon["c4"] = "hud_icon_c4";
level.weaponicon["throwingknife"] = "weapon_attachment_tactical";
}
getWeaponIcon(name)
{
base = strtok(name , "_")[0];
ret = level.weaponicon[base];
if(!isDefined(ret))
return "None";
return ret;
}
AmmoHud()
{
self endon("disconnect");
self endon("death");
if(!isDefined(self.ammoBoard))
{
self.ammoBoard = self createFontString( "default", 1.7 );
self.ammoBoard setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -55, -40);
self.ammoBoard.HideWhenInMenu = true;
}
if(!isDefined(self.stockBoard))
{
self.stockBoard = self createFontString( "default", 2 );
self.stockBoard setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -18, -40);
self.stockBoard.HideWhenInMenu = true;
}
if(!isDefined(self.slash))
{
self.slash = self createFontString( "default", 1.9 );
self.slash setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -45, -40);
self.slash.HideWhenInMenu = true;
}
if(!isDefined(self.nadeseperator))
{
self.nadeseperator = self createFontString( "default", 1.9 );
self.nadeseperator setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -43, -60);
self.nadeseperator.HideWhenInMenu = true;
self.nadeseperator.sort = -9999999;
}
if(!isDefined(self.equipmentcount))
{
self.equipmentcount = self createFontString( "default" , 1.9);
self.equipmentcount setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -30, -60);
self.equipmentcount.HideWhenInMenu = true;
self.equipmentcount.sort = -9999999;
}
// do every time you spawn to make sure it resets
self.nadeicon destroy();
self.grenade = level.nadetypes[self.nadetype];
self.nadeicon = self createIcon(getWeaponIcon(self.grenade), 16, 16);
self.nadeicon setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -55, -60);
self.nadeicon.alpha = 1;
self.nadeicon.sort = -9999999;
self.nadeicon.HideWhenInMenu = true;
lastequipment = self.grenade;
while(1)
{
self.grenade = level.nadetypes[self.nadetype];
if(self.team == "axis")
{
self.grenade = "throwingknife_mp";
self.nades = 0;
}
self.Clip = self getWeaponAmmoClip(self getCurrentWeapon());
self.Stock = self getWeaponAmmoStock(self getCurrentWeapon());
if(self.Stock >= 100)
{
self.stockBoard.fontscale = 1.7;
}
else
{
self.stockBoard.fontscale = 2;
}
self.ammoBoard setValue(self.Clip);
self.stockBoard setValue(self.Stock);
//self.slash setText("/");
self.nadeseperator setText("x\n/");
nadeclip = self getWeaponAmmoClip(self.grenade);
if(!isDefined(self.nades))
self.equipmentcount setValue(0);
else if (!isDefined(nadeclip))
self.equipmentcount setValue(self.nades);
else
self.equipmentcount setValue(self.nades + nadeclip);
if(lastequipment != self.grenade)
{
self.nadeicon destroy();
self.nadeicon = self createIcon(getWeaponIcon(self.grenade), 16, 16);
self.nadeicon setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -55, -60);
self.nadeicon.alpha = 1;
self.nadeicon.sort = -9999999;
self.nadeicon.HideWhenInMenu = true;
}
wait 0.1;
}
}
Or http://pastebin.com/shgVQLbm
Dude, do you know what does Parent Script Variables even mean?
I don't
@EDIT: Ok now I know what does this means,
It means that you too have many parent variables(level.thing, or self.thing) for the game to handle, try to reduce those kind of variables and you may replace them with child script variable:
Code: MAMA = mother.thing
PAPA = father.thing
//MAMA and PAPA are child script variables now
And AFAIK, parent variables are variables that you can use in the whole mod, child variables are the one that is only used in the same function, or else there will be unidentified variable error Well shiieeet okay thanks I'll check on those...
Do not take life too seriously. You will never get out of it alive.
|