2DWorlds Forums
So apparently this crashes Box2D after a few seconds in MP. - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13)
+--- Thread: So apparently this crashes Box2D after a few seconds in MP. (/showthread.php?tid=9979)



So apparently this crashes Box2D after a few seconds in MP. - Qwertygiy - 09-02-2012

Otherwise, it appears to function normally. It makes lots of random circles around the specified player's name that vanish in 1/10th of a second after being created.

[lua]
local n = "Qwertygiy"
for q = 1, 100 do
sleep(0.1)
for w = 1, 3 do
local ball = create("Circle")
ball.Parent = game.World
ball.Name = "Sparkle"
ball.Collidable = false
ball.Radius = math.random(1, 3)
ball.Color = Color(math.random(0, 255), math.random(0, 255), math.random(0, 255))
ball.Position = game.World:getChild(n).Body.Position + Vec2D(0, 3) + Vec2D(math.random(-2.01, 2.01), math.random(-2.01, 2.01))
local s = create("Script")
s.Source = [[sleep(0.1) script.Parent:remove()]]
s.Parent = ball
end
end
[/lua]


RE: So apparently this crashes Box2D after a few seconds in MP. - Invader - 09-02-2012

jaycub
pls fix it


RE: So apparently this crashes Box2D after a few seconds in MP. - Jacob__mybb_import1 - 09-03-2012

This bug has been around for at least a year and a half... It shows up randomly in SP every few months, and I'm still not sure if it's a Box2D bug or my fault.

Adding each circle to the world after you set the properties and add a script might fix it, since it's less work for Box2D that way.