安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题








Where'd you find the game.brokenvoxels variable, by the way?
I got it from the games challengeMayhem.lua function, as that game mode works based on how many destroyed voxels you have.
It's a pretty useful little trick to play with on a few things.
no clue if you are still here @Dev
but I made a small modification that leads to the object being destroyed once hitting the ground/ something else
it is far from perfect but imo looks much better when for example breaking Lee Chemical tower as it only gets destroyed when hitting the ground/ a building instead of breaking to bits the moment you cut it from the ground
code explanation:
I give the bodies that are broken (would be blown up in your original code) a tag that stores the velocity and once that velocity changes (decreases) below 0.1 of the max velocity, the breaking actually starts
the code is here:
local body = GetShapeBody(shape)
if body then
local mass = GetBodyMass(body)
local broken = IsBodyBroken(body)
local vector_vel = GetBodyVelocity(body)
local vector_len = VecLength(vector_vel)
local mass_modi = mass / 60000.0
local is_vehicle = GetBodyVehicle(body)
if is_vehicle == 0 then
if vector_len > 2 then
if mass > 500 and broken == true then
--evtl. lieber RIchtung statt Geschwindigkeit -> Richtungsaenderung
if not HasTag(body, "vela") then
SetTag(body, "vela", vector_len)
else
if tonumber(GetTagValue(body, "vela")) < vector_len then
SetTag(body, "vela", vector_len)
end
end
end
end
end
if HasTag(body, "vela") then
if vector_len < (tonumber(GetTagValue(body, "vela")) * 0.1) then
local bodyTransform = GetBodyTransform(body)
local mini, maxa = GetShapeBounds(shape)
local c = VecLerp(mini, maxa, math.random())
local cross = VecSub(mini, maxa)
local size_multi = mass / 5.0
MakeHole(c, size_multi, size_multi / 2.0, size_multi / 5.0)
-- DebugCross(cross)
-- DebugLine(bodyTransform.pos, cross, 1, 0, 0)
if GetBool("savegame.mod.dust") then
ParticleReset()
ParticleType("smoke")
ParticleColor(0.6, 0.55, 0.5)
ParticleDrag(0.15)
ParticleGravity(-.2)
for i = 50,1,-1
do
ParticleRadius(4.0)
local spread = math.floor(math.random() * (1000 - 1) + 1000) / 1000;
local v = VecScale(VecAdd(spread, rndVec(1.0)), 8)
v = VecAdd(v, VecScale(GetBodyVelocityAtPos(body, c)))
local l = rnd(10*0.5, 10*1.5)
SpawnParticle(c, v, l)
end
end
end
end
end
end
end
end[/code]
once that is done I will come back to teardown modding and will most likely upload my modified code. I have some other ideas I want to implement first though
would be great to see what improvements you can make.
i did so a little bit but I am not finished
and I am lacking motivation and time right now
sry