3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

楼主: yzzn2009
打印 上一主题 下一主题

[原创] 易宁:饥荒游戏实用修改技巧(非MOD模式,请自行备份)支持海难版——6月6日更新:简化修船工具制作材料(只用木板和绳子)

  [复制链接]

1

主题

41

帖子

87

积分

初级玩家

Rank: 2

贡献度
0
金元
870
积分
87
精华
0
注册时间
2013-10-14
5881#
发表于 2014-2-22 11:06 | 只看该作者
吃东西不生病怎么改
回复 支持 反对

使用道具 举报

1

主题

61

帖子

120

积分

中级玩家

Rank: 3Rank: 3

贡献度
1
金元
1160
积分
120
精华
0
注册时间
2014-2-21
5882#
发表于 2014-2-22 11:41 | 只看该作者
yzzn2009 发表于 2014-2-20 20:22
不排除是游戏版本差异造成的,如果想最大程度地体验修改效果,最好使用3DM的11月15日版(89685版),我用 ...

在哪里下载???我找了半天没有啊。。刚发现了一个是89685版的但是不是3dm的。。。在哪里下载3dm的??
回复 支持 反对

使用道具 举报

4

主题

627

帖子

542

积分

高级玩家

Rank: 4

贡献度
3
金元
5297
积分
542
精华
0
注册时间
2012-2-2
5883#
发表于 2014-2-22 11:46 | 只看该作者
Lz 能不能把建墙的距离修改一下  现在的距离太近了  = =  建一个把人物弹开就建歪了
回复 支持 反对

使用道具 举报

0

主题

26

帖子

13

积分

新手玩家

Rank: 1

贡献度
0
金元
730
积分
13
精华
0
注册时间
2013-12-23
5884#
发表于 2014-2-22 13:12 | 只看该作者
让易宁哥休息下吧
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5885#
 楼主| 发表于 2014-2-22 13:25 | 只看该作者
e死了 发表于 2014-2-22 09:36
我的是在饥荒游戏吧下的3dm22版的。。为什吗看不到种出来的鲜果龙树和小花坛?? ...

官方一直拆东墙补西墙,不排除89685版之后的版本将一些基础技术语句作废了,我用的是这个版本http://bbs.3dmgame.com/thread-3793161-1-1.html,可以正确显示
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5886#
 楼主| 发表于 2014-2-22 13:27 | 只看该作者
1692532967 发表于 2014-2-22 11:06
吃东西不生病怎么改

将“小病小灾”代码中的inst.components.eater:SetOnEatFn(OnEat)替换为--inst.components.eater:SetOnEatFn(OnEat)
回复 支持 反对

使用道具 举报

0

主题

94

帖子

107

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1070
积分
107
精华
0
注册时间
2013-10-25
5887#
发表于 2014-2-22 13:29 | 只看该作者
、恋☆Smile 发表于 2014-2-20 17:28
是这样啊,谢谢。
再请问这句话是变身不会掉物品还是吃肉变身

都是(凑字)
回复 支持 反对

使用道具 举报

0

主题

94

帖子

107

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1070
积分
107
精华
0
注册时间
2013-10-25
5888#
发表于 2014-2-22 13:31 | 只看该作者
yzzn2009 发表于 2014-2-22 13:25
官方一直拆东墙补西墙,不排除89685版之后的版本将一些基础技术语句作废了,我用的是这个版本http://bbs. ...

中文还是英文(英文就算了)有中文的一定要通知我哦
回复 支持 反对

使用道具 举报

0

主题

94

帖子

107

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1070
积分
107
精华
0
注册时间
2013-10-25
5889#
发表于 2014-2-22 14:31 | 只看该作者
能不能做个吸金石(类似懒人护符,不过只吸矿石)懒人护符老捡到其他东西,而且范围也大
回复 支持 反对

使用道具 举报

0

主题

149

帖子

135

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1345
积分
135
精华
0
注册时间
2013-11-27
5890#
发表于 2014-2-22 15:17 | 只看该作者
本帖最后由 无语。。。 于 2014-2-22 15:20 编辑
1692532967 发表于 2014-2-22 11:06
吃东西不生病怎么改

宁哥你一整天大部分时间都在制作?
回复 支持 反对

使用道具 举报

4

主题

627

帖子

542

积分

高级玩家

Rank: 4

贡献度
3
金元
5297
积分
542
精华
0
注册时间
2012-2-2
5891#
发表于 2014-2-22 15:42 | 只看该作者
宁哥  鲜龙果树为什么是一个没着火的石头火坑啊  是不是和哪项冲突了

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5892#
 楼主| 发表于 2014-2-22 16:08 | 只看该作者
无语。。。 发表于 2014-2-22 15:17
宁哥你一整天大部分时间都在制作?

还要看股票
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5893#
 楼主| 发表于 2014-2-22 16:09 | 只看该作者
az8720255 发表于 2014-2-22 15:42
宁哥  鲜龙果树为什么是一个没着火的石头火坑啊  是不是和哪项冲突了 ...

做好使用89685版,见6248楼
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5894#
 楼主| 发表于 2014-2-22 16:12 | 只看该作者
1750820466 发表于 2014-2-22 14:31
能不能做个吸金石(类似懒人护符,不过只吸矿石)懒人护符老捡到其他东西,而且范围也大 ...

只吸矿石功能太单一了,做出来估计很少会有人使用
回复 支持 反对

使用道具 举报

0

主题

60

帖子

92

积分

初级玩家

Rank: 2

贡献度
0
金元
915
积分
92
精华
0
注册时间
2013-7-12
5895#
发表于 2014-2-22 16:18 | 只看该作者
呼……我回来了……
回复 支持 反对

