Logowanie Google+ Logowanie Rejestracja

Poszukujemy moderatorów, nie czekaj, złóż podanie już teraz: KLIK

Mod nie pojawia się po kupnie
#1
Dodałem do swojej mapy możliwość kupna psa. Tutaj wszystko działa. Kupuje psa u handlarza zwierzętami, on sobie chodzi po farmie, ale trzeba go karmić suchą karmą, którą trzeba kupić w sklepie. 
Więc  skopiowałem z innej mapy wszystkie linijki które według mnie mają coś wspólnego z dodaniem tego do mapy. 

Do folderu ze skryptami skopiowałem:
- addStoreCategory.lua ( z tego co zrozumiałem to on dodaje nową kategorię do sklepu )
- regFillTypes.lua ( a ten dodaje do mapy filltype tej suchej karmy )

Oczywiście skrypty podpiołem w pliku modDesc.
<sourceFile filename="scripts/regFillTypes.lua"/>
<sourceFile filename="scripts/addStoreCategory.lua"/>

Stworzyłem też folder store a do niego skopiowałem miniaturkę tej suchej karmy w sklepie i miniaturkę tej nowej kategori w sklepie. 

W hud/filltypes dodałem hudy tej suchej karmy.
W maps/objects/pallets jest plik i3d tej suchej karmy i inne pliki takie jak:
- bag_normal.dds
- bag_specular.dds
- dogFeed.i3d
- dogFeed.i3d.shapes
- dogFeed.xml
- dogFeedBag_diffuse

Tak wygląda ten plik dogFeed.i3d

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<object>
    <storeData>
        <name>$l10n_shopItem_dogFeed</name>
        <functions>
            <function>$l10n_function_dogFeed</function>
        </functions>
        <specs>
            <capacity>100</capacity>
            <fillTypes>dogFeed</fillTypes>
        </specs>
        <image>store/store_dogFeed.dds</image>
        <price>30</price>
        <dailyUpkeep>0</dailyUpkeep>
        <rotation>0</rotation>
        <brand>LIZARD</brand>
        <category>mapAdditionals</category>
        <species>object</species>
        <vertexBufferMemoryUsage>0</vertexBufferMemoryUsage>
        <indexBufferMemoryUsage>0</indexBufferMemoryUsage>
        <textureMemoryUsage>0</textureMemoryUsage>
        <instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
        <instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
    </storeData>

    <className>FillablePallet</className>
    <filename>maps/objects/pallets/dogFeed.i3d</filename>
    <size width="0.6" length="1" /> 
</object>

Do pliku modDesc skopiowałem:

<regFillTypes hudDirectoryFillTypes="hud/fillTypes" textureDirectoryFillPlanes="fillPlanes">
<fillType name="dogFeed"
categoryName="piece"
pricePerLiter="1.0"
massPerLiter="0.000001"
showOnPriceTable="false" 
createHeap="false" 
useToSpray="false" />   
</regFillTypes>

<storeItems>
<newCategories><newCategory name="mapAdditionals" previousCategory="tractors" imageFilename="store/category_mapAdditionals.dds" /> </newCategories>
<storeItem xmlFilename="maps/objects/pallets/dogFeed.xml"/>
</storeItems>

<!-- Shop Items / Vehicles -->
<text name="mapAdditionals"> <en>Map Additionals</en> </text>
<text name="function_dogFeed"> <en>dry food in a bag, is needed as basic food for your farm dog.</en> <pl>Sucha karma w opakowaniu, jest wymagana jako podstawowe jedzenie dla psa na farmie.</pl> </text>
<text name="shopItem_dogFeed"> <en>dry food</en> <pl>Sucha karma</pl> </text>

<text name="dogFeed"> <en>dry fodder</en> <pl>Sucha karma</pl> </text>

I chyba wszystko działa, bo ta nowa kategoria pojawia się w sklepie, a w niej pojawia się ta sucha karma. Ale gdy chce ją kupić to nie pojawia się przed sklepem.

Wyskakują takie błędy:

Error: failed to load i3d file 'maps/objects/pallets/dogFeed.i3d'
Warning (Script): Unknown entity id 0 in method 'getChildAt'.
LUA call stack:
  =dataS/scripts/objects/FillablePallet.lua (0) : getChildAt
  =dataS/scripts/objects/FillablePallet.lua (0) : createNode
  =dataS/scripts/BaseMission.lua (0) : load
  =dataS/scripts/shop/BuyObjectEvent.lua (0) : loadObjectAtPlace
  =dataS/scripts/network/Connection.lua (0) : run
  =dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
  =dataS/scripts/gui/elements/Gui.lua (0) : update
  =dataS/scripts/main.lua (0) : update
