Jbleezy/BO1-Reimagined

Question concerning code

ZeeMaster33 opened this issue · 3 comments

Hello! Just wanted to start off by saying thank you for this awesome mod! Making something of such scope with a limited toolset is nothing short of impressive. Anyhow, I'm fairly new to programming and I had a few questions concerning the code if it isn't too much of a bother.

  1. My first question concerns the camo on weapons, namely the Mp40 and the Wunderwaffe. In the file /maps/_zombiemode_weapons.gsc on line 4060, you use the function get_upgraded_weapon_model_index(weapon). Now, as far as I can tell, this function serves to switch the DG-2 and MP-40 Pack-a-Punch camos to gold and WaW respectively on any map that starts with the zombie_cod5 string. Herein lies my problem. So, assuming the map title and weapon type check out, the function returns a 1, but I can't make sense of how that changes the camo itself. What is it returning 1 to? How does that result in the camo change? Why don't the DG-2 and MP-40 both get the same camo (DG-2 has WaW camo or MP-40 is gold) given that the function returns 1 regardless of which weapon it is?

  2. My second question closely follows the first. The function for the camo variance, as far as I can tell, is called in _zombiemode_perks.gsc on line 875. However, this code is executed only on the grounds that the weapon is not a 'primary' and that the player's weapon count does not exceed the max(?), I think. That begs the question, what are the 'primaries'? I initially thought it meant a primary weapon, as in something that takes up a weapon slot (m1911, ray gun, anything that isn't a grenade/tactical), but the MP-40 and the DG-2 aren't part of that category, or so it seems. So, would the 'primaries' just include the list of weapons that are in every map, like the MP5 or G11?

  3. This one is on the implementation of custom weapons. I was trying my hand at making some code edits, yet, try as I might, I couldn't remove the added weapons (PPSH, Stoner, etc.) from any of the maps. I noticed most of the references of said weapons could be found under clientscripts, but I'm not sure at what point in the code the map decides to load the list of weapons for use.

Thank you for your time and have a good day!

Thanks for the kind words! I appreciate the amount of detail you put into your questions, you could be a good programmer.

As for changing the weapon camos, line 875 on _zombiemode_perks.gsc occurs when the player takes a weapon from Pack-a-Punch and the player has less than the maximum amount of weapons.

get_upgraded_weapon_model_index() checks which model index to use, which is defined within each weapon's weaponfile. Each weaponfile can have up to 16 different models, which I used to change the camo of the weapon model.

Normally, camos are defined in weaponOptions.csv, but you can only change the camo this way in multiplayer. Zombiemode only allows one camo.

For the added weapons, I added them in a slightly lazy way. Normally you include weapons within each map's main gsc file, but since the weapons I added are on all maps anyways, I just put under init_includes() in _zombiemode_weapons.gsc to reduce the amount of code I have to change. If you remove the include_weapon() line for a weapon, it should remove it from the map.

Thanks for the feedback! I do have one last question. Would you happen to know where to start looking for subtitles within the code? The theater ff under /zone/English? I've been itching to fix the 'Rictofan' on Kino since 2010.

I'm not sure where that would be.