Jump to content

item distribution(yes another one:P)


Intrud3r

Recommended Posts

Sorry for opening another distribution sistem topic but can't find the answer anywhere :(

 

the question is simple

 

given that i create a new pistol item and i copy the original laser/reddot(adding the new weapon to the attachable) in a separate file like newitems2.txt

i can add the weapon with no issues to the suburbsdistribution with:

table.insert(SuburbsDistributions["Kitchen"]["counter"].items, "newitem");table.insert(SuburbsDistributions["Kitchen"]["counter"].items, 5);

is there a way to change the weapon upgrades laser/reddot from base.reddot to new.reddot for the original weapons too? i mean the final part of the suburbsdistribution.lua file

 

if i copy the original suburbsdistribution.lua to the mod folder and add the intems there can be solved ?(i mean the game will use the mod folder or the default/game file?)

 

I hope the question is clear i'm really bad in english;)

 

thanks in advance

 

Link to comment
Share on other sites

Sorry for opening another distribution sistem topic but can't find the answer anywhere :(

 

the question is simple

 

given that i create a new pistol item and i copy the original laser/reddot(adding the new weapon to the attachable) in a separate file like newitems2.txt

i can add the weapon with no issues to the suburbsdistribution with:

table.insert(SuburbsDistributions["Kitchen"]["counter"].items, "newitem");table.insert(SuburbsDistributions["Kitchen"]["counter"].items, 5);

is there a way to change the weapon upgrades laser/reddot from base.reddot to new.reddot for the original weapons too? i mean the final part of the suburbsdistribution.lua file

 

if i copy the original suburbsdistribution.lua to the mod folder and add the intems there can be solved ?(i mean the game will use the mod folder or the default/game file?)

 

I hope the question is clear i'm really bad in english;)

 

thanks in advance

 

If you want to substitute a base version of an item mod version, you have to remove it from the distributions.

 

I don't know how to do it off the top of my head (I am at work) but I know the Real Kentucky Fireamrs does this, so you could use it as a reference for that.

 

Try to refrain from overriding base files as anytime there is an update it could cause major problems for your mod.

Link to comment
Share on other sites

didn't find what i'm searching for :(

no clue on how to change the values in WeaponUpgrades

FROMWeaponUpgrades = {Pistol = {"Base.Laser", "Base.RedDot", "Base.IronSight"}};TOWeaponUpgrades = {Pistol = {"tetsingmod.Laser", "testingmod.RedDot", "testingmod.IronSight"}};

it's probably super simple but iìm going mad

 

edit 2:

 

Solved :)(already tested work perfectly)

require "Items/SuburbsDistributions"if WeaponUpgrades.Pistol ~= nil then        local k=1;        while k <= #WeaponUpgrades.Pistol do            if WeaponUpgrades.Pistol[k] == "Base.Laser" then                table.remove(WeaponUpgrades.Pistol,k);                        elseif WeaponUpgrades.Pistol[k] == "Base.IronSight" then                table.remove(WeaponUpgrades.Pistol, k);                    elseif WeaponUpgrades .Pistol[k] == "Base.RedDot" then                table.remove(WeaponUpgrades.Pistol, k);                        else                                    k = k + 1;               endendendtable.insert(WeaponUpgrades.Pistol,"testingmod.Laser");table.insert(WeaponUpgrades.Pistol,"testingmod.RedDot");table.insert(WeaponUpgrades.Pistol,"testingmod.IronSight");
Link to comment
Share on other sites

I would think that 

WeaponUpgrades.Pistol = {"testingmod.Laser","testingmod.RedDot","testingmod.IronSight"};

 would work. Odd.

 

Something like this might work and be slightly more concise:

local Pistol = WeaponUpgrades.Pistol;for i = 1, #Pistol do   if Pistol[i] == "Base.Laser" then     Pistol[i] = "testingmod.Laser";  elseif Pistol[i] == "Base.IronSight" then     Pistol[i] = "testingmod.IronSight";  elseif Pistol[i] == "Base.RedDot" then     Pistol[i] = "testingmod.RedDot";  endend
Link to comment
Share on other sites

your solution is easier i like it :)

now i have to find a way to add the new weapons to the same table but it's harder than exepected

 

 

edit

ok found the solution for adding a new table into WeponUpgrade and modifing an entire existing table in one move :)

//have to test if work ingame(on virtual lua consolle works as planned)edit 3 //WORKS :)WeaponUpgrades["NewPistol"]={"tetsingmod.Laser", "testingmod.RedDot", "testingmod.IronSight"}//could be used to rapidly change the original pistol values (works perfectly on lua test console)WeaponUpgrades["Pistol"]={"tetsingmod.Laser", "testingmod.RedDot", "testingmod.IronSight"}edit 3 //WORKS (in my previous tests i had mispelled some parts)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...