Skip to content

BO2 Modding Support & Discussion

Got modding questions regarding Plutonium T6? Scripts erroring? Request help from the community here. Discuss your modding projects etc.

2.3k Topics 8.9k Posts
  • Where to find useful functions and variables (reference) for GSC?

    3
    0 Votes
    3 Posts
    487 Views
    @Ox_ said in Where to find useful functions and variables (reference) for GSC?: More experienced people just remember the stuff from years of experience from earlier cods etc. When getting started, just pretty much just Google search for a list of stuff. Looking at what other people have done is also good when getting started. Loads of tutorials for gsc found with a Google search as well. Remember that you don't have to search for BO2 gsc, gsc is pretty much the same for all cods. Best documented stuff you'll probably find from earlier cods. Or maybe BO3 since it actually officially supports modding. Also don't forget about just studying the actual gscs BO2 runs off. It's very good to find new stuff as well. You'll find a dump for the decompiled gscs stickied in the BO2 modding section. For example that other question you just posted here, "how to find out zombie kills", is solved in like a minute by just searching the word "kills" in patch_zm. Personally I use "AstroGrep" to search for text inside the whole dump. Hey, thx for your reply. I found "kills" as well but it seems all I could relate was to global stats, not in the "match" itself. I'll keep on digging but geez most part of the code is pretty tiresome to read! Nice tips, thank you again!
  • Zombies self.kills?

    2
    0 Votes
    2 Posts
    134 Views
    Should be stored in player.pers["kills"].
  • Help me please

    perks errors bo2 zombies scripts
    2
    0 Votes
    2 Posts
    304 Views
    @chorchi175 Just use notepad++ or Atom to edit gsc files Have anymore questions add me on Discord: Ashton Biehl#6969
  • Screen Refresh Rate

    7
    0 Votes
    7 Posts
    851 Views
    @Ras go into properties, there it will show you the refresh rate.
  • Custom games

    2
    0 Votes
    2 Posts
    212 Views
    You can't.
  • [Support] VIP Dvar system

    4
    0 Votes
    4 Posts
    318 Views
    -solved
  • [Support] Can you set DVAR so players have VIP when map changes?

    11
    0 Votes
    11 Posts
    657 Views
    @mikzy that is absolutely correct. I didn't think it would work, but it does
  • [Zombies] Get Secondary/Next Weapon Name/ID

    zombies server gsc
    2
    0 Votes
    2 Posts
    491 Views
    A Former User?
    I was able to find the function that does this! If someone is interested in using it, follow the code I made: changeRound() { for(;;) { level waittill( "end_of_round" ); // "start_of_round" works too wait 0.1; allWeapons = primaryWeapons(); if( level.round_number > 0 && isDefined(allWeapons) ) { i = 0; while ( i < allWeapons.size ) { self setweaponammoclip( allWeapons[i], weaponclipsize( allWeapons[i] ) ); self givemaxammo( allWeapons[i] ); i++; } iprintln( "Voce mereceu, toma aqui seu ^2Max Ammo ^1<3" ); } } } primaryWeapons() { primaryWeapons = self getweaponslistprimaries(); if( primaryWeapons.size > 0 ) { return primaryWeapons; } else { return; } } Basically, in this code created, at the end of the round the player get max ammo. It can be used when starting the round too, just change the "end_of_round" for "start_of_round". The function responsible for getting the names of the weapons is self getweaponslistprimaries (); returning an array with the names of weapons.
  • onplayercommand gsc code

    5
    0 Votes
    5 Posts
    560 Views
    @Matrix i’ve asked you questions before but not specifically about your DLL. i just had a theory that a DLL was used to make that work. Some kid was leaking ur shit in a discord server
  • Get the player's ping !Help

    4
    0 Votes
    4 Posts
    173 Views
    I doubt it is exposed to GSC, but maybe you are lucky and it is in self.pers
  • Loading GSC Scripts [Help]

    4
    0 Votes
    4 Posts
    540 Views
    @Sorex a big thank you! I found out how to open the menu.
  • [Support] Mono Syntax Error

    28
    0 Votes
    28 Posts
    1k Views
    @Farzad sorry for bringing this old post back up, but does anyone know why the game crashes 0.01 seconds before the killcam shows? The new text is displayed, I changed the commas to decimals and all, and I do get my own text instead of Round Win, but why would it crash? May anyone provide me their GSC dump for that file or nah
  • Image don't load

    5
    0 Votes
    5 Posts
    513 Views
    @Sorex try precaching ALL the images for your mapvote menu instead of having the defined level.mapvote get precahched. even if they aren't used that game, it should still work with no issues
  • Contents of the GSC file "_clientids" !Question

    7
    0 Votes
    7 Posts
    666 Views
    @Kalitos said in Contents of the GSc file "_clientids" !Question: @Ox_ I agree with you, although since you mentioned the gsc dump search, I got on it, and if you talk about ".clientid", the game does refer to it, but it directly includes "player.clientid". On the other hand, if we search for level.clientid, we only see that it refers to a single file "_clientids.gsc". It's strange. The level.clientid part doesn't seem very interesting or relevant, it just increases and then gives the next player the next number. But each player getting their own clientid field is that interesting part. Searching for uses of that field (the field owner by a player, not the level) in patch_mp comes back with 70 matches (few of them in dev blocks though) across 14 different gscs. @sass said in Contents of the GSc file "_clientids" !Question: I know the file existed back in CoD4, and wasn't even used back then IIRC. To clarify, player.clientid's do indeed exist and is (somewhat) used in the game. However this file doesn't handle them at all as you can already tell. If you replace the _clientids gsc with e.g. this init() { level thread onPlayerConnect(); } onPlayerConnect() { for(;;) { level waittill("connected", player); player thread onPlayerSpawned(); } } onPlayerSpawned() { self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill("spawned_player"); self iprintln(isDefined(self.clientid)); } } You'll see that that field indeed doesn't exist if we patch _clientids to not create it. (As opposed to that field working just as expected if we don't patch _clientids) Makes me wonder how come we're not breaking the functionality in those aforementioned 15 different gscs. Or perhaps we are, but the functionality there isn't essential. I cba'd to study/test that.
  • [Support] SnD Round Time Elimination Killcam Delay!?

    9
    0 Votes
    9 Posts
    328 Views
    @Farzad Aight then.
  • [Support] How do I implement Overflow Fix in my code? ! Help

    2
    0 Votes
    2 Posts
    662 Views
    @Kalitos A bit off topic, but you should know that you can utilize a HUD element's label attribute in order to prevent unnecessary unique string usage. Here's an example of your code converted: healthPlayer () { self endon ("disconnect"); self.healthText = createFontString ("Objective", 1.7); self.healthText setPoint ("CENTER", "TOP", 300, "CENTER"); self.healthText.label = &"^2 HEALTH: ^7"; while (true) { self.healthText setValue(self.health); wait 0.25; } } As you can see, I assigned some text to your HUDs label attribute and replaced setText() with setValue(). This can be done because you only ever need to update the health value and not the text before it. Using this method, you're only using one unique string rather than a new one every time the player's health changes.
  • (HELP)How i can install IW4MADMIN on my server?

    Locked
    6
    0 Votes
    6 Posts
    889 Views
    its solved, thx for help me TY
  • [Support] GSC: Spectators?

    4
    0 Votes
    4 Posts
    197 Views
    @Sorex With SnD, you can’t just spawn in if you connect late and the round has started.. I’m looking to auto set any spectators (people who connect late to the round and can’t spawn in) to allies or axis
  • [Support] Some function to get the name of the weapon in the code

    1
    0 Votes
    1 Posts
    97 Views
    No one has replied
  • [Support] Get weapon category from weapon array

    6
    0 Votes
    6 Posts
    303 Views
    @Kalitos You might want to do some testing with getWeaponClass() though, I don't know the exact strings it returns. Do a test with an AR, an SMG, a shotgun, etc and see what it returns.