使用道具 举报

0

主题

17

帖子

9

积分

新手玩家

Rank: 1

贡献度
0
金元
685
积分
9
精华
0
注册时间
2014-2-15
5896#
发表于 2014-2-22 17:20 | 只看该作者
口袋蜂箱被我改成了口袋猪舍,能力是一样的。经测试口袋猪舍在包里显示猪舍图标,放在地上也是一个小猪舍,地图上显示也是一个猪舍。可是我把他放在任何要打的怪中,猪舍灯一亮,就警告了。。恳求宁哥帮我瞅瞅是哪里出了错。。
    用记事本打开游戏目录\data\scripts\prefabs\nightmarefuel.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:

local pigsounds =
{
    takeoff = "dontstarve/pig/pigman_takeoff",
    attack = "dontstarve/pig/pigman_attack",
    buzz = "dontstarve/pig/pigman_fly_LP",
    hit = "dontstarve/pig/pigman_hurt",
    death = "dontstarve/pig/pigman_death",
}

local function OnDeploy (inst, pt)
  if GetPlayer().components.inventory:Has("goldnugget", 500) then
    GetPlayer().components.inventory:ConsumeByName("goldnugget", 500)
    local box = SpawnPrefab("nightmarefuel")
    box.Transform:SetPosition(pt.x, pt.y, pt.z)
    box.AnimState:SetBank("pig_house")
    box.AnimState:SetBuild("pig_house")
    box.AnimStatelayAnimation("idle")
    box.AnimState:SetMultColour(255/255,0/255,0/255,1)
    box.Transform:SetScale(5, 5, 5)
    local sound = box.entity:AddSoundEmitter()
    local minimap = box.entity:AddMiniMapEntity()
    minimap:SetIcon( "pighouse.png" )
    box.components.inventoryitem:ChangeImageName("pighouse")
    box:RemoveComponent("stackable")
    box:RemoveComponent("fuel")
    box:RemoveComponent("deployable")
    box:AddComponent("workable")
    box.components.workable:SetWorkAction(ACTIONS.HAMMER)
    box.components.workable:SetWorkLeft(3)
    box.components.workable:SetOnFinishCallback(function(box)
         SpawnPrefab("collapse_small").Transform:SetPosition(box.Transform:GetWorldPosition())
         box.SoundEmitterlaySound("dontstarve/common/destroy_wood")
         box:Remove()
    end )
    box.task = boxoPeriodicTask(2, function(box)
        box.AnimState:SetBloomEffectHandle("shaders/anim.ksh")
        boxoTaskInTime(1, function() box.AnimState:SetBloomEffectHandle("") end )
        local pos = Vector3(box.Transform:GetWorldPosition())
        local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 30)
        for k,v in pairs(ents) do
            if v.components.health and not v.components.health:IsDead() and not v:HasTag("player") then
               if v.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == v or v:HasTag("monster") or v.prefab == "beefalo" or v.prefab == "pigguard" or v.prefab == "merm" or v.prefab == "monkey" or v.prefab == "tallbird" or v.prefab == "walrus" or v.prefab == "little_walrus" or v.prefab == "wasphive" then
                  local pt1 = box:GetPosition()
                  local pigman = SpawnPrefab("nightmarefuel")
                  pigman.Transform:SetPosition(pt1.x, pt1.y, pt1.z)
                  pigman.AnimState:SetBank("pigman")
                  pigman.AnimState:SetBuild("pig_angry_build")
                  pigman.AnimStatelayAnimation("idle")
                  pigman.AnimState:SetRayTestOnBB(true)
                  pigman.AnimState:SetMultColour(255/255,255/255,255/255,1)
                  pigman.entity:AddSoundEmitter()
                  pigman.entity:AddLightWatcher()
                  pigman.entity:AddDynamicShadow()
                  pigman.DynamicShadow:SetSize( .8, .5 )
                  pigman.Transform:SetFourFaced()
                  MakeCharacterPhysics(pigman, 1, .3)
                  pigman.Physics:SetCollisionGroup(COLLISION.FLYERS)
                  pigman.Physics:ClearCollisionMask()
                  pigman.Physics:CollidesWith(COLLISION.WORLD)
                  pigman.Physics:CollidesWith(COLLISION.FLYERS)
                  pigman:AddTag("pigman")
                  pigman:AddComponent("locomotor")
                  pigman.components.locomotor:EnableGroundSpeedMultiplier(false)
                  pigman.components.locomotor:SetTriggersPig(false)
                  pigman:SetStateGraph("SGpig")
                  pigman:AddComponent("health")
                  pigman.components.health:SetMaxHealth(200)
                  pigman:AddComponent("combat")
                  pigman.components.combat:SetTarget(v)
                  pigman.components.combat:SetDefaultDamage(20)
                  pigman.components.combat:SetAttackPeriod(0.1)
                  pigman.components.combat.hiteffectsymbol = "body"
                  pigman.components.combat:SetRetargetFunction(1, function(killerbee)
                      if not pigman.components.health:IsDead() then
                         return FindEntity(box, 30, function(guy)
                             if guy.components.health and not guy.components.health:IsDead() and not guy:HasTag("player") then
                                return guy.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == guy or guy:HasTag("monster") or guy.prefab == "beefalo" or guy.prefab == "pigguard" or guy.prefab == "merm" or guy.prefab == "monkey" or guy.prefab == "tallbird" or guy.prefab == "walrus" or guy.prefab == "little_walrus" or guy.prefab == "wasphive"
                             end
                         end)
                      end
                  end )
                  local pigbrain = require("brains/pigbrain")
                  pigman:SetBrain(pigbrain)
                  pigman.sounds = pigsounds
                  pigman:AddComponent("knownlocations")
                  pigmanistenForEvent("attacked", function(pigman, data) pigman.components.combat:SetTarget(data.attacker) end )
                  pigman:RemoveComponent("stackable")
                  pigman:RemoveComponent("fuel")
                  pigman:RemoveComponent("deployable")
                  pigman:RemoveComponent("inventoryitem")
                  pigmanoTaskInTime(30, function() pigman:Remove() end )
                  vistenForEvent("death", function() pigman:Remove() end )
               end
            end
        end
    end )
    box.components.inventoryitem:SetOnPutInInventoryFn(function(box)
        box:RemoveTag("doings")
        if box.task then box.task:Cancel() box.task = nil end
        local pos = Vector3(box.Transform:GetWorldPosition())
        local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 3000)
        for k,v in pairs(ents) do
            if v:HasTag("pigman") then
               v:Remove()
            end
        end
    end )
    box.components.inventoryitem:SetOnDroppedFn(function(box)
        box:AddTag("doings")
        box.task = boxoPeriodicTask(2, function(box)
            box.AnimState:SetBloomEffectHandle("shaders/anim.ksh")
            boxoTaskInTime(1, function() box.AnimState:SetBloomEffectHandle("") end )
            local pos = Vector3(box.Transform:GetWorldPosition())
            local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 30)
            for k,v in pairs(ents) do
                if v.components.health and not v.components.health:IsDead() and not v:HasTag("player") then
                   if v.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == v or v:HasTag("monster") or v.prefab == "beefalo" or v.prefab == "pigguard" or v.prefab == "merm" or v.prefab == "monkey" or v.prefab == "tallbird" or v.prefab == "walrus" or v.prefab == "little_walrus" or v.prefab == "wasphive" then
                      local pt1 = box:GetPosition()
                      local pigman = SpawnPrefab("nightmarefuel")
                      pigman.Transform:SetPosition(pt1.x, pt1.y, pt1.z)
                      pigman.AnimState:SetBank("pigman")
                      pigman.AnimState:SetBuild("pig_angry_build")
                      pigman.AnimStatelayAnimation("idle")
                      pigman.AnimState:SetRayTestOnBB(true)
                      pigman.AnimState:SetMultColour(255/255,255/255,255/255,1)
                      pigman.entity:AddSoundEmitter()
                      pigman.entity:AddLightWatcher()
                      pigman.entity:AddDynamicShadow()
                      pigman.DynamicShadow:SetSize( .8, .5 )
                      pigman.Transform:SetFourFaced()
                      MakeCharacterPhysics(pigman, 1, .3)
                      pigman.Physics:SetCollisionGroup(COLLISION.FLYERS)
                      pigman.Physics:ClearCollisionMask()
                      pigman.Physics:CollidesWith(COLLISION.WORLD)
                      pigman.Physics:CollidesWith(COLLISION.FLYERS)
                      pigman:AddTag("pigman")
                      pigman:AddComponent("locomotor")
                      pigman.components.locomotor:EnableGroundSpeedMultiplier(false)
                      pigman.components.locomotor:SetTriggersPig(false)
                      pigman:SetStateGraph("SGpig")
                      pigman:AddComponent("health")
                      pigman.components.health:SetMaxHealth(200)
                      pigman:AddComponent("combat")
                      pigman.components.combat:SetTarget(v)
                      pigman.components.combat:SetDefaultDamage(20)
                      pigman.components.combat:SetAttackPeriod(0.1)
                      pigman.components.combat.hiteffectsymbol = "body"
                      pigman.components.combat:SetRetargetFunction(1, function(pigman)
                          if not pigman.components.health:IsDead() then
                             return FindEntity(box, 30, function(guy)
                                 if guy.components.health and not guy.components.health:IsDead() and not guy:HasTag("player") then
                                    return guy.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == guy or guy:HasTag("monster") or guy.prefab == "beefalo" or guy.prefab == "pigguard" or guy.prefab == "merm" or guy.prefab == "monkey" or guy.prefab == "tallbird" or guy.prefab == "walrus" or guy.prefab == "little_walrus" or guy.prefab == "wasphive"
                                 end
                             end)
                          end
                      end )
                      local pigbrain = require("brains/pigbrain")
                      pigman:SetBrain(pigbrain)
                      pigman.sounds = pigsounds
                      pigman:AddComponent("knownlocations")
                      pigmanistenForEvent("attacked", function(pigman, data) pigman.components.combat:SetTarget(data.attacker) end )
                      pigman:RemoveComponent("stackable")
                      pigman:RemoveComponent("fuel")
                      pigman:RemoveComponent("deployable")
                      pigman:RemoveComponent("inventoryitem")
                      pigmanoTaskInTime(30, function() pigman:Remove() end )
                      vistenForEvent("death", function() pigman:Remove() end )
                   end
                end
            end
        end )
    end )
    box:AddTag("doings")
    box:AddTag("boxs")
  end
    inst.components.stackable:Get():Remove()
