Jump to content

Izeick

Member
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Izeick's Achievements

  1. So, 1:1 copy of bleach works fine. However, displaycategory doesn't matter in this issue Trouble shows up, when I add "IsCookable = TRUE," line Mb pz cant define cookable item as poison?
  2. Hi Hugo! Whats about swapping to Base.Bleach - that works, poison scull shows up. Whats about poison detection level, extract from pz wiki: I tried on "0" and "10" lvl with zero cooking level, and this did not give results. Still thinking about this
  3. Izeick

    Send message in chat

    Try to use media/lua/shared/Translate/RU/IG_UI_RU.txt file to encode cyrillic localization. Create 31 line with cyrillic symbols and then use them for lua. F.e, IGUI_F = "ะค",
  4. Good time of day, faced with one problem when modding I added one item that has a poison flag. However, if I craft it, it does not show its poisonous properties. But if I add it via the console, then everything is fine. What can it be related to? Does anyone know? As always, code is pasted below items.txt item poisbottle { DisplayName = poisbottle, DisplayCategory = Poison, Type = Food, CustomContextMenu = Drink, ReplaceOnUse = Base.BottleEmpty, Poison = true, PoisonDetectionLevel = 7, PoisonPower = 150, UseForPoison = 35, Weight = 1, Icon = poisbottle, CookingSound = BoilingFood, IsCookable = TRUE, UseWhileEquipped = FALSE, WorldStaticModel = poisbottle, MinutesToCook = 60, ReplaceOnCooked = POIS.poisbottle2, Tooltip = Tooltip_PoisBottle } recipes.txt recipe cook poison { Base.BottleEmpty, POIS.comp1, POIS.comp2, keep Base.Spoon, Result: POIS.poisbottle, Time: 200, Category: Poison, }
  5. For the future, if you have figured out the problem, it is advisable to explain how, because other users viewing this topic will not understand anything So, In the line "OnCreate:" you must specify the function that you have registered in the .lua. F.e, OnCreate: Recipe1Function, To delete an item, the .lua function itself looks like this: function Recipe1Function (items, result, player) player:getInventory():Remove("MODULE.ITEMNAME") end
  6. And that's it, I figured it out. Tnx u so much! Again.
  7. Okay, but what about ":isEquipped()" syntax? player:item:isequiped? Or hazmatItem:isequiped?
  8. Okay, in this case how can I access the elements of the Item class that I create in .txt if all I give them is a name like "CI141.KRNDHazmat". Do these items have their own IDs to call? If so, how to get them? F.e. what is the lua-id of my item CI141.KRNDHazmat?
  9. While coding my mod I faced with another problem. I'm trying to make a character say a phrase when dressing a certain item. I tried to implement this with Events.OnClothingUpdated.Add(). When this event was called, it was checked whether this item (CI141.KRNDHazmat) was dressed. I did this through a method getBodyLocation() ~= "". But every time it gave an error. I suspect that the problem is that item CI141.KRNDHazmat belongs to a different class, but getBodyLocation() method belongs to the class Clothes. But no matter how hard I tried, I couldn't determine the class of the object CI141.KRNDHazmat. I need help from someone who understands. I paste code below. Script [media/scripts/CI141_items.txt] item KRNDHazmat { DisplayCategory = Clothing, Type = Clothing, DisplayName = KRND Hazmat Suit, ClothingItem = CI141_KRNDHazmat, BodyLocation = FullSuitHead, Icon = KRNDHazmat, BloodLocation = Trousers;Jumper, Icon = Hazmatsuit, RunSpeedModifier = 0.75, ScratchDefense = 25, BiteDefense = 25, Insulation = 0.65, WindResistance = 0.9, WorldStaticModel = Hazmat_Ground, } the .xml file works fine, so I don't see the point in attaching it here LUA [media/lua/client/CI141_maincore.lua] function HazmatvoiceFc(player) local hazmat = "CI141.KRNDHazmat" if player:getInventory():contains(hazmat) then if hazmat:getBodyLocation() ~= nil then <- Error comes from this line player:Say("TESTPHRASE") end end end Events.OnClothingUpdated.Add(HazmatvoiceFc)
  10. Oh, yes, it fixed everything. Thank you very much
  11. Hi everyone. I spent two nights trying to solve a problem with my mod. I wanna create a bag that can be filled with money. I was able to write part of money taking out code, but filling is too hard for me. At the bottom I paste my current code. At the moment, when I try to fill the bag by one unit (500$ is 1 unit; 5000$ is max), it is immediately filled completely. Please help who understands [LUA] media/lua/server/moneybag.lua function Recipe.OnCreate.moneyin(items, result, player) for i=0, items:size()-1 do if items:get(i):getType() == "PERCOM.moneybag" then if items:get(i):getUsedDelta() == 0 then result:setUsedDelta(0.1) else result:setUsedDelta(items:get(i):getUsedDelta() + 0.1) end end end end [SCRIPT] media/scripts/PERCOM_recipes.txt module PERCOM { imports { Base } item moneybag { Weight = 1.1, Type = Drainable, UseWhileEquipped = FALSE, DisappearOnUse = FALSE, UseDelta = 0.1, DisplayName = Moneybag, Icon = Moneybag, WeightEmpty = 0.1, } recipe put500dollars { destroy moneybag, Money = 500, Result: moneybag, Time: 1, Category: Money, CanBeDoneFromFloor: TRUE, OnCreate: Recipe.OnCreate.moneyin, } recipe take500dollars { PERCOM.moneybag = 1, Result: Money = 500, Time: 1, Category: Money, CanBeDoneFromFloor: TRUE, } }
×
×
  • Create New...