Project Zomboid

Project Zomboid

AA^2's Fjord Mustang Nikke Skin
Spawning Issues, different spawn list code?
I've had issues getting this and the original mustang to spawn, after looking through spawnlists of multiple mods, i've noticed that only this mod and the mustang it depends on, uses a different code in spawnlist file.
It starts with:

VehicleZoneDistribution = VehicleZoneDistribution or {};

I've changed this starting statement to:

if VehicleZoneDistribution then

and finished it with

end

to mirror all other vehicle mods, both on this one and the original, now vehicles are fixed and spawning.

even more research brought me to tsarlib, which uses that code.

in conclusion if you have issues with some vehicle spawning you can apparently change the spawnlist code to get them to spawn with the vanilla code and go around tsarlib's spawnlists i suppose? But you will probably need to lower the spawn chance a lot, or it will be everywhere. This is mostly useful for servers that have issues with certain vehicles not spawning.
Ultima modifica da Consigned to Oblivion; 19 mag 2024, ore 8:46
< >
Visualizzazione di 1-10 commenti su 10
AA^2  [sviluppatore] 19 mag 2024, ore 9:23 
Thank you for helping me improve my code.

What you are trying to say is that there is currently an issue with other mod vehicles not being generated correctly?


if VehicleZoneDistribution then
VehicleZoneDistribution.parkingstall.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 10};
VehicleZoneDistribution.medium.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 10};
VehicleZoneDistribution.good.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 10};
VehicleZoneDistribution.sport.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 10};
else
VehicleZoneDistribution = {};
end

For example, modify it like this?
AA^2  [sviluppatore] 19 mag 2024, ore 10:28 
And "spawnChance = 10", in my understanding, means that there are about 10 cars spawned for every 100 parking spaces, which is 10%.
Is my perception wrong?
Messaggio originale di AA^2:
And "spawnChance = 10", in my understanding, means that there are about 10 cars spawned for every 100 parking spaces, which is 10%.
Is my perception wrong?
seems to be somewhat but not entirely right, though every 30th something car seems to be a nikke car with the standard 10 chance, every vanilla start i can find a nikke car within the first 2 or 3 cars usually, might also be skewed because of tsar's own spawning areas adding their own cars, but in vanilla at least the chance is way too high.
Alright I tested it vanilla, with a chance of 2, there was only 1 nikke car in muldraugh, and 1 outside at a gas station.
For the code part, that is the basic code for standalone cars being added, rather than an improvement it is a compatibility issue, if you have a server with tons of mods, it's inevitable something will break, and more often than not you end up with vehicles that won't spawn (replicated in single player as well). I wouldn't use this as a replacement, but if you could make it a second file like "Nikke cars-compatibility" that uses vanilla spawn zones, but retains the tsar vehicle modding. Also do not take my word for it, my modding experience in lua is mostly in the tropico games and rimworld. The mod as is worked well until something broke it, which I suspect is related to the spawn zones given through tsarlib.
My file currently is like this, which is copied from FR's vehicles and other KI5 vehicle mods, basic but compatible:
---------------------------------------------------------------------------------------------------

if VehicleZoneDistribution then

VehicleZoneDistribution.parkingstall.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 2};
VehicleZoneDistribution.medium.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 2};
VehicleZoneDistribution.good.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 2};
VehicleZoneDistribution.sport.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 2};

end

---------------------------------------------------------------------------------------------------
all this code should do is use the vanilla spawn areas like most other standalone vehicle mods, while not touching anything else, leaves the vehicle modding from tsar.
I would also suggest you ask more experienced modders.

also this is an example code from a KI5 mod, it seems that KI5 mods have no issue working with vanilla spawnzones:
---------------------------------------------------------------------------------------------------


if VehicleZoneDistribution then

VehicleZoneDistribution.parkingstall.vehicles["Base.91range"] = {index = -1, spawnChance = 2};
VehicleZoneDistribution.parkingstall.vehicles["Base.91range2"] = {index = -1, spawnChance = 2};

VehicleZoneDistribution.trailerpark.vehicles["Base.91range"] = {index = -1, spawnChance = 1};
VehicleZoneDistribution.trailerpark.vehicles["Base.91range2"] = {index = -1, spawnChance = 2};

