In that perk limit script, there is only one significant line, the rest don't mean anything.
So maybe just transfer that one significant line (level.perk_purchase_limit = 9;
) into that other script you're trying to use.

Ox_
Posts
-
[Support] More than one custom GSC script? -
[Release] GSC Dump SearcherNice project for sure, but, and I hate to say it, I don't really see any reason why this would be used over a normal program that does this, and is quite frankly does it a lot better. I'm not even seeing regex support and looking at the source very quickly, I don't think the gui will even be responsive while searching and searching might be quite inefficient.
Maybe try to think of some features that make sense for gsc specifically, since anything that's related to just normal text searching has already been done by others, and done way better than anyone who browses this forum could do.
I can't think of too many ideas for you, but one thing that sometimes annoys me a bit, is encountering some custom gsc function they call, and then I have to search where the function is defined so I understand what's happening.
That process could be made easy. -
[Resource] Ladder ModWouldn't toggle that on
self
since it's not player specific.
Toggle it onlevel
. -
[Support] Code for distance meter for trickshots?Cahz said in Code for distance meter for trickshots?:
Ox_ said in Code for distance meter for trickshots?:
Cahz said in Code for distance meter for trickshots?:
Ox_ Okay so if one CoD world unit is 2.54cm, then you would actually divide by 39.37.
2.54 cm = 1 unit
100 cm = 39.3700 units = 1 m
Well actually you'd divide by
5000/127
, but maybe just multiply by0.0254
, be easier.5000/127 is literally 39.37... which works totally fine by the way. So no need to multiply
It's not, but sure, it's close enough for most uses.
-
[Support] Code for distance meter for trickshots?Cahz said in Code for distance meter for trickshots?:
Ox_ Okay so if one CoD world unit is 2.54cm, then you would actually divide by 39.37.
2.54 cm = 1 unit
100 cm = 39.3700 units = 1 m
Well actually you'd divide by
5000/127
, but maybe just multiply by0.0254
, be easier. -
[Support] Code for distance meter for trickshots?One CoD world unit is 2.54cm.
And for distance, an easy way is just in compare distance between the attacker andself
(player who's about to get killed) in e.g thelevel.callbackplayerkilled
function. -
[Support] camochanger/canswapDrgn said in camochanger/canswap:
Ox_ It means he donated to the project.
Should be named something else I think.
Contributor sounds like would've contributed something in making of the client.
Like Github contributor. That's the first thing I think of. -
[Support] camochanger/canswapHow is this dude a "contributor" lmfao.
What does that even mean. -
[Support] Save and load disabledlula said in Save and load disabled:
Ox_ saveandload()
{
if (self.snl == 0) { self iprintln("^5Save and Load Enabled"); self iprintln("Crouch and Press [{+actionslot 2}] To Save"); self iprintln("Crouch and Press [{+actionslot 1}] To Load"); self thread dosaveandload(); self.snl = 1; } else { self iprintln("^1Save and Load Disabled"); self.snl = 0; self notify("SaveandLoad"); }
}
dosaveandload(){
self endon("disconnect"); self endon("SaveandLoad"); load = 0; for(;;) { if (self actionslottwobuttonpressed() && self GetStance() == "crouch" && self.snl == 1) { self.o = self.origin; self.a = self.angles; load = 1; self iprintln("^5Position Saved"); wait 2; } if (self actionslotonebuttonpressed() && self GetStance() == "crouch" && load == 1 && self.snl == 1) { self setplayerangles(self.a); self setorigin(self.o); } wait 0.05;
}
}
And self thread saveandload(); in onPlayerSpawned() {
I'd assume you probably never define
self.snl
? You should define it before using it.
Also toggling it on/off every time the player spawns in doesn't sound very good to me. -
[Resource] GSC Resources and Helpful LinksStudying how the actual game works, in gsc, is very useful as well.
And also allows you to do all kinds of cool stuff, like replace some behavior when something happens, or maybe re-use some of the gsc that's already in the game so you don't need to custom make everything.The stickied post in here has a download to a gsc dump. Then also get get some program that searches for text from inside multiple files. Useful when you're looking for something specific, or want to see where some function is defined, where it's called, etc etc etc. Been using "AstroGrep" myself to do this.
-
[Support] Save and load disabledMaybe show code?
Not quite sure what sort of answers you expect with the current state of your question. -
[Resource] [Zombies] Game Start Delay/Quota ScriptSeems like good stuff.
Btw, are you sure you don't break Mob of the Dead by overridinglevel.round_prestart_func
?
That map has custom logic in that function. -
[Release] [GSC] Zombies Custom Powerup | Unlimited AmmoGroverFox said in [GSC] Zombies Custom Powerup | Unlimited Ammo:
No, I'm taking about the coding part
I see.
Well good luck with with the learning -
[Release] [GSC] Zombies Custom Powerup | Unlimited AmmoGroverFox said in [GSC] Zombies Custom Powerup | Unlimited Ammo:
Really like this and hope someday to learn how to do it.
If you're just looking to use it, there's a download the precompiled .gsc you can use.
How you use this .gsc depends a bit. If you're looking to use it on a Plutionum server, they have a tutorial stickied in here.
If not on a Plutonium server, you can Google for a tutorial on how to inject it to Steam/Redacted. -
[Release] [GSC] Zombies Custom Powerup | Unlimited AmmoKnight said in [GSC] Zombies Custom Powerup | Unlimited Ammo:
Ox_
I literally was just gonna post my source of my new power-up I cobbled together and I noticed you updated your source
guess I'll have to go through it. but ill still post an images of the power-up next to yours.
Pictures (sorry for the gigantic pics before lol)
https://imgur.com/gallery/BH4k3C7I think you get the idea, it's the Pack-A-Punch power up!
It paps your gun! Oh and I used the teddy bear model because I couldn't find a pap.Good stuff. Would like to see your implementation of the countdown, always interesting to see what sort of approaches other people have taken.
About the powerup itself, sounds quite overpowered to me haha. Would need some balancing done to it for sure.If you're up for a challenge, try to balance the powerup.
What I'd look into myself, is changing its spawning chance based on in what stage of the game players are.
E.g. really rare to spawn in unless pap is legitmately accessible as well. Also based on how much money the player has.
And if players are really late game, could spawn it in quite commonly just for fun. In such a case I wouldn't use the normal way of spawning them in though. You wouldn't want to consume the limit of powerups per round and push chances of max ammo off powerup array.
I guess same could be said about adding any custom powerup, it always makes max ammo more rare. I didn't see this is a problem with unlimited ammo though, since it should be quite good at high rounds and you also fill up your current clip at least. -
[Release] [GSC] Zombies Custom Powerup | Unlimited AmmoJezuzLizard latest version is up now.
I'll check out your version tomorrow probably and see about adding it to the OP as well. -
[Release] [GSC] Zombies Custom Powerup | Unlimited AmmoFry said in [GSC] Zombies Custom Powerup | Unlimited Ammo:
OP is your code on the main post the latest changes of the GSC? I have been thinking about merging this to RG server along with unlimited perks etc. I just wanted to make sure before I push it live.
Yes it was, and will always be. Also just pushed a big update.
banni said in [GSC] Zombies Custom Powerup | Unlimited Ammo:
Tried improving the code, added ambient sound when powerup is active, and iprintin message about powerup being picked up and being ended. I also tried drawing a hud powerup icon but it doesn't work.
I also removed zombie blood code because it wasn't working.#include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\gametypes_zm\_hud_util; #include maps\mp\gametypes_zm\_hud_message; //important include #include maps\mp\zombies\_zm_powerups; init() { level thread onPlayerConnect(); precacheshader( "zom_icon_minigun" ); // tried precaching death machine icon for hud, didn't work for some reason include_zombie_powerup("unlimited_ammo"); add_zombie_powerup("unlimited_ammo", "T6_WPN_AR_GALIL_WORLD", &"ZOMBIE_POWERUP_UNLIMITED_AMMO", ::func_should_always_drop, 0, 0, 0); powerup_set_can_pick_up_in_last_stand("unlimited_ammo", 1); } onPlayerConnect() { for(;;) { level waittill("connected", player); player thread onPlayerSpawned(); } } onPlayerSpawned() { self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill("spawned_player"); //only run this when the host spawns in for the very first time if(!isDefined(level.unlimited_ammo_first_spawn)) { wait 2; level._zombiemode_powerup_grab = ::custom_powerup_grab; level.unlimited_ammo_first_spawn = "fortnite!fortnite!!"; } } } //fires when we grab any custom powerup custom_powerup_grab(s_powerup, e_player) { if (s_powerup.powerup_name == "unlimited_ammo") level thread unlimited_ammo_powerup(s_powerup, e_player); } unlimited_ammo_powerup(m_powerup, e_player) { foreach(player in level.players) { //if powerup is already on, turn it off player notify("end_unlimited_ammo"); //decided to use stinger from when you get ray gun from box player playsound("mus_raygun_stinger"); player thread turn_on_unlimited_ammo(); player thread notify_unlimited_ammo_end(); player thread sfx_inf_ammo(); player thread ammo_hud_create(); player iprintln("^2Bottomless Clip!"); wait 30; player iprintln("^1Bottomless Clip has ended!"); player playsound("zmb_insta_kill_loop_off"); } } sfx_inf_ammo() { level endon("game_ended"); self endon("disconnect"); self endon("end_unlimited_ammo"); inf_ammo_ent = spawn( "script_origin", ( 0, 0, 0 ) ); inf_ammo_ent playloopsound( "zmb_insta_kill_loop" ); wait 30; inf_ammo_ent stoploopsound(); inf_ammo_ent destroy(); } //my attempt at making a hud icon for it, as expected, it didn't work ammo_hud_create() { self.ammo_icon = newclienthudelem( self ); self.ammo_icon.horzalign = "center"; self.ammo_icon.vertalign = "middle"; self.ammo_icon.x = -16; self.ammo_icon.y = 16; self.ammo_icon.alpha = 0; width = 64; height = 64; self.ammo_icon setshader( "zom_icon_minigun", width, height ); wait 30; self.ammo_icon destroy(); } turn_on_unlimited_ammo() { level endon("game_ended"); self endon("disconnect"); self endon("end_unlimited_ammo"); self setWeaponAmmoClip(self GetCurrentWeapon(), 150); for(;;) { self waittill ("weapon_fired"); //simply set the current mag to be full on a loop self setWeaponAmmoClip(self GetCurrentWeapon(), 150); wait .02; } } notify_unlimited_ammo_end() { level endon("game_ended"); self endon("disconnect"); self endon("end_unlimited_ammo"); //changed duration to 30 because why not wait 30; self notify("end_unlimited_ammo"); }
The zombie blood was working as intended. Did you read the comments about it?
It wasn't supposed to add the zombie blood powerup to all maps, just make it functional in Origins. Your current code overwrites the custom powerup pickup function and it doesn't include zombie blood so the powerup is broken in your code.
My latest version right now uses a better way of not breaking zombie blood though, check the edit in OP.And not bad with the raygun sound. I would probably use it if I wasn't too used to knowing that sound means someone got it from the random box. Do you have a list of sounds? All I have nowadays is what I find from Google, and wasn't able to find anything good.
Also I decided not to add that ambient sound to my latest version. I tried your stuff and literally could not hear a thing. So I don't see the point. Maybe if there was some good sound, but well, don't know of one.
And about your hud, the biggest problem with it is that you set it to be fully transparent
alpha = 0
. So yeah, can't really see it haha.
See my latest version in OP though, I added a hud.And you can't
wait
inside theunlimited_ammo_powerup()
function. Right now in your code the first player gets the powerup and then 30seconds later the second player gets the powerup, etc.Also I decided not to take the
waittill("weapon_fired")
approach, since it's no good if you swap to a weapon that would have to reloaded, or if you're out of ammo. And also, setting the current clip to be full every .05sec is literally nothing in gsc. So I don't see any point bothering to implement proper logic for handling it with waittills.And yeah, I guess 30sec duration is good. First I thought it's a bit too much, but meh, whatever, I'll make it be that.
Btw, "Bottomless Clip", love the name haha.
I added that in, thanks. -
[Release] [GSC] Zombies Custom Powerup | Unlimited AmmoJezuzLizard said in [GSC] Zombies Custom Powerup | Unlimited Ammo:
Ox_ I got around to making a simple waw style timer:
#include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\gametypes_zm\_hud_util; #include maps\mp\gametypes_zm\_hud_message; #include maps\mp\zombies\_zm_powerups; #include maps\mp\zombies\_zm_utility; //credit goes to _Ox for the original code init() { level thread onPlayerConnect(); //include and init the powerup include_zombie_powerup("unlimited_ammo"); add_zombie_powerup("unlimited_ammo", "T6_WPN_AR_GALIL_WORLD", &"ZOMBIE_POWERUP_UNLIMITED_AMMO", ::func_should_always_drop, 0, 0, 0); powerup_set_can_pick_up_in_last_stand("unlimited_ammo", 1); initializeUnlimitedAmmo(); } onPlayerConnect() { for(;;) { level waittill("connected", player); player thread onPlayerSpawned(); } } onPlayerSpawned() { self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill("spawned_player"); if(!isDefined(level.unlimited_ammo_first_spawn)) { wait 2; //delayed defining of the custom function so we're sure to //override the function Origins defines for this level._zombiemode_powerup_grab = ::custom_powerup_grab; //message for the host to indicate that it should be all good self iprintln("^6Unlimited Ammo Custom Powerup Loaded"); //spawns the unlimited ammo powerup in front of the host at the very start of the game //can be used to make sure it's actually working and all good //remove the line directly below to disable //level specific_powerup_drop("unlimited_ammo", self.origin + VectorScale(AnglesToForward(self.angles), 70)); level.unlimited_ammo_first_spawn = "fortnite!fortnite!!"; } } } initializeUnlimitedAmmo() { level.unlimited_ammo_active = false; //initializes that the powerup is off for the timer level.unlimited_ammo_duration = 20; //initializes the timer duration var change this to affect the duration } //fires when we grab any custom powerup custom_powerup_grab(s_powerup, e_player) { if (s_powerup.powerup_name == "unlimited_ammo") level thread unlimited_ammo_powerup(s_powerup, e_player); } unlimited_ammo_powerup(m_powerup, e_player) { foreach(player in level.players) { //if powerup is already on, turn it off player notify("end_unlimited_ammo"); //small cha ching sound for each player when someone picks up the powerup //cba'd to come up with anything better and don't have a list of sounds, //change to w/e if you want. player playsound("zmb_cha_ching"); player thread notify_unlimited_ammo_end(); player thread turn_on_unlimited_ammo(); player thread unlimited_ammo_timer(); } } turn_on_unlimited_ammo() { level endon("game_ended"); self endon("disconnect"); self endon("end_unlimited_ammo"); for(;;) { //simply set the current mag to be full on a loop self setWeaponAmmoClip(self GetCurrentWeapon(), 150); wait .02; } } notify_unlimited_ammo_end() { level endon("game_ended"); self endon("disconnect"); self endon("end_unlimited_ammo"); level.unlimited_ammo_duration = 20; //this sets the duration for the unlimited_ammo_timer() modify this when modifying the wait wait 20; //directly changes the duration of the powerup self notify("end_unlimited_ammo"); } unlimited_ammo_timer() { level endon("game_ended"); self endon("disconnect"); if ( level.unlimited_ammo_active == true )//checks whether the powerup is already active and returns so no dupe countdown { return; } level.unlimited_ammo_active = true; //sets that the powerup is active Remaining = create_simple_hud(); Remaining.horzAlign = "center"; Remaining.vertAlign = "middle"; Remaining.alignX = "Left"; Remaining.alignY = "middle"; Remaining.y = 180; //- is top 0 is middle + is bottom Remaining.x = 85; //- is left 0 is middle + is right Remaining.foreground = 1; Remaining.fontscale = 3.0; Remaining.alpha = 1; Remaining.color = ( 0.423, 0.004, 0 ); UnlimitedAmmo = create_simple_hud(); UnlimitedAmmo.horzAlign = "center"; //valid inputs: center, top, bottom, left, right, top_right, top_left, topcenter, bottom_right, bottom_left UnlimitedAmmo.vertAlign = "middle"; UnlimitedAmmo.alignX = "center"; UnlimitedAmmo.alignY = "middle"; UnlimitedAmmo.y = 180; //- is top 0 is middle + is bottom UnlimitedAmmo.x = -1; //- is left 0 is middle + is right UnlimitedAmmo.foreground = 1; UnlimitedAmmo.fontscale = 3.0; UnlimitedAmmo.alpha = 1; //transparency UnlimitedAmmo.color = ( 0.423, 0.004, 0 ); UnlimitedAmmo SetText("Unlimited Ammo: "); while( 1 ) { Remaining SetValue( level.unlimited_ammo_duration ); //this is necessary so the timer will reset on the chance that 2 unlimited ammo drops drop at once wait 1; level.unlimited_ammo_duration--; if ( level.unlimited_ammo_duration <= 0 ) { UnlimitedAmmo.alpha = 0; //these 2 variables make the text invisible instead of destroying it to avoid the string overflow Remaining.alpha = 0; level.unlimited_ammo_active = false; //sets this to false in order to allow the timer to start again break; } } }
Basically instead of destroy() I just turn it transparent so it avoids creating too many strings over time or any for that matter beyond one. Obviously this isn't future proofed so if more custom powerups are added it will be awkward to have them all stack using this method.
edit: I will post the other powerups I teased in a previous post in its own topic when I get them working correctly on all maps.
Oh man, I actually just got around making some improvements myself. Made my own hud and made it act pretty much like a normal powerup's hud does. So it shows an icon and starts blinking at 10sec and faster at 5sec.
Gonna finish it up and record a vid about it and then post it here, stay tuned haha.I'll check your version out later as well and can probably put it to the OP.
Also, going to test if my thing is safe by spawning in like 1000 of these powerups on me and seeing what happens :'-D
-
[Release] [GSC] Zombies Custom Powerup | Unlimited AmmoJezuzLizard said in [GSC] Zombies Custom Powerup | Unlimited Ammo:
Ox_ Plutonium is a custom bo2 client that supports 8 player dedicated zombie servers on all maps. It doesn't support GSC injection and instead uses its own modloader similar to Redacted so dedicated servers can load custom GSC mods. The GSC modloader feature is relatively new so it seems to have some interesting behavior sometimes. Eg. your old code not working but your new code does for some reason that I'll look into at some point.
I recommend you try Plutonium sometime since it has a more active playerbase than steam bo2, you can actually find games for all maps usually.
Also, I used your mod as a base to add a few extra powerups in the game files as drops like, the bonus team points, perk bottle, and random weapon. So thanks for the new version again.
Last thing, is it possible for a world at war nacht der untoten style powerup display for the infinite ammo powerup? I think it would it say Infinite Ammo: 20 and tick down from 20 at the bottom of the screen.
Yeah I know what Plutonium is/does, just didn't know what quirks are related to hosting a server and loading custom gsc, thanks.
And about the old code not working, which map did you try? the old code didn't work in Buried & Origins, as described in the Original post. The delayed registering of the custom powerup pickup function fixed that.And cool that you added some stuff, maybe post it here if you want to share. Some other people might want to use them as well. Maybe I would use it as well next time I play zombies with my friends.
And about having a countdown or whatever to indicate when the powerup ends.
It most certainly is possible, but really cba right now at least. Already spend a few hrs trying to get the native style powerup hud to work via clientfields (as is done in the original game gsc), but every time I just errored out with client field mismatch error, and I have no idea why. So I lost motivation.The reason why I didn't at the very first go for drawing text on the screen, is because I don't remember from on top of my head how to draw 100% safe text. Been years and years since I properly did gsc (good old Xbox 360 RGH days). Would be super pissed if the game crashed due to an overflow on like round 40 or whatever.
I guess like aniprintln
would be safe to use. Looks maybe quite stupid though.
If you want aniprintln
solution, and don't know how to make it yourself, I can make it for you.