Warning (LUA): 'link': Argument 1 has wrong type. Expected: Int. Actual: Nil 
  ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:
  =dataS/scripts/objects/FillablePallet.lua (0) : link
  =dataS/scripts/objects/FillablePallet.lua (0) : createNode
  =dataS/scripts/BaseMission.lua (0) : load
  =dataS/scripts/shop/BuyObjectEvent.lua (0) : loadObjectAtPlace
  =dataS/scripts/network/Connection.lua (0) : run
  =dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
  =dataS/scripts/gui/elements/Gui.lua (0) : update
  =dataS/scripts/main.lua (0) : update
Warning (Script): Unknown entity id 0 in method 'delete'.
LUA call stack:
  =dataS/scripts/objects/FillablePallet.lua (0) : delete
  =dataS/scripts/objects/FillablePallet.lua (0) : createNode
  =dataS/scripts/BaseMission.lua (0) : load
  =dataS/scripts/shop/BuyObjectEvent.lua (0) : loadObjectAtPlace
  =dataS/scripts/network/Connection.lua (0) : run
  =dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
  =dataS/scripts/gui/elements/Gui.lua (0) : update
  =dataS/scripts/main.lua (0) : update
Warning (LUA): 'setRigidBodyType': Argument 1 has wrong type. Expected: Int. Actual: Nil 
  ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:
  =dataS/scripts/objects/PhysicsObject.lua (0) : setRigidBodyType
  =dataS/scripts/objects/MountableObject.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : createNode
  =dataS/scripts/BaseMission.lua (0) : load
  =dataS/scripts/shop/BuyObjectEvent.lua (0) : loadObjectAtPlace
  =dataS/scripts/network/Connection.lua (0) : run
  =dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
  =dataS/scripts/gui/elements/Gui.lua (0) : update
  =dataS/scripts/main.lua (0) : update
Warning (LUA): 'addToPhysics': Argument 1 has wrong type. Expected: Int. Actual: Nil 
  ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:
  =dataS/scripts/objects/PhysicsObject.lua (0) : addToPhysics
  =dataS/scripts/objects/MountableObject.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : createNode
  =dataS/scripts/BaseMission.lua (0) : load
  =dataS/scripts/shop/BuyObjectEvent.lua (0) : loadObjectAtPlace
  =dataS/scripts/network/Connection.lua (0) : run
  =dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
  =dataS/scripts/gui/elements/Gui.lua (0) : update
  =dataS/scripts/main.lua (0) : update
Warning (LUA): 'getTranslation': Argument 1 has wrong type. Expected: Int. Actual: Nil 
  ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:
  =dataS/scripts/objects/PhysicsObject.lua (0) : getTranslation
  =dataS/scripts/objects/MountableObject.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : createNode
  =dataS/scripts/BaseMission.lua (0) : load
  =dataS/scripts/shop/BuyObjectEvent.lua (0) : loadObjectAtPlace
  =dataS/scripts/network/Connection.lua (0) : run
  =dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
  =dataS/scripts/gui/elements/Gui.lua (0) : update
  =dataS/scripts/main.lua (0) : update
Warning (LUA): 'getRotation': Argument 1 has wrong type. Expected: Int. Actual: Nil 
  ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:
  =dataS/scripts/objects/PhysicsObject.lua (0) : getRotation
  =dataS/scripts/objects/MountableObject.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : createNode
  =dataS/scripts/BaseMission.lua (0) : load
  =dataS/scripts/shop/BuyObjectEvent.lua (0) : loadObjectAtPlace
  =dataS/scripts/network/Connection.lua (0) : run
  =dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
  =dataS/scripts/gui/elements/Gui.lua (0) : update
  =dataS/scripts/main.lua (0) : update
Warning (LUA): 'getNumOfChildren': Argument 1 has wrong type. Expected: Int. Actual: Nil 
  ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:
  =dataS/scripts/objects/PhysicsObject.lua (0) : getNumOfChildren
  =dataS/scripts/objects/PhysicsObject.lua (0) : addChildsToNodeObject
  =dataS/scripts/objects/MountableObject.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : setNodeId
  =dataS/scripts/objects/FillablePallet.lua (0) : createNode
  =dataS/scripts/BaseMission.lua (0) : load
  =dataS/scripts/shop/BuyObjectEvent.lua (0) : loadObjectAtPlace
  =dataS/scripts/network/Connection.lua (0) : run
  =dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
  =dataS/scripts/gui/elements/Gui.lua (0) : update
  =dataS/scripts/main.lua (0) : update
Error: Running LUA method 'update'.
dataS/scripts/objects/PhysicsObject.lua:0: attempt to perform arithmetic on a nil value
 
Taka tam sobie reklama.
  


Podobne wątki
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
Question Maszyna nie pojawia się w sklepie Teksai 5 2,198 08-23-2016, 17:37
Ostatni post: MichaelMF
  Animacja spalin pojawia się w kabinie Dawid Słowiński 2 1,279 07-31-2016, 14:40
Ostatni post: Dawid Słowiński



Przegląda: 1 gości

Menu