fluffe9911 Posted June 3, 2015 Share Posted June 3, 2015 I find guns in crates sometimes Link to comment Share on other sites More sharing options...
Twister Posted June 3, 2015 Share Posted June 3, 2015 Hi guys, Yeah i know my account was created recently, but....Anyways. I love the severals mods who add more guns in the game, i've tested and played others weapons mods before found this one and then...THE BEST EVER GUNS MODS I SEE !!! Congratulation Sir OTR with your (hard, very hard ?) work for this one ! I LOVE IT ! So many guns, attachements...You have one more followers with you ! I encourage you to continue because I love it ! But i got two questions about this mod (dont worry about it) it's just...huh...questions 1) I saw the last post about the guns spawn in the containers, i didn't know if that weird but... I did not find any weapons in bedroom (even is that a small gun or a scope), and i saw no one in the crates, does this weapons spawn only in the police station and gun shop ? 2) I see in the announcement of OTR that some weapons have fire mode, i want to know how to change the fire mode in some shotguns and assaults rifles. And again "bravo !" for your awesome guns mods !Cordialy, Twister Link to comment Share on other sites More sharing options...
fluffe9911 Posted June 3, 2015 Share Posted June 3, 2015 1. Its very rare to find weapons in houses and semi rare in crates you can also very rarely find them on body's only guaranty is in police stations and gun shops 2. right click the gun and press the thing that says its current fire mode and it should change it may be wrong though Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 3, 2015 Author Share Posted June 3, 2015 Hi guys, Yeah i know my account was created recently, but....Anyways. I love the severals mods who add more guns in the game, i've tested and played others weapons mods before found this one and then...THE BEST EVER GUNS MODS I SEE !!! Congratulation Sir OTR with your (hard, very hard ?) work for this one ! I LOVE IT ! So many guns, attachements...You have one more followers with you ! I encourage you to continue because I love it ! But i got two questions about this mod (dont worry about it) it's just...huh...questions 1) I saw the last post about the guns spawn in the containers, i didn't know if that weird but... I did not find any weapons in bedroom (even is that a small gun or a scope), and i saw no one in the crates, does this weapons spawn only in the police station and gun shop ? 2) I see in the announcement of OTR that some weapons have fire mode, i want to know how to change the fire mode in some shotguns and assaults rifles. And again "bravo !" for your awesome guns mods !Cordialy, Twister Thank you! I am glad to bring another follower into the fold . I would say it was fairly hard work, but definitely worth it and I had a lot of help from the people here in the forums! I plan on doing much more for the mod, so stay tuned! As Fluffe said, it happens but it fairly rare, though, in the next release which hopefully should be soon will up the house spawn rate as I set it a bit too low. Fluffe also answered the second question, so there you go 1. Its very rare to find weapons in houses and semi rare in crates you can also very rarely find them on body's only guaranty is in police stations and gun shops 2. right click the gun and press the thing that says its current fire mode and it should change it may be wrong though Thank you, sir Fluffe! Link to comment Share on other sites More sharing options...
Twister Posted June 3, 2015 Share Posted June 3, 2015 OTR : No problem ! Did your mod is compatible with the Build 32, did you will also up the spawn rate in crates ? Fluffle : Thank for your answers ! Now i know how to change the firing mode yay !Does same for ammo and scope, sights... about the spawn rate ? Is there...(time to wait the next release) a quick way to increase a little (not dramatically) the chance of spawn rate in houses and crates ? PS : As a(n) question/suggestion : Did you will add ALICE backpacks ? Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 3, 2015 Author Share Posted June 3, 2015 OTR : No problem ! Did your mod is compatible with the Build 32, did you will also up the spawn rate in crates ? Fluffle : Thank for your answers ! Now i know how to change the firing mode yay !Does same for ammo and scope, sights... about the spawn rate ? Is there...(time to wait the next release) a quick way to increase a little (not dramatically) the chance of spawn rate in houses and crates ? PS : As a(n) question/suggestion : Did you will add ALICE backpacks ? Per some of the people on the thread it is, though I am not coding for build 32 yet so you will not be able to breakdown your ammo into gunpowder for pipe bombs. Yeah, they have about the same spawn rates. In ym folder if you go to media/lua/server/ORGMDistributions.luayou can open up that file and modify the drop rates there, but beware it is a mess of probability. It should be easy to understand but it is a lot to sift through. No to the backpacks. I am limiting scope bloat of my mod. By focusing on just guns and mechanics surrounding guns I ccan really bring out good things. If I start doing a little of everything, all aspects will suffer. Once I am "done" with my gun mod I might move onto other projects (or go into retirement lol). Plus there are plenty of mods (like hydrocraft or the more bags mod) that have ALICE packs. Link to comment Share on other sites More sharing options...
Twister Posted June 3, 2015 Share Posted June 3, 2015 Ok thank for your answer Yeah, I also use hydrocraft that i discovered recently, i just hope that this mod is compatible with your . But does your mod is compatible with NCYaw mod since i think he doesn't touch at ModelManager.class file. In ym folder if you go to media/lua/server/ORGMDistributions.luayou can open up that file and modify the drop rates there, but beware it is a mess of probability. It should be easy to understand but it is a lot to sift through. Where the drop rate in this script ? Im not very good at scriptDoes look that ? if rnd (10) < 8 then Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 3, 2015 Author Share Posted June 3, 2015 Ok thank for your answer Yeah, I also use hydrocraft that i discovered recently, i just hope that this mod is compatible with your . But does your mod is compatible with NCYaw mod since i think he doesn't touch at ModelManager.class file. In ym folder if you go to media/lua/server/ORGMDistributions.luayou can open up that file and modify the drop rates there, but beware it is a mess of probability. It should be easy to understand but it is a lot to sift through. Where the drop rate in this script ? Im not very good at scriptDoes look that ? if rnd (10) < 8 then Yeah, It is compatible with Hydrocraft (which I use, albiet an older version) though I am not familiar with the other, as long as it doesnt touch that file, it should be compatible. Yes that is how the probability is determines it does a random number and if the number fits inthe criteria, then the result happens, otherwise it moves on. Link to comment Share on other sites More sharing options...
Twister Posted June 3, 2015 Share Posted June 3, 2015 Ok thank again, so more the number is up, more the spawn rate is high ?If i need to edit : if rnd (10) < 8 , does i need to edit the red number or the blue number ?and finaly what does mean rnd ? Sorry for the questioning bomb , sometimes I think it's stronger than me Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 3, 2015 Author Share Posted June 3, 2015 Ok thank again, so more the number is up, more the spawn rate is high ?If i need to edit : if rnd (10) < 8 , does i need to edit the red number or the blue number ?and finaly what does mean rnd ? Sorry for the questioning bomb , sometimes I think it's stronger than me So the number in red is a random number between 1 and the number in red. The blue number is the comparison number so it is the one you should change to make it easier. So in that particular case it would generate a random number between 1 and 10. Then if the resulting number is less then 8 (so 1 through 7) it will return a true which then activates the code in that block. If the number is not less than 8 (so 8 through 10) then it will return a False and continue one without activating the code. Hope that helps, and keep asking questions if you have them Link to comment Share on other sites More sharing options...
Twister Posted June 3, 2015 Share Posted June 3, 2015 Thank ! I will study about that . Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 4, 2015 Author Share Posted June 4, 2015 Hey everyone, Little update, I draw ever closer to finishing the conversion scripting but due to time constraints from working full time and having a life (strange as that sounds) I am stopping tonight with still having issues. I will continue to work on it when I get home from work tomorrow, but between now and then I thought I would throw what I have worked up for everyone to look at and to point out how/where I have made mistakes. Below are the three scripts I threw together for this purpose. I am getting a severe null attempted index of a nil value on the ORGMUnloadAction:perform() part of the third script. I have an idea why but I did not have time to really run it down as I have to go to sleep for work tomorrow. Script 1: ORGMConversionMenu.luaORGMConversionMenu = {}ORGMConversionMenu.createMenu = function(player, context, items) local isConvertable = false; local playerObj = getSpecificPlayer(player) for i,v in ipairs(items) do local testItem = v; if not instanceof(v, "InventoryItem") then testItem = v.items[1]; testIndex = ORGMindexfinder(testItem, ConversionIndexTable); end if(testIndex ~= -1) then isConvertable = true; end end if isConvertable then local item = items[1]; if not instanceof(items[1], "InventoryItem") then item = items[1].items[1]; end ConvText = ConversionContextTable[testIndex] context:addOption(ConvText, items, ORGMConversionMenu.OnConvert, playerObj); endendORGMConversionMenu.OnConvert = function(items, player) local convItem = items[1]; if not instanceof(items[1], "InventoryItem") then convItem = items[1].items[1]; end ORGMConversions:startConvertFromUi(convItem);endEvents.OnFillInventoryObjectContextMenu.Add(ORGMConversionMenu.createMenu); Script 2 ORGMConversions.luaORGMConversions = {}function ORGMConversions:initialise()endfunction ORGMConversions:new(player) local o = {} setmetatable(o, self) self.__index = self o.convertAction = nil; o.convertableable = nil; o.playerid = player; o.lastClickTime = 0 return o;endfunction ORGMConversions:StartConvertfromUi(item) if(self:convertStarted() == false) then self.convertitem = item; self.convertindex = ORGMindexfinder(item, ConversionIndexTable); self.resultitem = ConversionWeaponTable[self.convertindex]; self:startConversion(); endendfunction ORGMConversions:startConversion() self.convertmoddata = self.convertitem:getModData(); remainingammo = self.convertmoddata.roundChambered + self.convertmoddata.currentCapacity; self.convertAction = ORGMConvertAction:new(self, player, player:getSquare(),1); self.chainUnload = ReloadUtil:getReloadableWeapon(self.convertitem, playerObj):isChainUnloading(); counter = remainingammo; if remainingammo == 0 then ISTimedActionQueue.add(self.convertAction) elseif(self.chainUnload == true) then ISTimedActionQueue.add(self.unloadAction) ISTimedActionQueue.add(self.convertAction) else while counter ~= 0 do ISTimedActionQueue.add(self.unloadAction) counter = counter - 1 end ISTimedActionQueue.add(self.convertAction) endendfunction ORGMindexfinder(key, list) for 1, obj in ipairs(list) do if obj == key then return i; end end return -1;end ConversionIndexTable = { "BenelliM3", "BenelliM3Sl", "BenelliM3SO", "BenelliM3SOSl", "BenelliM3PA", clipped the rest because it is long but it contains the rest of the convertible gun values }; ConversionWeaponTable = { "BenelliM3Sl", "BenelliM3", "BenelliM3SOSl", "BenelliM3SO", "BenelliM3PASL", clipped the rest because it is long but it contains the rest of the resulting gun values }; ConversionContextTable = { "Use for 12 gauge Slugs", "Use for 00 12 gauge Buck", "Use for 12 gauge Slugs", "Use for 00 12 gauge Buck", "Use for 12 gauge Slugs", clipped the rest because it is long but it contains the rest of the strings for the menu }; Script 3 (where the issue currently lies) ORGMConvertAction.luarequire "TimedActions/ISBaseTimedAction"ORGMConvertAction = ISBaseTimedAction:derive("ORGMConvertAction")function ORGMConvertAction:new(convertManager, char, square, time) local o = {} setmetatable(o, self) self.__index = self o.character = char o.stopOnWalk = false o.stopOnRun = true o.maxTime = time o.square = square o.mgr = convertManager o.convertitem = convertManager.convertitem o.resultitem = convertManager.resultitem return o;endfunction ORGMUnloadAction:perform() self.ConvertData = convertitem:getModData(); self.ResultData = resultitem:getModData(); self.ResultData.containsClip = self.ConvertData.containsClip; resultitem:setCondition(convertitem:getCondition()); resultitem:attachWeaponPart(convertitem:getScope()) resultitem:attachWeaponPart(convertitem:getClip()) resultitem:attachWeaponPart(convertitem:getSling()) resultitem:attachWeaponPart(convertitem:getCanon()) resultitem:attachWeaponPart(convertitem:getStock()) resultitem:attachWeaponPart(convertitem:getRecoilpad()) char:getInventory():Remove(convertitem); char:getInventory():AddItem(resultitem);end Anyway, as I said, I will get to it after work, but if any of you want to make my life easier... and get the next version released sooner... :mrgreen: just sayin Jab 1 Link to comment Share on other sites More sharing options...
Twister Posted June 4, 2015 Share Posted June 4, 2015 Hey, So i tried to study/understand about editing spawn rate...But i really don't understand, so many number in this file lol im started to be crazy ^^. May i guess to wait for the next release EDIT : I tried again, and finaly i started to understand a little about the mess of probability and spawn rate But i just go one question : So does the number result of a % of chance of spawning ? I mean in a exemple :if rnd (10) < 5 , so 5 is 50% chance of spawn rate ? Link to comment Share on other sites More sharing options...
EngineOfDarkness Posted June 4, 2015 Share Posted June 4, 2015 Aren't you missing self. for a lot of variable accesses in the perform method? Also you access "char" in the last two lines in perform() but char is only a parameter of new() which is assigned to o.character so I guess accessing char in perform() wont work either? Then again I might be talking crap, I don't really do any developing in LUArequire "TimedActions/ISBaseTimedAction"ORGMConvertAction = ISBaseTimedAction:derive("ORGMConvertAction")function ORGMConvertAction:new(convertManager, char, square, time) local o = {} setmetatable(o, self) self.__index = self o.character = char o.stopOnWalk = false o.stopOnRun = true o.maxTime = time o.square = square o.mgr = convertManager o.convertitem = convertManager.convertitem o.resultitem = convertManager.resultitem return o;endfunction ORGMUnloadAction:perform() self.ConvertData = self.convertitem:getModData(); self.ResultData = self.resultitem:getModData(); self.ResultData.containsClip = self.ConvertData.containsClip; self.resultitem:setCondition(self.convertitem:getCondition()); self.resultitem:attachWeaponPart(self.convertitem:getScope()) self.resultitem:attachWeaponPart(self.convertitem:getClip()) self.resultitem:attachWeaponPart(self.convertitem:getSling()) self.resultitem:attachWeaponPart(self.convertitem:getCanon()) self.resultitem:attachWeaponPart(self.convertitem:getStock()) self.resultitem:attachWeaponPart(self.convertitem:getRecoilpad()) self.character:getInventory():Remove(self.convertitem); self.character:getInventory():AddItem(self.resultitem);end Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 4, 2015 Author Share Posted June 4, 2015 Hey, So i tried to study/understand about editing spawn rate...But i really don't understand, so many number in this file lol im started to be crazy ^^. May i guess to wait for the next release EDIT : I tried again, and finaly i started to understand a little about the mess of probability and spawn rate But i just go one question : So does the number result of a % of chance of spawning ? I mean in a exemple :if rnd (10) < 5 , so 5 is 50% chance of spawn rate ? You have to think about the numbers that qualify to determine the spawn rate. so, in that particular case, since the criteria is <5 the numbers that qualify are 1 through 4. So, it would be 40% Aren't you missing self. for a lot of variable accesses in the perform method? Also you access "char" in the last two lines in perform() but char is only a parameter of new() which is assigned to o.character so I guess accessing char in perform() wont work either? Then again I might be talking crap, I don't really do any developing in LUArequire "TimedActions/ISBaseTimedAction"ORGMConvertAction = ISBaseTimedAction:derive("ORGMConvertAction")function ORGMConvertAction:new(convertManager, char, square, time) local o = {} setmetatable(o, self) self.__index = self o.character = char o.stopOnWalk = false o.stopOnRun = true o.maxTime = time o.square = square o.mgr = convertManager o.convertitem = convertManager.convertitem o.resultitem = convertManager.resultitem return o;endfunction ORGMUnloadAction:perform() self.ConvertData = self.convertitem:getModData(); self.ResultData = self.resultitem:getModData(); self.ResultData.containsClip = self.ConvertData.containsClip; self.resultitem:setCondition(self.convertitem:getCondition()); self.resultitem:attachWeaponPart(self.convertitem:getScope()) self.resultitem:attachWeaponPart(self.convertitem:getClip()) self.resultitem:attachWeaponPart(self.convertitem:getSling()) self.resultitem:attachWeaponPart(self.convertitem:getCanon()) self.resultitem:attachWeaponPart(self.convertitem:getStock()) self.resultitem:attachWeaponPart(self.convertitem:getRecoilpad()) self.character:getInventory():Remove(self.convertitem); self.character:getInventory():AddItem(self.resultitem);end You might be on to something, I am mostly a layman for coding (I am just good at faking my ability ) on the subject of char, if you look at the function line for the new, char is brought in from the script that starts it. I had assumed that it would work for the entire script once pulled in but you might be right. I will fiddle around with that after work. Link to comment Share on other sites More sharing options...
Fuji Posted June 4, 2015 Share Posted June 4, 2015 Hey,So i tried to study/understand about editing spawn rate...But i really don't understand, so many number in this file lol im started to be crazy ^^. May i guess to wait for the next release EDIT : I tried again, and finaly i started to understand a little about the mess of probability and spawn rate But i just go one question :So does the number result of a % of chance of spawning ? I mean in a exemple :if rnd (10) < 5 , so 5 is 50% chance of spawn rate ?You have to think about the numbers that qualify to determine the spawn rate. so, in that particular case, since the criteria is <5 the numbers that qualify are 1 through 4. So, it would be 40%Aren't you missing self. for a lot of variable accesses in the perform method?Also you access "char" in the last two lines in perform() but char is only a parameter of new() which is assigned to o.character so I guess accessing char in perform() wont work either?Then again I might be talking crap, I don't really do any developing in LUArequire "TimedActions/ISBaseTimedAction"ORGMConvertAction = ISBaseTimedAction:derive("ORGMConvertAction")function ORGMConvertAction:new(convertManager, char, square, time) local o = {} setmetatable(o, self) self.__index = self o.character = char o.stopOnWalk = false o.stopOnRun = true o.maxTime = time o.square = square o.mgr = convertManager o.convertitem = convertManager.convertitem o.resultitem = convertManager.resultitem return o;endfunction ORGMUnloadAction:perform() self.ConvertData = self.convertitem:getModData(); self.ResultData = self.resultitem:getModData(); self.ResultData.containsClip = self.ConvertData.containsClip; self.resultitem:setCondition(self.convertitem:getCondition()); self.resultitem:attachWeaponPart(self.convertitem:getScope()) self.resultitem:attachWeaponPart(self.convertitem:getClip()) self.resultitem:attachWeaponPart(self.convertitem:getSling()) self.resultitem:attachWeaponPart(self.convertitem:getCanon()) self.resultitem:attachWeaponPart(self.convertitem:getStock()) self.resultitem:attachWeaponPart(self.convertitem:getRecoilpad()) self.character:getInventory():Remove(self.convertitem); self.character:getInventory():AddItem(self.resultitem);endYou might be on to something, I am mostly a layman for coding (I am just good at faking my ability ) on the subject of char, if you look at the function line for the new, char is brought in from the script that starts it. I had assumed that it would work for the entire script once pulled in but you might be right. I will fiddle around with that after work.Self shouldn't go there, that's only for calling class fields. You're just trying to add attachments to a gun that doesn't exist yet.Also, in the finder... That 1 should be an i. ORMtnMan and EngineOfDarkness 2 Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 4, 2015 Author Share Posted June 4, 2015 Hey,So i tried to study/understand about editing spawn rate...But i really don't understand, so many number in this file lol im started to be crazy ^^. May i guess to wait for the next release EDIT : I tried again, and finaly i started to understand a little about the mess of probability and spawn rate But i just go one question :So does the number result of a % of chance of spawning ? I mean in a exemple :if rnd (10) < 5 , so 5 is 50% chance of spawn rate ?You have to think about the numbers that qualify to determine the spawn rate. so, in that particular case, since the criteria is <5 the numbers that qualify are 1 through 4. So, it would be 40%Aren't you missing self. for a lot of variable accesses in the perform method?Also you access "char" in the last two lines in perform() but char is only a parameter of new() which is assigned to o.character so I guess accessing char in perform() wont work either?Then again I might be talking crap, I don't really do any developing in LUArequire "TimedActions/ISBaseTimedAction"ORGMConvertAction = ISBaseTimedAction:derive("ORGMConvertAction")function ORGMConvertAction:new(convertManager, char, square, time) local o = {} setmetatable(o, self) self.__index = self o.character = char o.stopOnWalk = false o.stopOnRun = true o.maxTime = time o.square = square o.mgr = convertManager o.convertitem = convertManager.convertitem o.resultitem = convertManager.resultitem return o;endfunction ORGMUnloadAction:perform() self.ConvertData = self.convertitem:getModData(); self.ResultData = self.resultitem:getModData(); self.ResultData.containsClip = self.ConvertData.containsClip; self.resultitem:setCondition(self.convertitem:getCondition()); self.resultitem:attachWeaponPart(self.convertitem:getScope()) self.resultitem:attachWeaponPart(self.convertitem:getClip()) self.resultitem:attachWeaponPart(self.convertitem:getSling()) self.resultitem:attachWeaponPart(self.convertitem:getCanon()) self.resultitem:attachWeaponPart(self.convertitem:getStock()) self.resultitem:attachWeaponPart(self.convertitem:getRecoilpad()) self.character:getInventory():Remove(self.convertitem); self.character:getInventory():AddItem(self.resultitem);endYou might be on to something, I am mostly a layman for coding (I am just good at faking my ability ) on the subject of char, if you look at the function line for the new, char is brought in from the script that starts it. I had assumed that it would work for the entire script once pulled in but you might be right. I will fiddle around with that after work.Self shouldn't go there, that's only for calling class fields. You're just trying to add attachments to a gun that doesn't exist yet.Also, in the finder... That 1 should be an i. Even though the gun doesn't exist yet, I am correct in assuming it will copy over the modData right? Link to comment Share on other sites More sharing options...
GothicGhost Posted June 4, 2015 Share Posted June 4, 2015 Nice mod and sorry for the noob question but how do I add this to my server and do clients need to download it as well? Thank you for any help. Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 4, 2015 Author Share Posted June 4, 2015 Nice mod and sorry for the noob question but how do I add this to my server and do clients need to download it as well? Thank you for any help. I don't play online but I believe when you host it is on the server and everyone else will be required to download it as well. Someone else may correct me though, Link to comment Share on other sites More sharing options...
GothicGhost Posted June 4, 2015 Share Posted June 4, 2015 Thank you. I am testing it now and forgot to add the mod to my own client and nothing showing up yet in game so I think everyone needs it or I am just unlucky lol. Link to comment Share on other sites More sharing options...
Fuji Posted June 4, 2015 Share Posted June 4, 2015 The gun is created when its added to your inventory, but you still have to search through the players inventory and then add the attachments to THAT.When you add "ORGM.whatever" to the players inventory, that text isn't the gun. That just tells java to look for an item with that name and add it. Link to comment Share on other sites More sharing options...
GothicGhost Posted June 4, 2015 Share Posted June 4, 2015 Well seems to be working and for testing I spawned myself at the shooting range. I seem to have Infinity ammo bug not sure how to fix that yet.And had lots of ammo but only about 3 guns normal? not sure. Thanks. Link to comment Share on other sites More sharing options...
ORMtnMan Posted June 5, 2015 Author Share Posted June 5, 2015 Okay, getting closer here's where I am at: ORGMConversions = {}function ORGMConversions:initialise()endfunction ORGMConversions:new(player) local o = {} setmetatable(o, self) self.__index = self o.convertAction = nil; o.convertableable = nil; o.playerid = player; o.lastClickTime = 0 return o;endfunction ORGMConversions:StartConvertfromUi(item) self.convertitem = item; self.convertindex = ORGMConversions:ORGMindexfinder(item, ConversionIndexTable); self.resultitem = ConversionWeaponTable[self.convertindex]; self:startConversion();endfunction ORGMConversions:startConversion() self.convertmoddata = self.convertitem:getModData(); remainingammo = self.convertmoddata.roundChambered + self.convertmoddata.currentCapacity; self.convertAction = ORGMConvertAction:new(self, getPlayer(),1); self.chainUnload = ReloadUtil:getReloadableWeapon(self.convertitem, getPlayer()):isChainUnloading(); counter = remainingammo; if remainingammo == 0 then ISTimedActionQueue.add(self.convertAction) elseif(self.chainUnload == true) then ISTimedActionQueue.add(self.unloadAction) ISTimedActionQueue.add(self.convertAction) else while counter ~= 0 do ISTimedActionQueue.add(self.unloadAction) counter = counter - 1 end ISTimedActionQueue.add(self.convertAction) endendfunction ORGMConversions:ORGMindexfinder(key, list) for i, obj in ipairs(list) do if obj == key then return i; end end return -1;end ORGMConversionMenu = {}ORGMConversionMenu.createMenu = function(player, context, items) local isConvertable = false; local playerObj = getSpecificPlayer(player) for i,v in ipairs(items) do local testItem = v; if not instanceof(v, "InventoryItem") then testItem = v.items[1]; testType = testItem:getType() testIndex = ORGMConversions:ORGMindexfinder(testType, ConversionIndexTable); end if(testIndex ~= -1) then isConvertable = true; end end if isConvertable then local item = items[1]; if not instanceof(items[1], "InventoryItem") then item = items[1].items[1]; end ConvText = ConversionContextTable[testIndex] context:addOption(ConvText, items, ORGMConversionMenu.OnConvert, playerObj); endendORGMConversionMenu.OnConvert = function(items, player) local convItem = items[1]; if not instanceof(items[1], "InventoryItem") then convItem = items[1].items[1]; end ORGMConversions:StartConvertfromUi(convItem);endEvents.OnFillInventoryObjectContextMenu.Add(ORGMConversionMenu.createMenu); require "TimedActions/ISBaseTimedAction"ORGMConvertAction = ISBaseTimedAction:derive("ORGMConvertAction")function ORGMConvertAction:perform() ConvertData = convertitem:getModData(); getSpecificPlayer():getInventory():Remove(convertitem); getSpecificPlayer():getInventory():AddItem(resultitem); AddedItem = getSpecificPlayer():getInventory():FindAndReturn(resultitem); AddedItem:getModData().containsClip = ConvertData.containsClip; AddedItem:getModData():setCondition(convertitem:getCondition()); AddedItem:getModData():attachWeaponPart(convertitem:getScope()) AddedItem:getModData():attachWeaponPart(convertitem:getClip()) AddedItem:getModData():attachWeaponPart(convertitem:getSling()) AddedItem:getModData():attachWeaponPart(convertitem:getCanon()) AddedItem:getModData():attachWeaponPart(convertitem:getStock()) AddedItem:getModData():attachWeaponPart(convertitem:getRecoilpad())endfunction ORGMConvertAction:new(convertManager, char, time) local o = {} setmetatable(o, self) self.__index = self o.character = char o.stopOnWalk = false o.stopOnRun = true o.maxTime = time o.mgr = convertManager o.convertitem = convertManager.convertitem o.resultitem = convertManager.resultitem return o;end Link to comment Share on other sites More sharing options...
PZ-NOOB Posted June 5, 2015 Share Posted June 5, 2015 Looking good ORMtnMan Link to comment Share on other sites More sharing options...
Twister Posted June 5, 2015 Share Posted June 5, 2015 Hi guys, im doing better with spawn rate Thank to OTR for his explanation.Just one thing i noticed : Why the guns, ammo and attachment only spawn in the storage room and not in the warehouse ?We could do spawn a bit in the warehouse and a bit in the storage room no ? And i tested the guns at some zombie, so the shooting skill affect the chance to hit isn't ?I choose policemen for jobs (so 3 shoot and 1 reload), got a mosin nagant and sometime i think is hard to hit the zombie, even if i take time to do a great shoot lol. Cordialy,Twister Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now