Jump to content
The Dark Mod Forums

AlexDiru

Member
  • Posts

    30
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by AlexDiru

  1. But the problem is where should "inv_droppable" be defined? I'm not too use about the structure of things, but if it's defined in the .map file it works, but in a .def file it fails.

     

    For example, the lockpicks are defined in tdm_defs01.pk4/tdm_shopitems.def:

    entityDef ShopItem_playertools_lockpick_set
    {
    	"inherit"			"atdm:shopitem_base"
    	"editor_usage"		"Lockpicks"
    	"displayName"		"#str_02389"	// Lockpicks
    	"displayDesc"		"#str_02276"	// A set of tools for opening locks."
        "itemClassname"		"atdm:playertools_lockpick_triangle"
        "itemClassname1"	"atdm:playertools_lockpick_snake"
    	"image"				"guis/assets/purchase_menu/lockpicks"
    	"price"				"20"
    	"stackable"			"0"
    }
    

    With no "inv_droppable" attribute.

    And in the prologue9.map (A New Job FM), there are no lockpicks defined. So as far as I know lockpicks aren't marked as "inv_droppable", though it's likely just in a different file.

     

    With the "inv_droppable" attribute in the .map file for the Volta Test, everything works as expected:

     

    qSHmWWq.png

    • Like 1
  2. Ok so I have a minor fix for this problem, I can't really go any further until I have more confirmation of how things should be organised.

     

    In "test.def", the entity which shouldn't be droppable is defined as:

    entityDef veil_stone
    {
        "inherit"                        "atdm:playertool"
        "editor_displayFolder"            "interactables/special"
        "editor_usage"             "The Stone"
        "editor_color"                    "0.078 0.914 0.600"
        
        // model
            "model"                          "models/volta/special/veil_stone.ASE"
            "density"                    ".5"
            "bouncyness"                "0.01"
            "mass"                        "20"
        
        //Inventory
        "frob_distance"                    "75"
        "inv_droppable"                    "0"
        "notPushable"                    "1"
        "inv_name"                        "The Stone"    
        "inv_icon"                        "guis/assets/hud/inventory_icons/icon_stone"
    }

    And in the .map file there is:

    // entity 16
    {
    "classname" "veil_stone"
    "name" "veil_stone_2"
    "inv_map_start" "1"
    "origin" "89 -94 86"
    "rotation" "1 0 0 0 1 0 0 0 1"
    }

    Items are loaded into the shop using CShop::AddPersistentStartingEquipment() in particular:

    if (!itemMerged)
    {
    	CShopItemPtr anItem(new CShopItem(*found, quantity, 0, false));
    	bool canDrop = itemDict->GetBool("inv_droppable", "1"); //This is always returning true (by default) - the dictionary cannot find "inv_droppable" or "inv_icon" or etc
    
    	anItem->SetCanDrop(canDrop);
    
    	_startingItems.Append(anItem);
    }	
    

    However, the itemDict refers to the entity defined in the .map file rather than the .def file. So if "inv_droppable" "0" is added to the .map file entity, the drop button will be removed for it

    // entity 16
    {
    "classname" "veil_stone"
    "name" "veil_stone_2"
    "inv_map_start" "1"
    "origin" "89 -94 86"
    "rotation" "1 0 0 0 1 0 0 0 1"
    "inv_droppable" "0" <----- I can't make this bold but this is the key line
    }

    Now I'm not sure whether the inv_droppable should be defined in the .map entities or the .def entities, so I need some confirmation regarding this

     

    And now I need to go to bed now, it's past 2AM :P

×
×
  • Create New...