end
    inst:AddComponent("deployable")
    inst.components.deployable.ondeploy = OnDeploy
local function onsave(inst, data)
    if inst:HasTag("boxs") then
        data.boxs = true
    end
    if inst:HasTag("doings") then
        data.doings = true
    end
    if inst:HasTag("pigman") then
        data.pigman = true
    end
end
local function onload(inst, data)
  if data and data.boxs then
     inst.AnimState:SetBank("pig_house")
     inst.AnimState:SetBuild("pig_house")
     inst.AnimStatelayAnimation("idle")
     inst.AnimState:SetMultColour(255/255,0/255,0/255,1)
     inst.Transform:SetScale(0.5, 0.5, 0.5)
     local sound = inst.entity:AddSoundEmitter()
     local minimap = inst.entity:AddMiniMapEntity()
     minimap:SetIcon( "pighouse.png" )
     inst.components.inventoryitem:ChangeImageName("pighouse")
     inst:RemoveComponent("stackable")
     inst:RemoveComponent("fuel")
     inst:RemoveComponent("deployable")
     inst:AddComponent("workable")
     inst.components.workable:SetWorkAction(ACTIONS.HAMMER)
     inst.components.workable:SetWorkLeft(3)
     inst.components.workable:SetOnFinishCallback(function(inst)
          SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition())
          inst.SoundEmitterlaySound("dontstarve/common/destroy_wood")
          inst:Remove()
     end )
     inst.components.inventoryitem:SetOnPutInInventoryFn(function(inst)
         inst:RemoveTag("doings")
         if inst.task then inst.task:Cancel() inst.task = nil end
         local pos = Vector3(inst.Transform:GetWorldPosition())
         local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 3000)
         for k,v in pairs(ents) do
             if v:HasTag("pigman") then
                v:Remove()
             end
         end
     end )
     inst.components.inventoryitem:SetOnDroppedFn(function(inst)
         inst:AddTag("doings")
         inst.task = instoPeriodicTask(2, function(inst)
             inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh")
             instoTaskInTime(1, function() inst.AnimState:SetBloomEffectHandle("") end )
             local pos = Vector3(inst.Transform:GetWorldPosition())
             local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 30)
             for k,v in pairs(ents) do
                 if v.components.health and not v.components.health:IsDead() and not v:HasTag("player") then
                    if v.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == v or v:HasTag("monster") or v.prefab == "beefalo" or v.prefab == "pigguard" or v.prefab == "merm" or v.prefab == "monkey" or v.prefab == "tallbird" or v.prefab == "walrus" or v.prefab == "little_walrus" or v.prefab == "wasphive" then
                       local pt1 = inst:GetPosition()
                       local pigman = SpawnPrefab("nightmarefuel")
                       pigman.Transform:SetPosition(pt1.x, pt1.y, pt1.z)
                       pigman.AnimState:SetBank("pigman")
                       pigman.AnimState:SetBuild("pig_angry_build")
                       pigman.AnimStatelayAnimation("idle")
                       pigman.AnimState:SetRayTestOnBB(true)
                       pigman.AnimState:SetMultColour(255/255,255/255,255/255,1)
                       pigman.entity:AddSoundEmitter()
                       pigman.entity:AddLightWatcher()
                       pigman.entity:AddDynamicShadow()
                       pigman.DynamicShadow:SetSize( .8, .5 )
                       pigman.Transform:SetFourFaced()
                       MakeCharacterPhysics(pigman, 1, .3)
                       pigman.Physics:SetCollisionGroup(COLLISION.FLYERS)
                       pigman.Physics:ClearCollisionMask()
                       pigman.Physics:CollidesWith(COLLISION.WORLD)
                       pigman.Physics:CollidesWith(COLLISION.FLYERS)
                       pigman:AddTag("pigman")
                       pigman:AddComponent("locomotor")
                       pigman.components.locomotor:EnableGroundSpeedMultiplier(false)
                       pigman.components.locomotor:SetTriggersPig(false)
                       pigman:SetStateGraph("SGpig")
                       pigman:AddComponent("health")
                       pigman.components.health:SetMaxHealth(200)
                       pigman:AddComponent("combat")
                       pigman.components.combat:SetTarget(v)
                       pigman.components.combat:SetDefaultDamage(20)
                       pigman.components.combat:SetAttackPeriod(0.1)
                       pigman.components.combat.hiteffectsymbol = "body"
                       pigman.components.combat:SetRetargetFunction(1, function(pigman)
                           if not pigman.components.health:IsDead() then
                              return FindEntity(inst, 30, function(guy)
                                  if guy.components.health and not guy.components.health:IsDead() and not guy:HasTag("player") then
                                     return guy.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == guy or guy:HasTag("monster") or guy.prefab == "beefalo" or guy.prefab == "pigguard" or guy.prefab == "merm" or guy.prefab == "monkey" or guy.prefab == "tallbird" or guy.prefab == "walrus" or guy.prefab == "little_walrus" or guy.prefab == "wasphive"
                                  end
                              end)
                           end
                       end )
                       local pigbrain = require("brains/pigbrain")
                       pigman:SetBrain(pigbrain)
                       pigman.sounds = pigsounds
                       pigman:AddComponent("knownlocations")
                       pigmanistenForEvent("attacked", function(pigman, data) pigman.components.combat:SetTarget(data.attacker) end )
                       pigman:RemoveComponent("stackable")
                       pigman:RemoveComponent("fuel")
                       pigman:RemoveComponent("deployable")
                       pigman:RemoveComponent("inventoryitem")
                       pigmanoTaskInTime(30, function() pigman:Remove() end )
                       vistenForEvent("death", function() pigman:Remove() end )
                    end
                 end
             end
         end )
     end )
     inst:AddTag("boxs")
  end
  if data and data.doings then
     inst.task = instoPeriodicTask(2, function(inst)
         inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh")
         inst:DoTaskInTime(1, function() inst.AnimState:SetBloomEffectHandle("") end )
         local pos = Vector3(inst.Transform:GetWorldPosition())
         local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 30)
         for k,v in pairs(ents) do
             if v.components.health and not v.components.health:IsDead() and not v:HasTag("player") then
                if v.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == v or v:HasTag("monster") or v.prefab == "beefalo" or v.prefab == "pigguard" or v.prefab == "merm" or v.prefab == "monkey" or v.prefab == "tallbird" or v.prefab == "walrus" or v.prefab == "little_walrus" or v.prefab == "wasphive" then
                   local pt1 = inst:GetPosition()
                   local pigman = SpawnPrefab("nightmarefuel")
                   pigman.Transform:SetPosition(pt1.x, pt1.y, pt1.z)
                   pigman.AnimState:SetBank("pigman")
                   pigman.AnimState:SetBuild("pig_angry_build")
                   pigman.AnimStatelayAnimation("idle")
                   pigman.AnimState:SetRayTestOnBB(true)
                   pigman.AnimState:SetMultColour(255/255,255/255,255/255,1)
                   pigman.entity:AddSoundEmitter()
                   pigman.entity:AddLightWatcher()
                   pigman.entity:AddDynamicShadow()
                   pigman.DynamicShadow:SetSize( .8, .5 )
                   pigman.Transform:SetFourFaced()
                   MakeCharacterPhysics(pigman, 1, .3)
                   pigman.Physics:SetCollisionGroup(COLLISION.FLYERS)
                   pigman.Physics:ClearCollisionMask()
                   pigman.Physics:CollidesWith(COLLISION.WORLD)
                   pigman.Physics:CollidesWith(COLLISION.FLYERS)
                   pigman:AddTag("pigman")
                   pigman:AddComponent("locomotor")
                   pigman.components.locomotor:EnableGroundSpeedMultiplier(false)
                   pigman.components.locomotor:SetTriggersPig(false)
                   pigman:SetStateGraph("SGpig")
                   pigman:AddComponent("health")
                   pigman.components.health:SetMaxHealth(200)
                   pigman:AddComponent("combat")
                   pigman.components.combat:SetTarget(v)
                   pigman.components.combat:SetDefaultDamage(20)
                   pigman.components.combat:SetAttackPeriod(0.1)
                   pigman.components.combat.hiteffectsymbol = "body"
                   pigman.components.combat:SetRetargetFunction(1, function(pigman)
                       if not pigman.components.health:IsDead() then
                          return FindEntity(inst, 30, function(guy)
                              if guy.components.health and not guy.components.health:IsDead() and not guy:HasTag("player") then
                                 return guy.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == guy or guy:HasTag("monster") or guy.prefab == "beefalo" or guy.prefab == "pigguard" or guy.prefab == "merm" or guy.prefab == "monkey" or guy.prefab == "tallbird" or guy.prefab == "walrus" or guy.prefab == "little_walrus" or guy.prefab == "wasphive"
                              end
                          end)
                       end
                   end )
                   local pigbrain = require("brains/pigbrain")
                   pigman:SetBrain(pigbrain)
                   pigman.sounds = pigsounds
                   pigman:AddComponent("knownlocations")
                   pigmanistenForEvent("attacked", function(pigman, data) pigman.components.combat:SetTarget(data.attacker) end )
                   pigman:RemoveComponent("stackable")
                   pigman:RemoveComponent("fuel")
                   pigman:RemoveComponent("deployable")
                   pigman:RemoveComponent("inventoryitem")
                   pigman:DoTaskInTime(30, function() pigman:Remove() end )
                   vistenForEvent("death", function() pigman:Remove() end )
                end
             end
         end
     end )
     inst:AddTag("doings")
  end
  if data and data.pigman then
     inst:Remove()
  end
