dysmantle吧 关注:2,257贴子:9,141
  • 20回复贴,共1

这游戏mod好少,有没有人一起研究mod,我先来一点自己研究的结果

只看楼主收藏回复

自制mod的第一步自然是解开游戏打包好的文件。这个是我在网上找到的方法
https://linode.ghazlawl.com/dysmantle/creating-mods/
之后大家才能自由发挥。像更广的捡物资范围(物质磁铁),更大背包,永远不计时的计时器宝箱都很容易弄出来,因为都是游戏已经做出来的功能,仿写就行。
我一直想把武器改成拆物体时,范围更广,同时打击目标更多,但是打怪和游戏原本一样。其中打击目标更多很好改,因为有很多武器比如扳手就有这个功能。但是打击范围无论如何都时对怪物和物体一视同仁的。因此用了比较麻烦的退而求其次的办法。
游戏有个隐藏的武器,即徒手,伤害只有2。可以把它改成初始伤害8,每次升级增加4(等同开局武器撬棍)。同时用两个定义了撬棍属性的文件(crowbar.xml和crowbar.nut)去仿写拳头;在recipes.xml文件中增加拳头的配方,同样仿写撬棍。并给拳头的攻击范围定义为撬棍的5倍,同时对怪物伤害-100%,每次升级只消耗一片树叶。这样一来,就可以得到一个只对物体有伤害,范围超广的拆家神器,同时不影响平衡,因为仅仅时拆家更快了而已。但是需要自己自觉在主武器升级时候去升级拳头,不能超过主武器的破坏力。同时,后续换了棒球棍和扳手锤子后,可能要重新定义拳头的伤害值(好在几小时只用改一下,却可以极大节省拆家时间)


