yzzn2009
发表于 2014-2-27 13:38
更新预告:二四二.强迫症标尺(按键盘Insert键在地上画坐标,方便建造、种植,再按Insert键消失)
按键盘Insert键,以主角为中心在地上画出白色坐标,可作为建造或种植的参照线,也可测量你现有的建筑、植物是不是歪了,强迫症必备,还有夜光效果哦,再按一次Insert键坐标消失
fjguest
发表于 2014-2-27 14:31
建议:二五一.磁悬浮建筑机器人(将针线包扔在地上自动建50块农田)
最好在 inst:StartThread(function()之后加上
inst.components.inventoryitem.canbepickedup = false
当建设完毕后后再设置成true
可以防止被橙色护身符自动吸取,导致出现多个针线包
yzzn2009
发表于 2014-2-27 14:50
fjguest 发表于 2014-2-27 14:31 static/image/common/back.gif
建议:二五一.磁悬浮建筑机器人(将针线包扔在地上自动建50块农田)
最好在 inst:StartThread(function()之 ...
感谢提醒,是我疏忽了,今晚的更新中会优化
佟志伟
发表于 2014-2-27 16:48
yzzn2009 发表于 2014-2-27 13:38 static/image/common/back.gif
更新预告:二四二.强迫症标尺(按键盘Insert键在地上画坐标,方便建造、种植,再按Insert键消失)
哇,宁哥,我爱你{:3_104:}
、恋☆Smile
发表于 2014-2-27 17:25
本帖最后由 、恋☆Smile 于 2014-2-27 22:02 编辑
请问宁哥,如何设置当饱食大于50%,生命逐渐恢复,且每秒恢复3点生命
还有如何让触手的再生时间缩短一些?
陈浩洋
发表于 2014-2-27 17:40
宁哥,把你修改好的90423的文件发给我行吗
fjguest
发表于 2014-2-27 20:12
本帖最后由 fjguest 于 2014-2-27 20:14 编辑
根据易宁的修改,改了一下 二五0.智能播种机器人(将独奏乐器扔在地上自动种100棵香蕉树)的代码,让其更加简洁,并可以设定种植的横纵数量,以及横纵间距。播种时按列播种,每0.5秒播种一次。其中plantspacex为x轴的间距(也就是列与列之间的距离),plantspacez 为z轴的间距(一列中植物之间的距离),plantnumx为x轴植物数量(列数)plantnumz为z轴植物数量(行数)。这里设定的是种植20棵数(plantnumx*plantnumz)
local function ondropped(inst)
local player = GetPlayer()
local plantspacex = 3
local plantspacez = 2
local plantnumx = 5
local plantnumz = 4
if player.components.inventory:Has("goldnugget", 50) then
player.components.inventory:ConsumeByName("goldnugget", 50)
RemovePhysicsColliders(inst)
inst.name = "cave_banana_tree"
inst.components.inventoryitem.canbepickedup = false
for k = 1 ,plantnumx do
inst:DoTaskInTime(1+0.5*plantnumz*(k-1)+k-1, function()
inst.task = inst:DoPeriodicTask(0.5, function()
inst.Physics:SetMotorVelOverride((-1)^(k+1)*plantspacez,0,(-1)^(k+1)*plantspacez)
inst.Physics:ClearMotorVelOverride()
player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup")
SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition())
end)
end)
inst:DoTaskInTime(1+0.5*plantnumz*k+k-1, function()
if inst.task then inst.task:Cancel() inst.task = nil end
player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup")
inst.Physics:SetMotorVelOverride(0-plantspacex,0,plantspacex)
inst.Physics:ClearMotorVelOverride()
end)
end
inst:DoTaskInTime(1+0.5*plantnumz*plantnumx+plantnumx, function()
inst.components.inventoryitem.canbepickedup = true
end)
end
end
inst:ListenForEvent("ondropped",ondropped)
43880757
发表于 2014-2-27 21:25
一段时间没网,来了看到宁哥又更新了这么多,宁哥辛苦了! 谢谢!
yzzn2009
发表于 2014-2-27 23:41
陈浩洋 发表于 2014-2-27 17:40 static/image/common/back.gif
宁哥,把你修改好的90423的文件发给我行吗
这是本周一发的修改好的文件http://pan.baidu.com/s/1gdHtxJ1
yzzn2009
发表于 2014-2-28 00:01
、恋☆Smile 发表于 2014-2-27 17:25 static/image/common/back.gif
请问宁哥,如何设置当饱食大于50%,生命逐渐恢复,且每秒恢复3点生命
还有如何让触手的再生时间缩短一些? ...
根据饥饿值决定是否回血需要自己写代码,见下面。触手不会再生,可以用修改技巧的“吃触手皮周围生触手”
主角饥饿值高于50%时,每秒回3点血(大力士不适用)
用记事本打开游戏目录\data\scripts\prefabs\player_common.lua文件,在inst:AddComponent("hunger")的下一行插入以下内容:
inst:ListenForEvent("hungerdelta", function(inst, data)
if inst.components.hunger.current > 75 then
inst.components.health:StartRegen(3, 1)
else
inst.components.health:StopRegen()
end
end )
、恋☆Smile
发表于 2014-2-28 00:07
谢谢。
请问如何修改在挖矿石时留下根基,在根据时间生长成大矿石?
触手居然是不可再生能源。。。。。看网上都说可以刷新的。。。。
yzzn2009
发表于 2014-2-28 00:08
本帖最后由 yzzn2009 于 2014-2-28 00:13 编辑
、恋☆Smile 发表于 2014-2-28 00:07 static/image/common/back.gif
谢谢。
请问如何修改在挖矿石时留下根基,在根据时间生长成大矿石?
触手居然是不可再生能源。。。。。看网 ...
你问的都是需要写代码的问题,不好意思,我实在没有时间了,你可以用修改技巧中的“找矿蜗牛”,勘探新石矿
、恋☆Smile
发表于 2014-2-28 00:10
yzzn2009 发表于 2014-2-28 00:08 static/image/common/back.gif
不好意思,我实在没有时间了
嗯嗯,您休息吧 您的帖子对我帮助很大 ,我自己摸索,有时间您在帮我看看
╰獨特Ge性
发表于 2014-2-28 00:21
yzzn2009 发表于 2014-2-27 13:38 static/image/common/back.gif
更新预告:二四二.强迫症标尺(按键盘Insert键在地上画坐标,方便建造、种植,再按Insert键消失)
这个最吸引眼球了。。。宁哥 我爱你
╰獨特Ge性
发表于 2014-2-28 00:33
宁哥二四二.强迫症标尺出来了 我想说的是 有没有可能在这个格子上下下五子棋啥的
噩噩V噩噩
发表于 2014-2-28 13:47
易宁哥,麻烦问下,物品扔在地上时显示图片的相关代码是什么。我做的mod里,把东西扔在地上后不显示图片。
yzzn2009
发表于 2014-2-28 14:15
本帖最后由 yzzn2009 于 2014-2-28 14:18 编辑
噩噩V噩噩 发表于 2014-2-28 13:47 static/image/common/back.gif
易宁哥,麻烦问下,物品扔在地上时显示图片的相关代码是什么。我做的mod里,把东西扔在地上后不显示图片。 ...
让物品在地上显示出来,需要设定物品的模型、贴图、动画,比如“溜溜球”,就是使用了下列语句
inst.AnimState:SetBank("bulb") 设定模型
inst.AnimState:SetBuild("bulb") 设定贴图
inst.AnimState:PlayAnimation("idle") 播放动画
但你不能直接套用,需要修改主语inst为你声明过的主语,并知道调用的模型名字(溜溜球使用的是荧光果的模型、贴图bulb),动画名称也要准确(溜溜球用的是闲置动画idle),这三句哪句的参数设定不对,都不会显示,建议多比对一下修改技巧中的条目
yzzn2009
发表于 2014-2-28 14:17
更新预告:二三三.警戒模式(按键盘F8键主角自动巡逻并战斗,再按F8键恢复手动控制,89685版及以后游戏使用)
按键盘F8键,开启主角警戒模式,CPU将接管你对主角的控制权,让主角自动巡逻并保护所在地区(夜晚站岗),一旦发现敌人,会自行战斗,由于主角的生命、脑、饥饿值已全部锁死,并且无惧寒冷和黑暗,所以你无须担心主角的安全。再次按键盘F8键即可恢复手动操作,并扣减一半饥饿值,注意及时补充食物。开启警戒模式前,请将身上的装备全部卸下,否则将掉落在地上
edwardsmithsoo
发表于 2014-2-28 14:27
你好,楼主,我已经来看你的贴很多次了,没想到你几乎每天都更新一次,这让我们广大玩家感到很高兴也很欣慰,有你这样勤奋而又努力的人对于我们是很幸福的事,所以谢谢你。
另外我想问一下,那个新版的饥荒应该快来了吧就是那个巨人的DLC什么的,好像变为春夏秋冬四个季节,还有其他新的物品动物什么的,到时估计代码改动又很大,不知道你还会不会继续更新下去,你这帖子也快一周年纪念日了,相信你应该会坚持下去吧,加油。
yzzn2009
发表于 2014-2-28 14:45
edwardsmithsoo 发表于 2014-2-28 14:27 static/image/common/back.gif
你好,楼主,我已经来看你的贴很多次了,没想到你几乎每天都更新一次,这让我们广大玩家感到很高兴也很欣慰 ...
感谢你的支持,才让我有动力坚持下去。如果官方升级版本中带有新内容,我们的修改技巧一定会做针对性优化的
╰獨特Ge性
发表于 2014-2-28 14:50
╰獨特Ge性 发表于 2014-2-28 00:33 static/image/common/back.gif
宁哥二四二.强迫症标尺出来了 我想说的是 有没有可能在这个格子上下下五子棋啥的 ...
额...又被宁哥无视了。。。是想法太奇葩了是吧= =
、恋☆Smile
发表于 2014-2-28 15:29
本帖最后由 、恋☆Smile 于 2014-2-28 15:38 编辑
请问怎么修改爆率?比如兔人的尾巴。
inst.components.lootdropper:SetLoot({"carrot","carrot"})
inst.components.lootdropper:AddRandomLoot("meat",3)
inst.components.lootdropper:AddRandomLoot("manrabbit_tail",1)
inst.components.lootdropper.numrandomloot = 1
inst.components.sleeper:SetDefaultTests()
end
为什么meat后面是3,在百科上的爆率90%
manrabbit_tail后面是1,在百科上的爆率是10%
这是个什么算法
Have.Fun
发表于 2014-2-28 15:30
易宁兄,请问能否使 黄昏和夜晚 也能响起 白天 干活时的“busy”音乐呢?
我对"dynamicmusic"文件进行修改,但都未能实现。
Have.Fun
发表于 2014-2-28 15:41
、恋☆Smile 发表于 2014-2-28 15:29 static/image/common/back.gif
请问怎么修改爆率?比如兔人的尾巴。
兔人掉落在 \data\scripts\prefabs\bunnyman.lua 里面
搜索以下
inst.components.lootdropper:SetLoot({"carrot","carrot"})
inst.components.lootdropper:AddRandomLoot("meat",3)
inst.components.lootdropper:AddRandomLoot("manrabbit_tail",1)
inst.components.lootdropper.numrandomloot = 1
以上表示必然会掉两个胡萝卜,另外一个物品,75%是大肉,25%是兔尾巴
如果改成下面这样
inst.components.lootdropper:SetLoot({})
inst.components.lootdropper:AddRandomLoot("carrot",1)
inst.components.lootdropper:AddRandomLoot("meat",3)
inst.components.lootdropper:AddRandomLoot("manrabbit_tail",1)
inst.components.lootdropper.numrandomloot = 2
以上表示无必然会掉的物品,而变成只掉两个东西,胡萝卜出率是20%,大肉60%,尾巴20%
、恋☆Smile
发表于 2014-2-28 16:10
Have.Fun 发表于 2014-2-28 15:41 static/image/common/back.gif
兔人掉落在 \data\scripts\prefabs\bunnyman.lua 里面
搜索以下
inst.components.lootdropper:Se ...
inst.components.lootdropper:SetLoot({})
inst.components.lootdropper:AddRandomLoot("carrot",1)
inst.components.lootdropper:AddRandomLoot("meat",3)
inst.components.lootdropper:AddRandomLoot("manrabbit_tail",1)
inst.components.lootdropper.numrandomloot = 2
这个百分比是怎么算出来的呢?
还有最后一行numrandomloot = 2是什么意思呢?
Have.Fun
发表于 2014-2-28 16:46
本帖最后由 Have.Fun 于 2014-2-28 17:01 编辑
、恋☆Smile 发表于 2014-2-28 16:10 static/image/common/back.gif
inst.components.lootdropper:SetLoot({})
inst.components.lootdropper:AddRandomLoot( ...
那个百分比是参考了以下资料的
http://dont-starve-game.wikia.com/wiki/Bunnyman
资料也写着猪人的掉落百分比也是大肉75%,猪皮25%
http://dont-starve-game.wikia.com/wiki/Pig
numrandomloot = 2 是除了必掉物品 SetLoot({}) 以外的随机战利品个数
Have.Fun
发表于 2014-2-28 16:50
资料也写着猪人的掉落百分比也是大肉75%,猪皮25%
http://dont-starve-game.wikia.com/wiki/Pig
1750820466
发表于 2014-2-28 16:53
为什么我用了你的已经改好的后,游戏就打不开了(没有警告)我又要重改了,555
Have.Fun
发表于 2014-2-28 16:55
╰獨特Ge性 发表于 2014-2-28 14:50 static/image/common/back.gif
额...又被宁哥无视了。。。是想法太奇葩了是吧= =
我觉得挺有趣的,还想拿红蓝宝石当棋子试试。
噩噩V噩噩
发表于 2014-2-28 16:56
易宁哥,我又来提问了,请问装备武器时让武器显示出来的相关代码是神马?
是不是
local function onequip(inst, owner)
owner.AnimState:OverrideSymbol("swap_object", "swap_spear", "swap_spear")
owner.AnimState:Show("ARM_carry")
owner.AnimState:Hide("ARM_normal")
end
local function onunequip(inst, owner)
owner.AnimState:Hide("ARM_carry")
owner.AnimState:Show("ARM_normal")
end
我修改了owner.AnimState:OverrideSymbol("swap_object", "swap_spear", "swap_spear") 中的中间的swap_spear,但是没能成功。(我想让装备照妖镜的时候,照妖镜在主角手中显示出来。)