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

bonus points script

HOT
broken avatar :(
Created 11 years ago
by death_reaper0
0 Members and 1 Guest are viewing this topic.
10,463 views
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 5 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
respect the dead

donates greatly appreciated :) paypal.me/F3ARxReaper666
discord server:
https://discord.gg/tsGHW99
×
death_reaper0's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
this is my simple bonus points script that i'm happy to share with the UGX community!


feel free to use in your maps with credit


first of all you need to go into your map's _zombiemode.gsc script and add place


Code Snippet
Plaintext
    include_powerup( "bonus" );

under


Code Snippet
Plaintext
init_fx();

next open up your map's _zombiemode_powerups.gsc and scroll down to

Code Snippet
Plaintext
add_zombie_powerup( "nuke", "zombie_bomb",	&"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke" );
// add_zombie_powerup( "nuke", "zombie_bomb", &"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke_hotness" );
add_zombie_powerup( "insta_kill", "zombie_skull", &"ZOMBIE_POWERUP_INSTA_KILL" );
add_zombie_powerup( "double_points","zombie_x2_icon", &"ZOMBIE_POWERUP_DOUBLE_POINTS" );
add_zombie_powerup( "full_ammo",  "zombie_ammocan", &"ZOMBIE_POWERUP_MAX_AMMO");
add_zombie_powerup( "carpenter",  "zombie_carpenter", &"ZOMBIE_POWERUP_MAX_AMMO");

and under that place

Code Snippet
Plaintext
	add_zombie_powerup( "bonus",        "zombie_points",  "bonus");

change the "zombie_points" to whatever model you want the bonus points powerup model to be


next find

Code Snippet
Plaintext
powerup_grab()

and under

Code Snippet
Plaintext
case "carpenter":
level thread start_carpenter( self.origin );
players[i] thread powerup_vo("carpenter");
break;

place

Code Snippet
Plaintext
case "bonus":
    players[i] thread bonus_powerup( self );
     break;

scroll down until you find

Code Snippet
Plaintext
nuke_flash()

and under that piece of script place

Code Snippet
Plaintext
bonus_powerup( drop_item )
{
players = Get_Players();

low = 100; //lowest amount possible
high = 2000; //highest amount possible

points = randomIntRange(low,high);

// give the points funtion
for(i=0;i<players.size;i++) //gives points to all players
{
if(level.zombie_vars["zombie_point_scalar"] == 1) // if double points is off
{
players[i] maps\_zombiemode_score::add_to_player_score( points );
}
else // if double points is on
{
points = points * 2;
players[i] maps\_zombiemode_score::add_to_player_score( points );
}
}

for (i = 0; i < players.size; i++)
{
players[i] playsound ("points_vox");

}
}

change the number of high and low for the highest amount and lowest amount possible is


next you need to open your "mapname".csv in codwaw root folder/zone_source and put this at the bottom

Code Snippet
Plaintext
xmodel,zombie_points

change the "zombie_points" to whatever model you had set earlier