end
    inst.OnSave = onsave
    inst.OnLoad = onload
回复 支持 反对

使用道具 举报

0

主题

184

帖子

154

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1536
积分
154
精华
0
注册时间
2013-7-23
QQ
5897#
发表于 2014-2-22 18:50 | 只看该作者
宁哥,为什么我口袋猴子活捉的鸟什么的,不能拿出来就只能放在背包里看着,在背包里面点一下准备拿出来就消失了,,消失了,,
回复 支持 反对

使用道具 举报

0

主题

94

帖子

107

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1070
积分
107
精华
0
注册时间
2013-10-25
5898#
发表于 2014-2-22 18:56 | 只看该作者
我的红胡子海盗团,每次到冒险之门旁边的时候,让他们打几下,就自动跳出(没有警告)你看看哪里错了
forest.lua
local assets =
{
        Asset("IMAGE", "images/colour_cubes/day05_cc.tex"),
        Asset("IMAGE", "images/colour_cubes/dusk03_cc.tex"),
        Asset("IMAGE", "images/colour_cubes/night03_cc.tex"),
        Asset("IMAGE", "images/colour_cubes/snow_cc.tex"),
        Asset("IMAGE", "images/colour_cubes/snowdusk_cc.tex"),
        Asset("IMAGE", "images/colour_cubes/night04_cc.tex"),
        Asset("IMAGE", "images/colour_cubes/insane_day_cc.tex"),
        Asset("IMAGE", "images/colour_cubes/insane_dusk_cc.tex"),
        Asset("IMAGE", "images/colour_cubes/insane_night_cc.tex"),

    Asset("ANIM", "anim/snow.zip"),
    Asset("ANIM", "anim/lightning.zip"),
    Asset("ANIM", "anim/splash_ocean.zip"),
    Asset("ANIM", "anim/frozen.zip"),

    Asset("SOUND", "sound/forest_stream.fsb"),
        Asset("IMAGE", "levels/textures/snow.tex"),
        Asset("IMAGE", "images/wave.tex"),
}