VehicleZoneDistribution.medium.vehicles["Base.91range"] = {index = -1, spawnChance = 2};
VehicleZoneDistribution.medium.vehicles["Base.91range2"] = {index = -1, spawnChance = 2};

VehicleZoneDistribution.good.vehicles["Base.91range"] = {index = -1, spawnChance = 4};
VehicleZoneDistribution.good.vehicles["Base.91range2"] = {index = -1, spawnChance = 4};

VehicleZoneDistribution.junkyard.vehicles["Base.91range"] = {index = -1, spawnChance = 1};
VehicleZoneDistribution.junkyard.vehicles["Base.91range2"] = {index = -1, spawnChance = 1};

VehicleZoneDistribution.trafficjams.vehicles["Base.91range"] = {index = -1, spawnChance = 1};
VehicleZoneDistribution.trafficjams.vehicles["Base.91range2"] = {index = -1, spawnChance = 2};

end

---------------------------------------------------------------------------------------------------
Ultima modifica da Consigned to Oblivion; 19 mag 2024, ore 11:35
AA^2  [sviluppatore] 19 mag 2024, ore 20:22 
Okay. I'll update it for the next version.

There is only 1 vehicle found in muldraugh... , which is too little for a multiplayer server, not to mention that there are 42 skins now, but I'll add a low-generation version for players to choose from.

Also I found it almost impossible to find Nikke cars in Raven Creek, I decided to add traffic jams and crashes to combat this, after all it's very frustrating to not be able to find them in such a large city.

The main additions are the low-spawning version and the areas where traffic jams and crashes are spawned.

Used in the same way as the original version.

Here's the low-generation version (SpawnChancex0.5):

---------------------------------------------------------------------------------------------------

if VehicleZoneDistribution then

-- Parking Stall, common parking stall with random cars, the most used one (shop parking lots, houses etc.)
VehicleZoneDistribution.parkingstall.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 5};

-- medium vehicles, used in some of the good looking area, or in suburbs
VehicleZoneDistribution.medium.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 5};

-- good vehicles, used in good looking area, they're meant to spawn only good cars, so they're on every good looking house.
VehicleZoneDistribution.good.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 5};

-- sports vehicles, sometimes on good looking area.
VehicleZoneDistribution.sport.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 5};

-- junkyard, spawn damaged & burnt vehicles, less chance of finding keys but more cars.
-- also used for the random car crash.
VehicleZoneDistribution.junkyard.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 1.5};

-- Traffic jams by cardinal direction, mostly burnt car & damaged ones.
-- Used either for hard coded big traffic jam or smaller random ones.
VehicleZoneDistribution.trafficjame.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 1.5};
VehicleZoneDistribution.trafficjamw.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 1.5};
VehicleZoneDistribution.trafficjams.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 1.5};
VehicleZoneDistribution.trafficjamn.vehicles["Base.ATAMustangNikke"] = {index = -1, spawnChance = 1.5};

end
---------------------------------------------------------------------------------------------------
Interestingly enough the issue mainly started appearing when I played with ConsignedToOblivion in Multiplayer. The mod was guaranteed loaded and worked on single player, just like it did on his system. However not a single spawn in the multiplayer instance. It appears it does some wonky stuff with TSAR lib. I flew with quickspeed through the entirety of louisville to confirm not a single one spawned, not even the base mustang, which results in some interesting questions.
AA^2  [sviluppatore] 20 mag 2024, ore 10:12 
OK. Thank you both for reporting this issue and helping me fix the code.
I apologize that all my tests were only in single player mode.
I would like to reconfirm if the new spawn code fixed the problem?
Messaggio originale di AA^2:
OK. Thank you both for reporting this issue and helping me fix the code.
I apologize that all my tests were only in single player mode.
I would like to reconfirm if the new spawn code fixed the problem?
we'll be trying it again on the server this evening
Tested it on a server with 400+ mods and works as intended for a compatibility version.
Ultima modifica da Consigned to Oblivion; 20 mag 2024, ore 13:40
AA^2  [sviluppatore] 20 mag 2024, ore 20:47 
Messaggio originale di Consigned to Oblivion:
Tested it on a server with 400+ mods and works as intended for a compatibility version.
Thank you and have a great time both of you
Thank You for Your efforts, NIKKE content is pretty rare to come by.
xièxie~
< >
Visualizzazione di 1-10 commenti su 10
Per pagina: 1530 50