UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Soul Chest Counter For BluntStuffy\'s Soul Chest

broken avatar :(
Created 9 years ago
by louisfm16
0 Members and 1 Guest are viewing this topic.
1,761 views
broken avatar :(
×
broken avatar :(
Location: usCali
Date Registered: 11 July 2015
Last active: 7 years ago
Posts
21
Respect
Forum Rank
Legless Crawler
Primary Group
Member
Personal Quote
Live and Learn
×
louisfm16's Groups
louisfm16's Contact & Social LinksPortfolio
I made a Soul Counter for BluntStuffy's Soul Chest,
this wont run a bunch of loops like while(), for() ect. because it will only run once every time a zombie is killed near a soul chest.


Step 1


copy & paste this into an empty .gsc file
(Hint: you can make a new text document and change the .txt. extention to .gsc or simply make a copy of another gsc file and delete its contents):
Code Snippet
Plaintext
// Top Right
soul_counter_tr(death_count, max_count) {
if( level.soul_counter_created_once == true) {
level.soul_counter_remaining = create_simple_hud();
level.soul_counter_remaining.horzAlign = "right";
level.soul_counter_remaining.vertAlign = "right";
level.soul_counter_remaining.alignX = "center";
level.soul_counter_remaining.alignY = "top";
level.soul_counter_remaining.y = 6;
level.soul_counter_remaining.x = -30;
level.soul_counter_remaining.foreground = 1;
level.soul_counter_remaining.fontscale = 9.0;
level.soul_counter_remaining.alpha = 1;
level.soul_counter_remaining.color = ( 1, 1, 0 );

level.soul_counter_souls_left = create_simple_hud();
level.soul_counter_souls_left.horzAlign = "right";
level.soul_counter_souls_left.vertAlign = "right";
level.soul_counter_souls_left.alignX = "center";
level.soul_counter_souls_left.alignY = "top";
level.soul_counter_souls_left.y = 6;
level.soul_counter_souls_left.x = -115;
level.soul_counter_souls_left.foreground = 1;
level.soul_counter_souls_left.fontscale = 9.0;
level.soul_counter_souls_left.alpha = 1;
level.soul_counter_souls_left.color = ( 1, 0, 0 );
level.soul_counter_souls_left SetText("Souls Left: ");
}


remainingSouls =  max_count - death_count;
level.soul_counter_remaining SetValue(remainingSouls);
   wait 0.5;

if(level.soul_counter_finished == true) {
thread soul_counter_destroy();
}
}

soul_counter_destroy() {
level.soul_counter_remaining destroy();
level.soul_counter_souls_left destroy();
level.soul_counter_created_once = true;
}
rename this file to soul_counter and place it in your root/mods/MAPNAME/maps


Step 2


open up your root /mods/MAPNAME/maps/_soul_chest.gsc
and inside the chest_death_count() function find:
Code Snippet
Plaintext
self thread chest_anims();

right under that paste this:
Code Snippet
Plaintext
       level.soul_counter_created_once = true;
       level.soul_counter_finished = false;
       thread maps\soul_counter::soul_counter_tr(self.death_count, self.max_count);

next find:
Code Snippet
Plaintext
else if( self.death_count >= 2 && self.death_count <= self.max_count-1 )
{

again right under that paste this:
Code Snippet
Plaintext
	// continue the soul counter
level.soul_counter_created_once = false;
level.soul_counter_finished = false;
thread maps\soul_counter::soul_counter_tr(self.death_count, self.max_count);

finally find:
Code Snippet
Plaintext
else if( self.death_count == self.max_count )
{

and again right under that paste this:
Code Snippet
Plaintext
       // end the soul counter
level.soul_counter_finished = true;
thread maps\soul_counter::soul_counter_tr(self.death_count, self.max_count);

And your done just dont forget to check it when your building your mod

Double Post Merge: August 27, 2015, 07:40:06 pm
I forgot 1 thing

inside your _soul_chest.gsc in your time_out() function find:
Code Snippet
Plaintext
	self notify( "time_out" );
wait 2;
self notify( "chest_full" );


and below that paste this:
Code Snippet
Plaintext
	thread maps\soul_counter::soul_counter_destroy();

that way if the chest time out the counter wont stay on your screen

can a moderator please add this to the original post, Thank you
Last Edit: August 27, 2015, 07:40:06 pm by louisfm16

 
Loading ...