local forest_prefabs =
{
        "world",
        "adventure_portal",
        "resurrectionstone",
    "deerclops",
    "gravestone",
    "flower",
    "animal_track",
    "dirtpile",
    "beefaloherd",
    "beefalo",
    "penguinherd",
    "penguin_ice",
    "penguin",
    "koalefant_summer",
    "koalefant_winter",
    "beehive",
        "wasphive",
    "walrus_camp",
    "pighead",
    "mermhead",
    "rabbithole",
    "carrot_planted",
    "tentacle",
        "wormhole",
    "cave_entrance",
        "teleportato_base",
        "teleportato_ring",
        "teleportato_box",
        "teleportato_crank",
        "teleportato_potato",
        "pond",
        "marsh_tree",
        "marsh_bush",
        "reeds",
        "mist",
        "snow",
        "rain",
        "maxwellthrone",
        "maxwellendgame",
        "maxwelllight",
        "maxwelllock",
        "maxwellphonograph",
        "puppet_wilson",
        "puppet_willow",
        "puppet_wendy",
        "puppet_wickerbottom",
        "puppet_wolfgang",
        "puppet_wx78",
        "puppet_wes",
"puppet_woodie",
        "marblepillar",
        "marbletree",
        "statueharp",
        "statuemaxwell",
        "eyeplant",
        "lureplant",
        "purpleamulet",
        "monkey",
        "livingtree",
}

