People Playground

People Playground

Guns 'N Ammo 1.2 (should work now?)
BeE 2024 年 7 月 28 日 下午 1:29
I found a fix for broken saving
The longer, full fix with working extended magazines and attachments:



in private void Start()
change

UpdateSpriteforLoaded("standard");
to
UpdateSpriteforLoaded(gameObject.GetComponent<AmmoUsageBehaviour>().ammoLoaded);



You have to add this fix to every AfterSpawn in weapon (this example is for AK47):



ModAPI.KeepExtraObjects();

Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Sprites/AKEmpty.png");

var MANFBBIR = Instance.GetComponent<AmmoUsageBehaviour>();
// fixing duplicate error
if (MANFBBIR == null) {
Instance.AddComponent<AmmoUsageBehaviour>();
MANFBBIR = Instance.GetComponent<AmmoUsageBehaviour>();
}
// end of fix 1
MANFBBIR.Mag = ModAPI.LoadSprite("Sprites/AKMag.png");
MANFBBIR.MagExtended = ModAPI.LoadSprite("Sprites/AKMagExtended.png");
MANFBBIR.Empty = ModAPI.LoadSprite("Sprites/AKEmpty.png");
MANFBBIR.Loaded = ModAPI.LoadSprite("Sprites/AKLoaded.png");
MANFBBIR.LoadedExtended = ModAPI.LoadSprite("Sprites/AKLoadedExtended.png");
MANFBBIR.AmmoID = 2; //Used for munutions
// fixing ammo count on load
if (MANFBBIR.ammoLoaded == "standard") {
MANFBBIR.MaxAmmo = 30;
}
else {
MANFBBIR.MaxAmmo = 45;
}
// end of fix 2





After 5 hours of studying C# (its just javascript on drugs), reading PPG mod documentation and fighting with the terrible code, I've found the potential fix for all of your problems:

Line 717 in TheEntireGodDamnScript.cs:
Write [SkipSerialisation]

Without it whole Behaviour gets saved causing it to duplicate all scripts on next spawn.

I haven't tested it for bugs but everything seems to be working.

(btw I'm gonna use this mod to add reloading to Catt's Cannons, I hope I got permission for that)
最后由 BeE 编辑于; 2024 年 7 月 28 日 下午 2:26
< >
正在显示第 1 - 5 条,共 5 条留言
BeE 2024 年 7 月 28 日 下午 1:45 
without more code it won't save attachments and will always default the normal magazine

it probably needs skipserialisation in every property just like documentation says

https://www.studiominus.nl/ppg-modding/tutorials/tutorialSerialisation.html
BeE 2024 年 7 月 28 日 下午 1:58 
edit: i managed to get attachments to save

it's a different fix, now let me fix magazine types!
BeE 2024 年 7 月 28 日 下午 2:25 
fixed everything lol
baffomanners 2024 年 12 月 4 日 上午 9:36 
引用自 I am jo momma
fixed everything lol
I found out how to mess with steam
BeE 2024 年 12 月 12 日 上午 8:02 
引用自 deez nuts
I found out how to mess with steam
< >
正在显示第 1 - 5 条,共 5 条留言
每页显示数: 1530 50