mysxxxx
发表于 2013-8-30 18:01
本帖最后由 mysxxxx 于 2013-8-30 18:55 编辑
yzzn2009 发表于 2013-8-30 01:03 static/image/common/back.gif
回复:mysxxxx
采草时有一定概率跑出兔子
很有用!:handshake求教为什么我修改petals_evil.lue插入local function OnDeploy (inst, pt)
local flower_evil = SpawnPrefab("flower_evil")
if flower_evil then
flower_evil:PushEvent("growfromflower_petals_evil")
flower_evil.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
以后连游戏都打不开了?
小涛丶
发表于 2013-8-30 18:02
能不能添加 荧光果种荧光草
mysxxxx
发表于 2013-8-30 18:07
yzzn2009 发表于 2013-8-30 01:03 static/image/common/back.gif
回复:mysxxxx
采草时有一定概率跑出兔子
3+取随机数×3这代表的几率是多少?为什么取随机数后还要×3+3?
打死、烤肉酱
发表于 2013-8-30 18:21
对了有没有用蘑菇种洞穴里的大蘑菇的修改
yzzn2009
发表于 2013-8-30 18:27
打死、烤肉酱 发表于 2013-8-30 17:01 static/image/common/back.gif
就是假如你要造一个三本机器可是有些地方不让造会显示红色可不可以把东西改的都想墙一样在哪都能造,顺便 ...
是不是这个意思
一.建造机器零距离(可以挨着建造)
用记事本打开游戏目录\data\scripts\recipes.lua文件,
1.将下列内容:
Recipe("researchlab", {Ingredient("goldnugget", 1),Ingredient("log", 4),Ingredient("rocks", 4)}, RECIPETABS.SCIENCE, TECH.NONE, "researchlab_placer")
Recipe("researchlab2", {Ingredient("boards", 4),Ingredient("cutstone", 2), Ingredient("goldnugget", 6)}, RECIPETABS.SCIENCE,TECH.SCIENCE_ONE, "researchlab2_placer")
替换为:
Recipe("researchlab", {Ingredient("goldnugget", 1),Ingredient("log", 4),Ingredient("rocks", 4)}, RECIPETABS.SCIENCE, TECH.NONE, "researchlab_placer",1)
Recipe("researchlab2", {Ingredient("boards", 4),Ingredient("cutstone", 2), Ingredient("goldnugget", 6)}, RECIPETABS.SCIENCE,TECH.SCIENCE_ONE, "researchlab2_placer",1)
2.将下列内容:
Recipe("researchlab4", {Ingredient("rabbit", 4), Ingredient("boards", 4), Ingredient("tophat", 1)}, RECIPETABS.MAGIC, TECH.SCIENCE_ONE, "researchlab4_placer")
Recipe("researchlab3", {Ingredient("livinglog", 3), Ingredient("purplegem", 1), Ingredient("nightmarefuel", 7)}, RECIPETABS.MAGIC, TECH.MAGIC_TWO, "researchlab3_placer")
替换为:
Recipe("researchlab4", {Ingredient("rabbit", 4), Ingredient("boards", 4), Ingredient("tophat", 1)}, RECIPETABS.MAGIC, TECH.SCIENCE_ONE, "researchlab4_placer",1)
Recipe("researchlab3", {Ingredient("livinglog", 3), Ingredient("purplegem", 1), Ingredient("nightmarefuel", 7)}, RECIPETABS.MAGIC, TECH.MAGIC_TWO, "researchlab3_placer",1)
二.用芦苇种植芦苇(分株移植)
用记事本打开游戏目录\data\scripts\prefabs\cutreeds.lua文件,在inst:AddComponent("inspectable")的下一行插入下列内容:
local function OnDeploy (inst, pt)
local reeds = SpawnPrefab("reeds")
if reeds then
reeds:PushEvent("growfromcutreeds")
reeds.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
即可用芦苇种植芦苇(分株移植),如果原来的芦苇根不想留,用火炬烧掉即可
三.洞穴花用铲子移除得灯泡:用记事本打开游戏目录\data\scripts\prefabs\flower_cave.lua文件,
1.在下列内容的下一行:
local prefabs =
{
"lightbulb"
}
插入以下内容:
local function dig_up(inst, chopper)
inst.components.lootdropper:SpawnLootPrefab("lightbulb")
inst:Remove()
end
2.在inst:AddComponent("inspectable")的下一行插入以下内容:
inst:AddComponent("workable")
inst.components.workable:SetWorkAction(ACTIONS.DIG)
inst.components.workable:SetOnFinishCallback(dig_up)
inst.components.workable:SetWorkLeft(1)
四.用灯泡种洞穴花:用记事本打开游戏目录\data\scripts\prefabs\lightbulb.lua文件,在inst:AddComponent("tradable")的下一行插入以下内容:
local function OnDeploy (inst, pt)
local flower_cave = SpawnPrefab("flower_cave")
if flower_cave then
flower_cave:PushEvent("growfromlightbulb")
flower_cave.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
yzzn2009
发表于 2013-8-30 18:29
仙露 发表于 2013-8-30 17:49 static/image/common/back.gif
宁哥,请问那个杀蝴蝶得黄油的几率在哪,我给忘了……
杀蝴蝶50%几率掉黄油:用记事本打开游戏目录\data\scripts\prefabs\butterfly.lua文件,将inst.components.lootdropper:AddRandomLoot("butter", 0.1)替换为inst.components.lootdropper:AddChanceLoot("butter", 0.5)
其中0.5是机率50%
yzzn2009
发表于 2013-8-30 18:33
mysxxxx 发表于 2013-8-30 18:01 static/image/common/back.gif
很有用!求教为什么我修改flower.lue插入local function OnDeploy (inst, pt) local flowe ...
文件找错了,不是修改flower.lua文件,而是修改花瓣petals.lua文件
六十六.花瓣种花(花可移植)
用记事本打开游戏目录\data\scripts\prefabs\petals.lua文件,在inst:AddComponent("tradable")的下一行插入下列内容:
local function OnDeploy (inst, pt)
local flower = SpawnPrefab("flower")
if flower then
flower:PushEvent("growfrompetals")
flower.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
即可用花瓣种花
yzzn2009
发表于 2013-8-30 18:37
小涛丶 发表于 2013-8-30 18:02 static/image/common/back.gif
能不能添加 荧光果种荧光草
一.洞穴花用铲子移除得灯泡:用记事本打开游戏目录\data\scripts\prefabs\flower_cave.lua文件,
1.在下列内容的下一行:
local prefabs =
{
"lightbulb"
}
插入以下内容:
local function dig_up(inst, chopper)
inst.components.lootdropper:SpawnLootPrefab("lightbulb")
inst:Remove()
end
2.在inst:AddComponent("inspectable")的下一行插入以下内容:
inst:AddComponent("workable")
inst.components.workable:SetWorkAction(ACTIONS.DIG)
inst.components.workable:SetOnFinishCallback(dig_up)
inst.components.workable:SetWorkLeft(1)
二.用灯泡种洞穴花:用记事本打开游戏目录\data\scripts\prefabs\lightbulb.lua文件,在inst:AddComponent("tradable")的下一行插入以下内容:
local function OnDeploy (inst, pt)
local flower_cave = SpawnPrefab("flower_cave")
if flower_cave then
flower_cave:PushEvent("growfromlightbulb")
flower_cave.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
yzzn2009
发表于 2013-8-30 18:49
mysxxxx 发表于 2013-8-30 18:07 static/image/common/back.gif
3+取随机数×3这代表的几率是多少?为什么取随机数后还要×3+3?
这是一个不确定机率,随机数不断出现,但要出兔子,需要这个随机数小于0.1,否则导致兔子不断出。不好意思,我曾反复强调,不解答重新设计游戏和做mod的问题,因为一是这些问题需要消耗大量时间,我希望多一些时间能解答大家的实际需要。二是这些问题比较专业,对大量玩家没有实际意义。我们可以探讨一些具体修改例子,这样别人看到也有帮助,希望你能理解
小涛丶
发表于 2013-8-30 18:56
yzzn2009 发表于 2013-8-30 16:40 static/image/common/back.gif
制造牛角:用记事本打开游戏目录\data\scripts\recipes.lua文件,在Recipe("purplegem", {Ingredient("re ...
弄不了了弄了就说什么数据丢失 结果我弄了 崩溃了 又要重新下载 重头改了
mysxxxx
发表于 2013-8-30 18:59
yzzn2009 发表于 2013-8-30 18:49 static/image/common/back.gif
这是一个不确定机率,随机数不断出现,但要出兔子,需要这个随机数小于0.1,否则导致兔子不断出。不好意 ...
嗯没事,大大已经帮了我们很多了
mysxxxx
发表于 2013-8-30 19:01
yzzn2009 发表于 2013-8-30 18:33 static/image/common/back.gif
文件找错了,不是修改flower.lua文件,而是修改花瓣petals.lua文件
六十六.花瓣种花(花可移植)
修改的文件是我打错了:L,花的修改是我多加了“S” ,这个问题已经解决(不好意思哈,麻烦了大大),不过恶魔花这样改会连游戏都打不开,求教大大local function OnDeploy (inst, pt)
local flower_evil = SpawnPrefab("flower_evil")
if flower_evil then
flower_evil:PushEvent("growfromflower_petals_evil")
flower_evil.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
fanjun17
发表于 2013-8-30 19:11
四十七.全人物可制造伍迪的斧子(8下砍倒1棵树,普通斧子15下) 我的是18版
这里怎么玩改后,制作斧头后直接掉快捷栏哪里就不见了,是不是和我改格子有关 我现在用55格MOD
yzzn2009
发表于 2013-8-30 19:13
打死、烤肉酱 发表于 2013-8-30 18:21 static/image/common/back.gif
对了有没有用蘑菇种洞穴里的大蘑菇的修改
用树杈种蘑菇树:用记事本打开游戏目录\data\scripts\prefabs\mushrooms.lua文件,在inst.AnimState:PlayAnimation(data.animname.."_cap")的下一行插入以下内容:
local function OnDeploy (inst, pt)
local mushtree_tall = SpawnPrefab("mushtree_tall")
if mushtree_tall then
mushtree_tall:PushEvent("growfromtwigs")
mushtree_tall.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
yzzn2009
发表于 2013-8-30 19:19
小涛丶 发表于 2013-8-30 18:56 static/image/common/back.gif
弄不了了弄了就说什么数据丢失 结果我弄了 崩溃了 又要重新下载 重头改 ...
我实测了,没有问题啊。你玩的是不是18版以前的版本,如果是,语句格式不一样
打死、烤肉酱
发表于 2013-8-30 19:28
yzzn2009 发表于 2013-8-30 18:27 static/image/common/back.gif
是不是这个意思
理解有定错误,就是建造东西时有很多限制,比如这建不了哪建不了可是修改之后所有物品可以不受地点的限制想在哪建就在哪建,就是强制建造
yzzn2009
发表于 2013-8-30 19:33
mysxxxx 发表于 2013-8-30 19:01 static/image/common/back.gif
修改的文件是我打错了,花的修改是我多加了“S” ,这个问题已经解决(不好意思哈,麻烦了大大),不过 ...
用恶魔花瓣种恶魔花:用记事本打开游戏目录\data\scripts\prefabs\petals_evil.lua文件,在inst:AddComponent("inventoryitem")的下一行插入以下内容:
local function OnDeploy (inst, pt)
local flower_evil = SpawnPrefab("flower_evil")
if flower_evil then
flower_evil:PushEvent("growfrompetals_evil")
flower_evil.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
hala1020
发表于 2013-8-30 19:36
瑞士手杖 逆天了!!!@
yzzn2009
发表于 2013-8-30 19:42
fanjun17 发表于 2013-8-30 19:11 static/image/common/back.gif
四十七.全人物可制造伍迪的斧子(8下砍倒1棵树,普通斧子15下) 我的是18版
这里怎么玩改后,制作斧头后直 ...
一种可能是没有修改完全,下面的“2.用记事本打开游戏目录\data\scripts\prefabs\lucy.lua文件”这条没有修改,导致制造出后自动被删除。另一种可能是,其他mod用到了lucy.lua文件,导致在原文件修改无效,需要修改mod中的lucy.lua文件
四十七.全人物可制造伍迪的斧子(8下砍倒1棵树,普通斧子15下)(18版及以后版使用)
1.用记事本打开游戏目录\data\scripts\recipes.lua文件,在Recipe("razor", {Ingredient("twigs", 2), Ingredient("flint", 2)}, RECIPETABS.TOOLS,TECH.SCIENCE_ONE)的下一行插入Recipe("Lucy", {Ingredient("twigs", 4), Ingredient("goldnugget", 4)}, RECIPETABS.TOOLS,TECH.SCIENCE_ONE)
2.用记事本打开游戏目录\data\scripts\prefabs\lucy.lua文件,将下列内容:
inst:AddComponent("sentientaxe")
inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "woodie" then inst:Remove() end end)
替换为:
--inst:AddComponent("sentientaxe")
--inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "woodie" then inst:Remove() end end)
即可用4个树杈、4个金块在工具选项里制造伍迪的斧子
yzzn2009
发表于 2013-8-30 19:50
打死、烤肉酱 发表于 2013-8-30 19:28 static/image/common/back.gif
理解有定错误,就是建造东西时有很多限制,比如这建不了哪建不了可是修改之后所有物品可以不受地点的限制 ...
现在不能在某处建造,多半是由于与别的东西靠得太近导致的,我把距离设为1了,已经解决了这个问题。你说的还有什么地形限制?如果是海里,确实不能造,其他地点基本没问题啊
fanjun17
发表于 2013-8-30 19:57
yzzn2009 发表于 2013-8-30 19:42 static/image/common/back.gif
一种可能是没有修改完全,下面的“2.用记事本打开游戏目录\data\scripts\prefabs\lucy.lua文件”这条没有 ...
是我错了
2.用记事本打开游戏目录\data\scripts\prefabs\lucy.lua文件,将下列内容:
inst:AddComponent("sentientaxe")
inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "woodie" then inst:Remove() end end)
替换为:
--inst:AddComponent("sentientaxe")
--inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "woodie" then inst:Remove() end end)
前面的那两个"--" 没有写上,之前还以为你多加了,因为原来的没有这两个"--":lol
谢谢楼主啊
1150863194
发表于 2013-8-30 20:03
yzzn2009 发表于 2013-8-29 13:43 static/image/common/back.gif
具体要哪方面的修改呢,是种出食人花吗,还是不长食人花
一.用腐烂食物种食人花:用记事本打开游戏目录\d ...
支持,我还认为楼主不会理我。顶顶顶{:3_106:}
soushuba
发表于 2013-8-30 20:12
不争先生 发表于 2013-8-29 18:52 static/image/common/back.gif
谢谢、野生的高鸟蛋呢想直接捉野生的但二十几天了还是蛋
你先要在火堆旁烤裂开{:3_92:}
小涛丶
发表于 2013-8-30 20:20
yzzn2009 发表于 2013-8-30 19:19 static/image/common/back.gif
我实测了,没有问题啊。你玩的是不是18版以前的版本,如果是,语句格式不一样
...
我玩的是19版的
mysxxxx
发表于 2013-8-30 20:53
yzzn2009 发表于 2013-8-30 19:33 static/image/common/back.gif
用恶魔花瓣种恶魔花:用记事本打开游戏目录\data\scripts\prefabs\petals_evil.lua文件,在inst:AddCompo ...
原来是名称问题!谢谢大大!
yzzn2009
发表于 2013-8-30 21:16
小涛丶 发表于 2013-8-30 20:20 static/image/common/back.gif
我玩的是19版的
我实测也是19版,这条修改很简单,很难导致出现严重问题的。19版确实存在不少官方bug,修改前一定做好备份,但遇到坏档、游戏崩溃等问题,也只能从头再来了
不争先生
发表于 2013-8-30 21:44
角色的技能怎么修改比如机器人吃齿轮升级攻击力可以变强一段时间
不争先生
发表于 2013-8-30 22:49
帐篷使用次数增多怎么改
yzzn2009
发表于 2013-8-31 02:25
不争先生 发表于 2013-8-30 21:44 static/image/common/back.gif
角色的技能怎么修改比如机器人吃齿轮升级攻击力可以变强一段时间
主角技能可以参见修改技巧中
一.提高主角血量10倍
二.主角自动回血
三.主角自动补脑(妈妈再也不用担心我的学习)
四.主角不会饿
五.提高主角攻击力
六.主角跑得更快
七.全人物不用机器就可造全部物品(18版及以后游戏使用)
如果你想改写游戏就非常复杂了,我帮一个人做过一个,你可以参考一下
麦斯威尔吃噩梦燃料升级
1.用记事本打开游戏目录\data\scripts\prefabs\nightmarefuel.lua文件,在inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM的下一行插入以下内容:
inst:AddComponent("edible")
inst.components.edible.foodtype = "nightmarefuel"
inst.components.edible.healthvalue = TUNING.HEALING_HUGE
inst.components.edible.hungervalue = TUNING.CALORIES_HUGE
inst.components.edible.sanityvalue = TUNING.SANITY_HUGE
2.用记事本打开游戏目录\data\scripts\prefabs\waxwell.lua文件,在下列内容的下一行:
local prefabs =
{
}
插入以下内容:
local function applyupgrades(inst)
local max_upgrades = 15
local upgrades = math.min(inst.level, max_upgrades)
local hunger_percent = inst.components.hunger:GetPercent()
local health_percent = inst.components.health:GetPercent()
local sanity_percent = inst.components.sanity:GetPercent()
inst.components.hunger.max = math.ceil(TUNING.WX78_MIN_HUNGER + upgrades* (TUNING.WX78_MAX_HUNGER - TUNING.WX78_MIN_HUNGER)/max_upgrades)
inst.components.health.maxhealth = math.ceil(TUNING.WX78_MIN_HEALTH + upgrades* (TUNING.WX78_MAX_HEALTH - TUNING.WX78_MIN_HEALTH)/max_upgrades)
inst.components.sanity.max = math.ceil(TUNING.WX78_MIN_SANITY + upgrades* (TUNING.WX78_MAX_SANITY - TUNING.WX78_MIN_SANITY)/max_upgrades)
inst.components.hunger:SetPercent(hunger_percent)
inst.components.health:SetPercent(health_percent)
inst.components.sanity:SetPercent(sanity_percent)
end
local function oneat(inst, food)
if food and food.components.edible and food.components.edible.foodtype == "nightmarefuel" then
--give an upgrade!
inst.level = inst.level + 1
applyupgrades(inst)
inst.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup")
inst.HUD.controls.status.heart:PulseGreen()
inst.HUD.controls.status.stomach:PulseGreen()
inst.HUD.controls.status.brain:PulseGreen()
inst.HUD.controls.status.brain:ScaleTo(1.3,1,.7)
inst.HUD.controls.status.heart:ScaleTo(1.3,1,.7)
inst.HUD.controls.status.stomach:ScaleTo(1.3,1,.7)
end
end
local function onupdate(inst, dt)
inst.charge_time = inst.charge_time - dt
if inst.charge_time <= 0 then
inst.charge_time = 0
if inst.charged_task then
inst.charged_task:Cancel()
inst.charged_task = nil
end
inst.SoundEmitter:KillSound("overcharge_sound")
inst.charged_task = nil
inst.Light:Enable(false)
inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED
inst.AnimState:SetBloomEffectHandle( "" )
inst.components.temperature.mintemp = -20
inst.components.talker:Say(GetString("wx78", "ANNOUNCE_DISCHARGE"))
--inst.SoundEmitter:KillSound("overcharge_sound")
else
local runspeed_bonus = .5
local rad = 3
if inst.charge_time < 60 then
rad = math.max(.1, rad * (inst.charge_time / 60))
runspeed_bonus = (inst.charge_time / 60)*runspeed_bonus
end
inst.Light:Enable(true)
inst.Light:SetRadius(rad)
inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED*(1+runspeed_bonus)
inst.components.temperature.mintemp = 10
end
end
local function onload(inst, data)
if data then
if data.level then
inst.level = data.level
applyupgrades(inst)
--re-set these from the save data, because of load-order clipping issues
if data.health and data.health.health then inst.components.health.currenthealth = data.health.health end
if data.hunger and data.hunger.hunger then inst.components.hunger.current = data.hunger.hunger end
if data.sanity and data.sanity.current then inst.components.sanity.current = data.sanity.current end
inst.components.health:DoDelta(0)
inst.components.hunger:DoDelta(0)
inst.components.sanity:DoDelta(0)
end
if data.charge_time then
inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
onupdate(inst, 0)
inst.charged_task = inst:DoPeriodicTask(1, onupdate, nil, 1)
end
end
end
local function onsave(inst, data)
data.level = inst.level
data.charge_time = inst.charge_time
end
local function onlightingstrike(inst)
inst.charge_time = inst.charge_time + TUNING.TOTAL_DAY_TIME*(.5 + .5*math.random())
inst.components.health:DoDelta(TUNING.HEALING_SUPERHUGE,false,"lightning")
inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE)
inst.components.talker:Say(GetString("wx78", "ANNOUNCE_CHARGE"))
inst.SoundEmitter:KillSound("overcharge_sound")
inst.SoundEmitter:PlaySound("dontstarve/characters/wx78/charged", "overcharge_sound")
inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
if not inst.charged_task then
onupdate(inst, 0)
inst.charged_task = inst:DoPeriodicTask(1, onupdate, nil, 1)
end
end
在local function custom_init(inst)的下一行插入以下内容:
inst.level = 0
inst.charge_time = 0
inst.spark_time = 3
inst.components.eater.ignoresspoilage = true
table.insert(inst.components.eater.foodprefs, "nightmarefuel")
inst.components.eater:SetOnEatFn(oneat)
applyupgrades(inst)
yzzn2009
发表于 2013-8-31 02:29
不争先生 发表于 2013-8-30 22:49 static/image/common/back.gif
帐篷使用次数增多怎么改
帐篷使用次数增加10倍:用记事本打开游戏目录\data\scripts\tuning.lua文件,将TENT_USES = 6,替换为TENT_USES = 60,即可,想改多少次,就修改60这个数字