local function fn(Sim)

        local inst = SpawnPrefab("world")
        inst.prefab = "forest"
        inst.entity:SetCanSleep(false)
       
       
        --add waves
        local waves = inst.entity:AddWaveComponent()
        waves:SetRegionSize( 40, 20 )
        waves:SetRegionNumWaves( 6 )
        waves:SetWaveTexture( "images/wave.tex" )

        -- See source\game\components\WaveRegion.h
        waves:SetWaveEffect( "shaders/waves.ksh" ) -- texture.ksh
        --waves:SetWaveEffect( "shaders/texture.ksh" ) --
        waves:SetWaveSize( 2048, 512 )
    inst:AddComponent("clock")

        inst:AddComponent("seasonmanager")
    inst:AddComponent("birdspawner")
    inst:AddComponent("butterflyspawner")
        inst:AddComponent("hounded")
        inst:AddComponent("basehassler")
        inst:AddComponent("hunter")
       
    inst.components.butterflyspawner:SetButterfly("butterfly")

        inst:AddComponent("frograin")

        inst:AddComponent("lureplantspawner")
        inst:AddComponent("penguinspawner")

        inst:AddComponent("colourcubemanager")
        inst.Map:SetOverlayTexture( "levels/textures/snow.tex" )
    return inst
end

return Prefab( "forest", fn, assets, forest_prefabs)






adventure_portal.lua

local BigPopupDialogScreen = require "screens/bigpopupdialog"

local assets=
{
        Asset("ANIM", "anim/portal_adventure.zip"),
}


local function GetVerb(inst)
        return STRINGS.ACTIONS.ACTIVATE.GENERIC
end

local function OnActivate(inst)
        --do popup confirmation
        --do portal presentation
        --save and do restart
    ProfileStatsSet("portal_used", true)
        SetPause(true,"portal")
       
        local function startadventure()
                local function onsaved()
                    StartNextInstance({reset_action=RESET_ACTION.LOAD_SLOT, save_slot = SaveGameIndex:GetCurrentSaveSlot()}, true)
                end
                TheFrontEndopScreen()
                SetPause(false)
                GetPlayer().sg:GoToState("teleportato_teleport")
                ProfileStatsSet("portal_accepted", true)
                GetPlayer()oTaskInTime(5, function() SaveGameIndex:StartAdventure(onsaved) end)
        end

        local function rejectadventure()
                TheFrontEndopScreen()
                SetPause(false)
                inst.components.activatable.inactive = true
                ProfileStatsSet("portal_rejected", true)
        end

        -- A/B test
        local bodytext = GetTestGroup() == 0 and STRINGS.UI.STARTADVENTURE.BODY or STRINGS.UI.STARTADVENTURE.BODY_TEST

        TheFrontEndushScreen(BigPopupDialogScreen(STRINGS.UI.STARTADVENTURE.TITLE, bodytext,
                        {{text=STRINGS.UI.STARTADVENTURE.YES, cb = startadventure},
                         {text=STRINGS.UI.STARTADVENTURE.NO, cb = rejectadventure}  }))
end

local function fn(Sim)
        local inst = CreateEntity()
        local trans = inst.entity:AddTransform()
        local anim = inst.entity:AddAnimState()
    inst.entity:AddSoundEmitter()
    MakeObstaclePhysics(inst, 1)
   
    local minimap = inst.entity:AddMiniMapEntity()
    minimap:SetIcon( "portal.png" )
   
    anim:SetBank("portal_adventure")
    anim:SetBuild("portal_adventure")
    animlayAnimation("idle_off", true)
   
    inst:AddComponent("inspectable")