IP属地:比利时1楼2023-01-31 06:30回复
    求问打击更多目标是怎么搞?比如拳套数据是1+4还是直接就是5?


    IP属地:广东来自Android客户端2楼2023-04-01 22:40
    收起回复
      软件下下来后点击无反应,是怎么回事呢


      IP属地:重庆来自Android客户端3楼2023-04-15 00:46
      收起回复
        @赤诺达
        解封数据包之后:
        DYSMANTLE\data\items\tools\utils下面的melee-attack.nut文件替换成以下代码:
        local owner_handle = 0;
        local next_melee_attack_time = 0;
        local attack_continuously = false;
        local trigger_down = false;
        local powerattack_anim_length = null;
        local power_attack_start_time = null;
        local pos=[0,0,0];
        local enemy1 = 0;
        local enemy2 = 0;
        function OnLoad()
        {
        }
        // When the object gets created. Returns false if creation fails for some reason.
        function OnInitialize(so_handle_owner, item_id)
        {
        owner_handle = so_handle_owner;
        if ("OnCustomInitialize" in this)
        {
        OnCustomInitialize(owner_handle, item_id);
        }
        return true;
        }
        // When user presses the tool activation key
        function OnTriggerDown()
        {
        power_attack_start_time = null;
        trigger_down = true;
        attack_continuously = !Game_IsInCombat(owner_handle);
        if ("OnCustomAttack" in this && attack_continuously)
        {
        OnCustomAttack(owner_handle);
        }
        else if (attack_continuously)
        {
        local current_time = Stage_GetTimeMilliseconds();
        if (current_time >= next_melee_attack_time)
        {
        if (enemy1==0)
        {
        MeleeAttack2();
        }
        if(enemy2>0)
        {
        MeleeAttack();
        }
        }
        }
        else
        {
        local current_time = Stage_GetTimeMilliseconds();
        if (current_time >= next_melee_attack_time)
        {
        PowerAttack();
        power_attack_start_time = current_time;
        }
        }
        if ("OnCustomTriggerDown" in this)
        {
        OnCustomTriggerDown(owner_handle);
        }
        }
        // When user releases the tool activation key
        function OnTriggerUp()
        {
        trigger_down = false;
        powerattack_anim_length = null;
        }
        // When the tool activation keypress is canceled
        function OnTriggerCancel()
        {
        OnTriggerUp();
        }
        function OnTriggerClick()
        {
        if (!attack_continuously)
        {
        local anim_str = "melee_power_attack";
        if ("STANCE_OVERRIDE" in this)
        {
        anim_str += "." + STANCE_OVERRIDE;
        }
        Game_StopAnimationByAction(owner_handle, anim_str);
        powerattack_anim_length = null;
        local current_time = Stage_GetTimeMilliseconds();
        if (current_time >= next_melee_attack_time)
        {
        if (enemy1==0)
        {
        MeleeAttack2();
        }
        if(enemy2>0)
        {
        MeleeAttack();
        }
        }
        }
        }
        function OnTriggerHoldDown()
        {
        if (!attack_continuously && powerattack_anim_length != null)
        {
        Game_DisableMovement(owner_handle, powerattack_anim_length + POWER_ATTACK_DELAY);
        }
        }
        // Called each frame. Param float tdelta.
        function OnUpdate(tdelta)
        {
        pos = StageObject_GetPosition (owner_handle);
        enemy1 = Game_GetNumberOfEnemiesInRadius(pos[0],pos[1],pos[2],400);
        enemy2 = Game_GetNumberOfEnemiesInRadius(pos[0],pos[1],pos[2],80);
        if ("OnCustomUpdate" in this)
        {
        OnCustomUpdate(owner_handle, tdelta);
        }
        else if (attack_continuously)
        {
        local current_time = Stage_GetTimeMilliseconds();
        if (current_time >= next_melee_attack_time)
        {
        if (trigger_down)
        {
        if (enemy1==0)
        {
        MeleeAttack2();
        }
        if(enemy2>0)
        {
        MeleeAttack();
        }
        }
        if (Game_IsInCombat(owner_handle))
        {
        attack_continuously = false;
        }
        }
        }
        }
        // Free all allocations here by latest. This instance will not be called after this function returns.
        // This will not be called if OnInitialize has failed.
        function OnDestroy()
        {
        }
        // Returns true or false. If true, the system will soon destroy this object.
        function IsFinished()
        {
        return false;
        }
        function MeleeAttack()
        {
        local modifiers = Game_GetModifiersAsKeyValueStore(owner_handle);
        local attack_speed_multiplier = ATTACK_PLAYBACK_SPEED;
        local melee_attack_speed_percentage_increase = KeyValueStore_GetKeyValue(modifiers, "melee_attack_speed_percentage_increase");
        if (melee_attack_speed_percentage_increase != null)
        {
        attack_speed_multiplier *= (1 + 0.01 * melee_attack_speed_percentage_increase);
        }
        local attack_delay = ATTACK_DELAY;
        if (attack_delay > 0)
        {
        local melee_attack_delay_percentage_decrease = KeyValueStore_GetKeyValue(modifiers, "melee_attack_delay_percentage_decrease");
        if (melee_attack_delay_percentage_decrease != null)
        {
        local delay_multiplier = 1 - 0.01 * melee_attack_delay_percentage_decrease;
        attack_delay *= delay_multiplier;
        }
        }
        local start_position_in_seconds = 0;//power_attack_start_time == null ? 0 : (Stage_GetTimeMilliseconds() - power_attack_start_time) / 1000.0;
        local anim_str = "melee";
        if ("STANCE_OVERRIDE" in this)
        {
        anim_str += "." + STANCE_OVERRIDE;
        }
        local anim = Game_PlayAnimationByActionWithPlaybackSpeed(owner_handle, anim_str, attack_speed_multiplier, start_position_in_seconds);
        local anim_id = anim[0];
        local attack_length = anim[1];
        local current_time = Stage_GetTimeMilliseconds();
        next_melee_attack_time = current_time + 1000 * (attack_length + attack_delay);
        Game_OnMeleeAttack(owner_handle, anim_str, attack_speed_multiplier, start_position_in_seconds);
        }
        function MeleeAttack2()
        {
        local modifiers = Game_GetModifiersAsKeyValueStore(owner_handle);
        local attack_speed_multiplier = ATTACK_PLAYBACK_SPEED;
        local melee_attack_speed_percentage_increase = KeyValueStore_GetKeyValue(modifiers, "melee_attack_speed_percentage_increase");
        if (melee_attack_speed_percentage_increase != null)
        {
        attack_speed_multiplier *= (1 + 0.01 * melee_attack_speed_percentage_increase);
        }
        local attack_delay = ATTACK_DELAY;
        if (attack_delay > 0)
        {
        local melee_attack_delay_percentage_decrease = KeyValueStore_GetKeyValue(modifiers, "melee_attack_delay_percentage_decrease");
        if (melee_attack_delay_percentage_decrease != null)
        {
        local delay_multiplier = 1 - 0.01 * melee_attack_delay_percentage_decrease;
        attack_delay *= delay_multiplier;
        }
        }
        local start_position_in_seconds = 0;//power_attack_start_time == null ? 0 : (Stage_GetTimeMilliseconds() - power_attack_start_time) / 1000.0;
        local anim_str = "melee";
        if ("STANCE_OVERRIDE" in this)
        {
        anim_str += "." + STANCE_OVERRIDE;
        }
        local anim = Game_PlayAnimationByActionWithPlaybackSpeed(owner_handle, anim_str, 3*attack_speed_multiplier, start_position_in_seconds);
        local anim_id = anim[0];
        local attack_length = anim[1];
        local current_time = Stage_GetTimeMilliseconds();
        next_melee_attack_time = current_time + 1000 * (attack_length + 0.33*attack_delay);
        Game_OnMeleeAttack(owner_handle, anim_str, attack_speed_multiplier, start_position_in_seconds);
        }
        function PowerAttack()
        {
        local attack_speed_multiplier;
        if (rawin("POWER_ATTACK_PLAYBACK_SPEED"))
        attack_speed_multiplier = POWER_ATTACK_PLAYBACK_SPEED;
        else
        attack_speed_multiplier = ATTACK_PLAYBACK_SPEED;
        local anim_str = "melee_power_attack";
        if ("STANCE_OVERRIDE" in this)
        {
        anim_str += "." + STANCE_OVERRIDE;
        }
        Game_StopAnimationByAction(owner_handle, anim_str);
        local anim = Game_PlayAnimationByActionWithPlaybackSpeed(owner_handle, anim_str, attack_speed_multiplier);
        powerattack_anim_length = anim[1];
        power_attack_start_time = Stage_GetTimeMilliseconds();
        }


        IP属地:比利时4楼2023-04-16 02:28
        收起回复
          一长串下来 完全看不懂 怎么解包 怎么弄 怎么运行 完全看不明白


          IP属地:广东5楼2023-04-21 02:16
          回复
            大佬 背包 无限飞到 物品次数怎么改


            IP属地:四川6楼2023-10-05 15:50
            回复