that should be everything you have to do, enjoy your new bonus points! feel free to use in maps with credit
broken avatar :(
×
broken avatar :(
Location: gbEast Midlands
Date Registered: 7 February 2015
Last active: 5 years ago
Posts
643
Respect
Forum Rank
Zombie Enslaver
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Donations massively appreciated: paypal.me/DanT98
Signature
Stranded
Nacht Der Untoten: Reimagined
Encampment
Encampment V2: BO3 Mod

Mapper and Weapon Porter - I release what I can of my work for the community to enjoy :)
×
ProRevenge's Groups
Mapper Has released one or more maps to the UGX-Mods community.
ProRevenge's Contact & Social LinksProRevenge
This looks nice, but does it give you a "random" amount of points in your specified range? as in non multiples of 10 like the other released scripts do. IE you can get 1392 points or 739 points? If its multiples of 10 I will use this, looks nice :)
broken avatar :(
×
broken avatar :(
Location: nlThe Netherlands
Date Registered: 23 November 2013
Last active: 4 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Slayer Elite
×
Gabrielle's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Gabrielle's Contact & Social LinksTutorialZoneNL
This looks nice, but does it give you a "random" amount of points in your specified range? as in non multiples of 10 like the other released scripts do. IE you can get 1392 points or 739 points? If its multiples of 10 I will use this, looks nice :)

It generates a complete random number, so you will get points ending on something different than a 0 which can cause the 'I have enough points but not enough' as the game displays a rounded number, but the value is still lower.
broken avatar :(
×
broken avatar :(
Location: gbEast Midlands
Date Registered: 7 February 2015
Last active: 5 years ago
Posts
643
Respect
Forum Rank
Zombie Enslaver
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Donations massively appreciated: paypal.me/DanT98
×
ProRevenge's Groups
Mapper Has released one or more maps to the UGX-Mods community.
ProRevenge's Contact & Social LinksProRevenge
That's what I feared, is there any way to limit it to multiples of 10, or better yet, make the HUD correctly display the number of points? (In bo2, it was possible to get points ending in an 8 or a 3 and HUD showed it right)
broken avatar :(
×
broken avatar :(
Location: nlThe Netherlands
Date Registered: 23 November 2013
Last active: 4 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Slayer Elite
×
Gabrielle's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Gabrielle's Contact & Social LinksTutorialZoneNL
That's what I feared, is there any way to limit it to multiples of 10, or better yet, make the HUD correctly display the number of points? (In bo2, it was possible to get points ending in an 8 or a 3 and HUD showed it right)

No, that's not possible. It's possible to generate a number ending on 0, but then you'd need to create an algorithm or simply use an array with all possible values (which is kind of a work-around but will work just fine).

I haven't seen a single map with the points HUD fully working, and there are a lot of good modders out there. This kind of proves it's not possible.
broken avatar :(
×
broken avatar :(
Location: gbEast Midlands
Date Registered: 7 February 2015
Last active: 5 years ago
Posts
643
Respect
Forum Rank
Zombie Enslaver
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Donations massively appreciated: paypal.me/DanT98
×
ProRevenge's Groups
Mapper Has released one or more maps to the UGX-Mods community.
ProRevenge's Contact & Social LinksProRevenge
Alright, Ill probably use this script anyway, it should work nice :)
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 4 months ago
Posts
1,863
Respect
Forum Rank
Zombie Destroyer
Primary Group
Mapper
My Groups
More
Personal Quote
ok
Signature
Aye mate you don't know me so y don't you shut tf up ok buddy :)

×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
Cool man, I scripted this myself a good while ago and was planning on releasing it to go with the model I also released.

What I did with mine was give the player a random set amount of points, so I inputted 500, 550, 400, etc. and it worked, don't know if you want to do that? :)
broken avatar :(
×
broken avatar :(
Location: gbEast Midlands
Date Registered: 7 February 2015
Last active: 5 years ago
Posts
643
Respect
Forum Rank
Zombie Enslaver
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Donations massively appreciated: paypal.me/DanT98
×
ProRevenge's Groups
Mapper Has released one or more maps to the UGX-Mods community.
ProRevenge's Contact & Social LinksProRevenge
Yeah I think that would be the better option, so maybe do randomint 1-10, and have 1 = 100 points, 2 = 200, and input values etc, or however you do it :)
broken avatar :(
×
broken avatar :(
Location: nlThe Netherlands
Date Registered: 23 November 2013
Last active: 4 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Slayer Elite
×
Gabrielle's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Gabrielle's Contact & Social LinksTutorialZoneNL
Yeah I think that would be the better option, so maybe do randomint 1-10, and have 1 = 100 points, 2 = 200, and input values etc, or however you do it :)

You can write an own function which makes a random int. Read more about it https://en.wikipedia.org/wiki/Random_number_generation. You can also make an array and pick a random value by index (index = random). For example, generate a random number from 0 to 6, have an array with 6 items and get the value by index.
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
That's what I feared, is there any way to limit it to multiples of 10, or better yet, make the HUD correctly display the number of points? (In bo2, it was possible to get points ending in an 8 or a 3 and HUD showed it right)
Really?
broken avatar :(
×
broken avatar :(
Location: gbEast Midlands
Date Registered: 7 February 2015
Last active: 5 years ago
Posts
643
Respect
Forum Rank
Zombie Enslaver
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Donations massively appreciated: paypal.me/DanT98
×
ProRevenge's Groups
Mapper Has released one or more maps to the UGX-Mods community.
ProRevenge's Contact & Social LinksProRevenge
Really?

Yeah, with the Half off perk, strangely using it on box in a row halved the price again.
So you could hit the box for 475, then again for 237/8 points. Leaving you with a 3, 8, 7 or whatever on the end. It is rare to happen, but it can happen
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 10 months ago
Posts
602
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
you could just get a random number between the 10 and 200 then * 10
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
To fix the hud issue, you can just round the number.

Like this:

Code Snippet
Plaintext
roundOff(int, mod)
{
while(int % mod != 0)
{
if(int % mod >= 5)
int++;
else
int--;
}
return int;
}

Some suggestions:

-multiply the points amount as you pass it to add_to_player_score.
-indent your code inside the if and else statements.
-the code in the last for() loop could be merged with the one above it.
Last Edit: October 02, 2015, 09:56:39 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 2 years ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
you could just get a random number between the 10 and 200 then * 10

pretty much yeah. just use this line instead:

Code Snippet
Plaintext
points = RandomIntRange( 10, 200 ) * 10;

which will give the same 100 to 2000 but in intervals of ten
Last Edit: October 03, 2015, 12:38:12 am by alaurenc9
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Code Snippet
Plaintext
	points = RandomIntRange( 1, 25 + 1) * 100;

Is the one used in BO2 by the way.

Also RandomIntRange is min, max+1 so 1-10 would return 1-9 only.
Last Edit: October 05, 2015, 04:47:55 pm by DidUknowiPwn

 
Loading ...