local function createbandit(inst)
  for k = 1,math.random(20,35) do
    local pt = inst:GetPosition()
    local bandit = SpawnPrefab("beardhair")
    bandit.Transform:SetPosition(pt.x+(math.random(50)-math.random(50)), 0, pt.z+(math.random(50)-math.random(50)))
    bandit.AnimState:SetBank("wilson")
    bandit.AnimState:SetBuild("woodie")
    bandit.AnimState:OverrideSymbol("swap_hat", "hat_feather", "swap_hat")
    bandit.AnimState:OverrideSymbol("swap_body", "armor_slurper", "swap_body")
    bandit.AnimState:Show("HAT")
    bandit.AnimState:Show("HAT_HAIR")
    bandit.AnimState:Hide("HAIR_NOHAT")
    bandit.AnimState:Hide("HAIR")
    bandit.AnimState:Hide("ARM_carry")
    bandit.AnimState:Show("ARM_normal")
    bandit.AnimStatelayAnimation("idle")
    local sound = bandit.entity:AddSoundEmitter()
    local shadow = bandit.entity:AddDynamicShadow()
    shadow:SetSize( 1.3, .6 )
    bandit.Transform:SetFourFaced()
    local brain = require "brains/frogbrain"
    bandit:SetBrain(brain)
    bandit:AddComponent("locomotor")
    bandit.components.locomotor.walkspeed = 5
    bandit.components.locomotor.runspeed = 10
    bandit:SetStateGraph("SGshadowwaxwell")
    MakeCharacterPhysics(bandit, 75, .5)
    bandit:RemoveComponent("inventoryitem")
    bandit:RemoveComponent("stackable")
    bandit:RemoveComponent("fuel")
    bandit:RemoveComponent("burnable")
    bandit:RemoveComponent("propagator")
    bandit:AddComponent("inventory")
    bandit:AddComponent("thief")
    bandit:AddComponent("knownlocations")
    bandit:AddComponent("health")
    bandit.components.health:SetMaxHealth(1500)
    banditistenForEvent("death", function()
        local pt1 = bandit:GetPosition()
        for k = 1,math.random(15,25) do
            local gold = SpawnPrefab("goldnugget")
            gold.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 0, pt1.z+(math.random(3)-math.random(3)))
        end
        if math.random() < 0.1 then
           local weapons = {"goldenaxe","spear","tentaclespike","batbat","ruins_bat"}
           local weapon = weapons[math.random(#weapons)]
           SpawnPrefab(weapon).Transform:SetPosition(pt1.x, 0, pt1.z)
        end
    end )
    bandit:AddComponent("combat")
    bandit.components.combat:SetDefaultDamage(20)
    bandit.components.combat:SetAttackPeriod(1)
    bandit.components.combat:SetRetargetFunction(2, function(bandit)
        if not bandit.components.health:IsDead() then
            return FindEntity(bandit, 20, function(guy)
                return bandit.components.combat:CanTarget(guy) and not guy:HasTag("bandits")
            end )
        end
    end )
    bandit.components.combat.onhitotherfn = function(bandit, other, damage) bandit.components.thief:StealItem(other) end
    banditistenForEvent("attacked", function(bandit, data)
        bandit.components.combat:SetTarget(data.attacker)
        bandit.components.combat:ShareTarget(data.attacker, 30, function(dude) return dude:HasTag("bandits") and not dude.components.health:IsDead() end, 5)
    end )
    bandit.Physics:SetCollisionCallback(function(bandit, other)
        if other and other.components.workable and other.components.workable.workleft > 0 then
           other.components.workableestroy(bandit)
        end
    end)
    banditoPeriodicTask(1, function(bandit)
        local pos = Vector3(bandit.Transform:GetWorldPosition())
        local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 3)
        for k,v in pairs(ents) do
            if v.components.pickable and v.components.pickable:CanBePicked() then
               v.components.pickableick(bandit)
            end
            if v.components.crop then
               v.components.crop:Harvest(bandit)
            end
        end
    end )
    local minimap = bandit.entity:AddMiniMapEntity()
    minimap:SetIcon( "lucy_axe.png" )
    bandit:AddTag("monster")
    bandit:AddTag("bandits")
  end
end
local function delbandit(inst)
    local range = 3000
    local pos = Vector3(inst.Transform:GetWorldPosition())
    local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range)
    for k,v in pairs(ents) do
        if v:HasTag("bandits") then
           v:Remove()
        end
    end
end
    instistenForEvent( "daytime", function() createbandit(inst) end , GetWorld())
    instistenForEvent( "nighttime", function() delbandit(inst) end , GetWorld())
        inst.components.inspectable:RecordViews()

        inst:AddComponent("playerprox")
        inst.components.playerprox:SetDist(4,5)
        inst.components.playerprox.onnear = function()
                inst.AnimStateushAnimation("activate", false)
                inst.AnimStateushAnimation("idle_loop_on", true)
                inst.SoundEmitterlaySound("dontstarve/common/maxwellportal_activate")
                inst.SoundEmitterlaySound("dontstarve/common/maxwellportal_idle", "idle")

                instoTaskInTime(1, function()
                        if inst.ragtime_playing == nil then
                                inst.ragtime_playing = true
                                inst.SoundEmitter:PlaySound("dontstarve/common/teleportato/ragtime", "ragtime")
                        else
                                inst.SoundEmitter:SetVolume("ragtime",1)
                        end
                end)
        end
       
        inst.components.playerprox.onfar = function()
                inst.AnimState:PushAnimation("deactivate", false)
                inst.AnimState:PushAnimation("idle_off", true)
                inst.SoundEmitter:KillSound("idle")
                inst.SoundEmitter:PlaySound("dontstarve/common/maxwellportal_shutdown")

                instoTaskInTime(1, function()
                        inst.SoundEmitter:SetVolume("ragtime",0)
                end)
        end

        inst:AddComponent("activatable")
    inst.components.activatable.OnActivate = OnActivate
    inst.components.activatable.inactive = true
    inst.components.activatable.getverb = GetVerb
        inst.components.activatable.quickaction = true

    return inst
end

return Prefab( "common/adventure_portal", fn, assets)
回复 支持 反对

使用道具 举报

0

主题

94

帖子

