星期四, 9月 04, 2025

Diablo 2: Resurrected: 修改state machine


 (1) 從網路下載來的皮膚素材,如果有部分不想要的話, 與其直接從json拿走, 不如留著但是修改位置及大小. 例如:


             "type": "Entity",

            "name": "entity_model",

            "id": 1444153583,

            "components": [

                //    Ʈ    dz         

                {

                    "type": "TransformDefinitionComponent",

                    "name": "entity_root_TransformDefinition",

                    "position": {

                        "x": 0.0,

                        "y": -10.18,

                        "z": 0.03

                    },

                    "orientation": {

                        "x": 0.0,

                        "y": 0.0,

                        "z": 0.0,

                        "w": 1.0

                    },

                    "scale": {

                        "x": 0.035,

                        "y": 0.035,

                        "z": 0.035

                    },

                    "inheritOnlyPosition": false

                },

                {

                    "type": "EntityAttachmentDefinitionComponent",

                    "name": "entity_spectralflames_EntityAttachmentDefinition",

                    "targetbone": "L_lwr_arm_twist_01_bind_jnt"

                },

                {

                    "type": "ModelDefinitionComponent",

                    "name": "component_model_arrows",

                    "filename": "data/hd/character/enemy/bladecreeper/torso_lod0.model",



這個例子當中會在身上從bladescreeper加載其torso物件. 簡單地從人物身上拿掉的方式是, y座標設置負值(這樣一來會加載在地下的座標),或是scale設置一個非常小的數值(使得不起眼), 或是兩個都修改. 這樣做的好處是一旦想改回來會很容易知道改在哪裡.


(2) 想要把人物顯示放大, 但又不想連同環境一起放大的話, 可以修改entity_root_TransformDefinition裡面的scale. x/y/z各自代表三維的放大比例.


    "type": "UnitDefinition",

    "name": "assassin",

    "entities": [

                {

                    "type": "TransformDefinitionComponent",

                    "name": "entity_root_TransformDefinition",

                    "position": {

                        "x": 0.0,

                        "y": -0.03,

                        "z": 0.03

                    },

                    "orientation": {

                        "x": 0.0,

                        "y": 0.0,

                        "z": 0.0,

                        "w": 1.0

                    },

                    "scale": {

                        "x": 1.91,

                        "y": 1.91,

                        "z": 1.91

                    },

                    "inheritOnlyPosition": false

                },