CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 3
Call of Duty: Black Ops 3 Mods and Scripts
Call of Duty: Black Ops 3 Scripts
Black Ops 3 GSC Zombie Counter Function by DualVII +Source
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="CabCon" data-source="post: 14030" data-attributes="member: 1"><p>Find your mapname.gsc (i.e. <strong>Black Ops III\usermaps\zm_yourmapname\scripts\zm\zm_yourmapname.gsc</strong>, not .csc)</p><p></p><p>Within the <strong>main()</strong> function, add a new line inside it: <strong>_INIT_ZCOUNTER();</strong></p><p></p><p>After inserting that in, go to the end of the script and paste in the entire following:</p><p>[CODE]function _INIT_ZCOUNTER()</p><p>{</p><p> ZombieCounterHuds = [];</p><p> ZombieCounterHuds["LastZombieText"] = "Zombie Left";</p><p> ZombieCounterHuds["ZombieText"] = "Zombie's Left";</p><p> ZombieCounterHuds["LastDogText"] = "Dog Left";</p><p> ZombieCounterHuds["DogText"] = "Dog's Left";</p><p> ZombieCounterHuds["DefaultColor"] = (1,1,1);</p><p> ZombieCounterHuds["HighlightColor"] = (1, 0.55, 0);</p><p> ZombieCounterHuds["FontScale"] = 1.5;</p><p> ZombieCounterHuds["DisplayType"] = 0; // 0 = Shows Total Zombies and Counts down, 1 = Shows Currently spawned zombie count</p><p></p><p> ZombieCounterHuds["counter"] = createNewHudElement("left", "top", 2, 10, 1, 1.5);</p><p> ZombieCounterHuds["text"] = createNewHudElement("left", "top", 2, 10, 1, 1.5);</p><p></p><p> ZombieCounterHuds["counter"] hudRGBA(ZombieCounterHuds["DefaultColor"], 0);</p><p> ZombieCounterHuds["text"] hudRGBA(ZombieCounterHuds["DefaultColor"], 0);</p><p></p><p> level thread _THINK_ZCOUNTER(ZombieCounterHuds);</p><p>}</p><p></p><p>function _THINK_ZCOUNTER(hudArray)</p><p>{</p><p> level endon("end_game");</p><p> for(;;)</p><p> {</p><p> level waittill("start_of_round");</p><p> level _ROUND_COUNTER(hudArray);</p><p> hudArray["counter"] SetValue(0);</p><p> hudArray["text"] thread hudMoveTo((2, 10, 0), 4);</p><p> </p><p> hudArray["counter"] thread hudRGBA(hudArray["DefaultColor"], 0, 1);</p><p> hudArray["text"] SetText("End of round"); hudArray["text"] thread hudRGBA(hudArray["DefaultColor"], 0, 3);</p><p> }</p><p>}</p><p></p><p>function _ROUND_COUNTER(hudArray)</p><p>{</p><p> level endon("end_of_round");</p><p> lastCount = 0;</p><p> numberToString = "";</p><p></p><p> hudArray["counter"] thread hudRGBA(hudArray["DefaultColor"], 1.0, 1);</p><p> hudArray["text"] thread hudRGBA(hudArray["DefaultColor"], 1.0, 1);</p><p> hudArray["text"] SetText(hudArray["ZombieText"]);</p><p> if(level flag::get("dog_round"))</p><p> hudArray["text"] SetText(hudArray["DogText"]);</p><p></p><p> for(;;)</p><p> {</p><p> zm_count = (zombie_utility::get_current_zombie_count() + level.zombie_total);</p><p> if(hudArray["DisplayType"] == 1) zm_count = zombie_utility::get_current_zombie_count();</p><p> if(zm_count == 0) {wait(1); continue;}</p><p> hudArray["counter"] SetValue(zm_count);</p><p> if(lastCount != zm_count)</p><p> {</p><p> lastCount = zm_count;</p><p> numberToString = "" + zm_count;</p><p> hudArray["text"] thread hudMoveTo((10 + (4 * numberToString.Size), 10, 0), 4);</p><p> if(zm_count == 1 && !level flag::get("dog_round")) hudArray["text"] SetText(hudArray["LastZombieText"]);</p><p> else if(zm_count == 1 && level flag::get("dog_round")) hudArray["text"] SetText(hudArray["LastDogText"]);</p><p></p><p> hudArray["counter"].color = hudArray["HighlightColor"]; hudArray["counter"].fontscale = (hudArray["FontScale"] + 0.5);</p><p> hudArray["text"].color = hudArray["HighlightColor"]; hudArray["text"].fontscale = (hudArray["FontScale"] + 0.5);</p><p> hudArray["counter"] thread hudRGBA(hudArray["DefaultColor"], 1, 0.5); hudArray["counter"] thread hudFontScale(hudArray["FontScale"], 0.5);</p><p> hudArray["text"] thread hudRGBA(hudArray["DefaultColor"], 1, 0.5); hudArray["text"] thread hudFontScale(hudArray["FontScale"], 0.5);</p><p> }</p><p> wait(0.1);</p><p> }</p><p>}</p><p></p><p>function createNewHudElement(xAlign, yAlign, posX, posY, foreground, fontScale)</p><p>{</p><p> hud = newHudElem();</p><p> hud.horzAlign = xAlign; hud.alignX = xAlign;</p><p> hud.vertAlign = yAlign; hug.alignY = yAlign;</p><p> hud.x = posX; hud.y = posY;</p><p> hud.foreground = foreground;</p><p> hud.fontscale = fontScale;</p><p> return hud;</p><p>}</p><p></p><p>function hudRGBA(newColor, newAlpha, fadeTime)</p><p>{</p><p> if(isDefined(fadeTime))</p><p> self FadeOverTime(fadeTime);</p><p></p><p> self.color = newColor;</p><p> self.alpha = newAlpha;</p><p>}</p><p></p><p>function hudFontScale(newScale, fadeTime)</p><p>{</p><p> if(isDefined(fadeTime))</p><p> self ChangeFontScaleOverTime(fadeTime);</p><p></p><p> self.fontscale = newScale;</p><p>}</p><p></p><p>function hudMoveTo(posVector, fadeTime) // Just because MoveOverTime doesn't always work as wanted</p><p>{</p><p> initTime = GetTime();</p><p> hudX = self.x;</p><p> hudY = self.y;</p><p> hudVector = (hudX, hudY, 0);</p><p> while(hudVector != posVector)</p><p> {</p><p> time = GetTime();</p><p> hudVector = VectorLerp(hudVector, posVector, (time - initTime) / (fadeTime * 1000));</p><p> self.x = hudVector[0];</p><p> self.y = hudVector[1];</p><p> wait(0.0001);</p><p> }</p><p>}[/CODE]</p><p></p><p>You can configure the HUD within the _INIT_ZCOUNTER() function where you can change text, colours, font scale and display type. Display type is either showing the total zombies in that round, or the currently spawned zombie count.</p><p></p><p>Contributors and Credits are going to:</p><p><strong>DualVII</strong></p><p></p><p>Original post: <a href="http://phabricator.aviacreations.com/w/black_ops_3/basics/zombie_counter/" target="_blank"><img class="smilie smilie--emoji" loading="lazy" alt="⚡" title="High voltage :zap:" src="https://cdn.jsdelivr.net/joypixels/assets/7.0/png/unicode/64/26a1.png" data-shortname=":zap:" /> Zombie Counter</a></p></blockquote><p></p>
[QUOTE="CabCon, post: 14030, member: 1"] Find your mapname.gsc (i.e. [B]Black Ops III\usermaps\zm_yourmapname\scripts\zm\zm_yourmapname.gsc[/B], not .csc) Within the [B]main()[/B] function, add a new line inside it: [B]_INIT_ZCOUNTER();[/B] After inserting that in, go to the end of the script and paste in the entire following: [CODE]function _INIT_ZCOUNTER() { ZombieCounterHuds = []; ZombieCounterHuds["LastZombieText"] = "Zombie Left"; ZombieCounterHuds["ZombieText"] = "Zombie's Left"; ZombieCounterHuds["LastDogText"] = "Dog Left"; ZombieCounterHuds["DogText"] = "Dog's Left"; ZombieCounterHuds["DefaultColor"] = (1,1,1); ZombieCounterHuds["HighlightColor"] = (1, 0.55, 0); ZombieCounterHuds["FontScale"] = 1.5; ZombieCounterHuds["DisplayType"] = 0; // 0 = Shows Total Zombies and Counts down, 1 = Shows Currently spawned zombie count ZombieCounterHuds["counter"] = createNewHudElement("left", "top", 2, 10, 1, 1.5); ZombieCounterHuds["text"] = createNewHudElement("left", "top", 2, 10, 1, 1.5); ZombieCounterHuds["counter"] hudRGBA(ZombieCounterHuds["DefaultColor"], 0); ZombieCounterHuds["text"] hudRGBA(ZombieCounterHuds["DefaultColor"], 0); level thread _THINK_ZCOUNTER(ZombieCounterHuds); } function _THINK_ZCOUNTER(hudArray) { level endon("end_game"); for(;;) { level waittill("start_of_round"); level _ROUND_COUNTER(hudArray); hudArray["counter"] SetValue(0); hudArray["text"] thread hudMoveTo((2, 10, 0), 4); hudArray["counter"] thread hudRGBA(hudArray["DefaultColor"], 0, 1); hudArray["text"] SetText("End of round"); hudArray["text"] thread hudRGBA(hudArray["DefaultColor"], 0, 3); } } function _ROUND_COUNTER(hudArray) { level endon("end_of_round"); lastCount = 0; numberToString = ""; hudArray["counter"] thread hudRGBA(hudArray["DefaultColor"], 1.0, 1); hudArray["text"] thread hudRGBA(hudArray["DefaultColor"], 1.0, 1); hudArray["text"] SetText(hudArray["ZombieText"]); if(level flag::get("dog_round")) hudArray["text"] SetText(hudArray["DogText"]); for(;;) { zm_count = (zombie_utility::get_current_zombie_count() + level.zombie_total); if(hudArray["DisplayType"] == 1) zm_count = zombie_utility::get_current_zombie_count(); if(zm_count == 0) {wait(1); continue;} hudArray["counter"] SetValue(zm_count); if(lastCount != zm_count) { lastCount = zm_count; numberToString = "" + zm_count; hudArray["text"] thread hudMoveTo((10 + (4 * numberToString.Size), 10, 0), 4); if(zm_count == 1 && !level flag::get("dog_round")) hudArray["text"] SetText(hudArray["LastZombieText"]); else if(zm_count == 1 && level flag::get("dog_round")) hudArray["text"] SetText(hudArray["LastDogText"]); hudArray["counter"].color = hudArray["HighlightColor"]; hudArray["counter"].fontscale = (hudArray["FontScale"] + 0.5); hudArray["text"].color = hudArray["HighlightColor"]; hudArray["text"].fontscale = (hudArray["FontScale"] + 0.5); hudArray["counter"] thread hudRGBA(hudArray["DefaultColor"], 1, 0.5); hudArray["counter"] thread hudFontScale(hudArray["FontScale"], 0.5); hudArray["text"] thread hudRGBA(hudArray["DefaultColor"], 1, 0.5); hudArray["text"] thread hudFontScale(hudArray["FontScale"], 0.5); } wait(0.1); } } function createNewHudElement(xAlign, yAlign, posX, posY, foreground, fontScale) { hud = newHudElem(); hud.horzAlign = xAlign; hud.alignX = xAlign; hud.vertAlign = yAlign; hug.alignY = yAlign; hud.x = posX; hud.y = posY; hud.foreground = foreground; hud.fontscale = fontScale; return hud; } function hudRGBA(newColor, newAlpha, fadeTime) { if(isDefined(fadeTime)) self FadeOverTime(fadeTime); self.color = newColor; self.alpha = newAlpha; } function hudFontScale(newScale, fadeTime) { if(isDefined(fadeTime)) self ChangeFontScaleOverTime(fadeTime); self.fontscale = newScale; } function hudMoveTo(posVector, fadeTime) // Just because MoveOverTime doesn't always work as wanted { initTime = GetTime(); hudX = self.x; hudY = self.y; hudVector = (hudX, hudY, 0); while(hudVector != posVector) { time = GetTime(); hudVector = VectorLerp(hudVector, posVector, (time - initTime) / (fadeTime * 1000)); self.x = hudVector[0]; self.y = hudVector[1]; wait(0.0001); } }[/CODE] You can configure the HUD within the _INIT_ZCOUNTER() function where you can change text, colours, font scale and display type. Display type is either showing the total zombies in that round, or the currently spawned zombie count. Contributors and Credits are going to: [B]DualVII[/B] [B][/B] Original post: [url="http://phabricator.aviacreations.com/w/black_ops_3/basics/zombie_counter/"]⚡ Zombie Counter[/url] [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 3
Call of Duty: Black Ops 3 Mods and Scripts
Call of Duty: Black Ops 3 Scripts
Black Ops 3 GSC Zombie Counter Function by DualVII +Source
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top