107

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1070
积分
107
精华
0
注册时间
2013-10-25
5899#
发表于 2014-2-22 19:02 | 只看该作者
yzzn2009 发表于 2014-2-22 16:12
只吸矿石功能太单一了,做出来估计很少会有人使用

或者改良一下,做成炼金室(用保温石种炼金室)点击点一下他获得一个金子,反正保温石也没什么用,已经有“温暖之国”了,还要他干嘛
回复 支持 反对

使用道具 举报

0

主题

94

帖子

107

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1070
积分
107
精华
0
注册时间
2013-10-25
5900#
发表于 2014-2-22 19:07 | 只看该作者
yzzn2009 发表于 2014-2-22 00:44
闲话两句:角斗场

那么,怎样改主角的攻击节奏(或者角斗场的另一个人的攻击节奏)
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5901#
 楼主| 发表于 2014-2-22 19:39 | 只看该作者
佟志伟 发表于 2014-2-22 18:50
宁哥,为什么我口袋猴子活捉的鸟什么的,不能拿出来就只能放在背包里看着,在背包里面点一下准备拿出来就消 ...

我用89685版没有出现问题,可以正常拿出来,是否与版本差异有关
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5902#
 楼主| 发表于 2014-2-22 19:44 | 只看该作者
1750820466 发表于 2014-2-22 18:56
我的红胡子海盗团,每次到冒险之门旁边的时候,让他们打几下,就自动跳出(没有警告)你看看哪里错了
fore& ...

显示的是乱码,看不清。如果你用的是89685版,可以用我修改好的“红胡子强盗团”文件,解压缩后复制到游戏目录

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5903#
 楼主| 发表于 2014-2-22 19:48 | 只看该作者
1750820466 发表于 2014-2-22 19:07
那么,怎样改主角的攻击节奏(或者角斗场的另一个人的攻击节奏)

保温石已经用来做“传送石”了,“角斗场”对手攻击节奏的语句为warrior0.components.combat:SetAttackPeriod(2),其中数字2改小则攻击加快
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5904#
 楼主| 发表于 2014-2-22 19:55 | 只看该作者
坑爹坑娘坑奶奶 发表于 2014-2-22 17:20
口袋蜂箱被我改成了口袋猪舍,能力是一样的。经测试口袋猪舍在包里显示猪舍图标,放在地上也是一个小猪舍, ...

改错比自己写还费时间,粗略看,主要是模型、贴图、播放动画名称有问题(包含SetBank、SetBuild、AnimStatelayAnimation的语句),并且一些标签貌似也与游戏自带标签重复了


回复 支持 反对

使用道具 举报

0

主题

184

帖子

154

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1536
积分
154
精华
0
注册时间
2013-7-23
QQ
5905#
发表于 2014-2-22 20:23 | 只看该作者
yzzn2009 发表于 2014-2-22 19:39
我用89685版没有出现问题,可以正常拿出来,是否与版本差异有关

哦哦,我用的是90423版的,有办法解决么,宁哥。
回复 支持 反对

使用道具 举报

4

主题

2998

帖子

2237

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
80
金元
19067
积分
2237
精华
1
注册时间
2010-11-27
5906#
 楼主| 发表于 2014-2-22 22:10 | 只看该作者
本帖最后由 yzzn2009 于 2014-2-22 22:13 编辑
佟志伟 发表于 2014-2-22 20:23
哦哦,我用的是90423版的,有办法解决么,宁哥。

90423版和89685版在游戏物品等方面没有任何不同,都是22版,只是官方一直在小修小补,但往往捅出更多bug,如果你不想用89685版,只能暂时先不修改“鲜果龙树”等几项,我一直在等官方DLC出来,或许游戏版本又会有变化,一些被禁用的技术或许会开解,到时修改技巧会针对新版本作全面兼容优化
回复 支持 反对

使用道具 举报

0

主题

46

帖子

95

积分

初级玩家

Rank: 2

贡献度
0
金元
952
积分
95
精华
0
注册时间
2009-12-15
5907#
发表于 2014-2-23 07:34 | 只看该作者
有木有办法让地图里没有鸟!   小电配置低种多了蜘蛛巢玩久了小鸟一出现就卡,想让鸟永远不来了~~鸟带来的种子每次看到还老手贱总要捡,如果看不到就不会捡了 哈哈哈
回复 支持 反对

使用道具 举报

0

主题

94

帖子

107

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1070
积分
107
精华
0
注册时间
2013-10-25
5908#
发表于 2014-2-23 08:37 | 只看该作者
yzzn2009 发表于 2014-2-22 19:44
显示的是乱码,看不清。如果你用的是89685版,可以用我修改好的“红胡子强盗团”文件,解压缩后复制到游 ...

我是22版
回复 支持 反对

使用道具 举报

0

主题

94

帖子

107

积分

中级玩家

Rank: 3Rank: 3

贡献度
0
金元
1070
积分
107
精华
0
注册时间
2013-10-25
5909#
发表于 2014-2-23 08:39 | 只看该作者
yzzn2009 发表于 2014-2-22 19:48
保温石已经用来做“传送石”了,“角斗场”对手攻击节奏的语句为warrior0.components.combat:SetAttackPe ...

反正做个点它就会出来金子的撒
回复 支持 反对

使用道具 举报

1

主题

61

帖子

120

积分

中级玩家

Rank: 3Rank: 3

贡献度
1
金元
1160
积分
120
精华
0
注册时间
2014-2-21
5910#
发表于 2014-2-23 10:22 | 只看该作者
宁哥。。。我修改的红胡子打不死而且只能看到地上的黑影子!!这是怎嘛回事?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2025-2-24 12:01 , Processed in 0.204060 second(s), 16 queries , Memcache On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表