[url]http://www.youtube.com/watch?v=KLhKccri6cM[/url] video :D
something weird happends.. i don't know what it is :/
[lua]
function SaveMap()
local EntsToSave = { "prop_physics" }
local SavingEnts = { }
for k, ent in pairs(ents.GetAll()) do
if table.HasValue( EntsToSave, ent:GetClass() ) then
local class = ent:GetClass()
local pos = ent:GetPos()
local ang = ent:GetAngles()
local mdl = ent:GetModel()
table.insert(SavingEnts, { Class = class, Pos = pos, Ang = ang, Mdl = mdl })
end
end
file.Write("map_data.txt", glon.encode(SavingEnts))
end
concommand.Add("SaveMap",SaveMap)
function BuildMap()
local EntsToSpawn = glon.decode(file.Read("map_data.txt"))
for k, v in pairs(EntsToSpawn) do
local ent = ents.Create(v.Class)
ent:SetModel(v.Mdl)
ent:SetPos(v.Pos)
ent:SetAngles(v.Ang)
ent:Spawn()
ent:SetMoveType(MOVETYPE_NONE)
end
end
concommand.Add("BuildMap",BuildMap)
[/lua]
The video is not giving us any useful information, please tell us what the problem is.
[QUOTE=Wizard of Ass;32607139]The video is not giving us any useful information, please tell us what the problem is.[/QUOTE]
there is no errors giving, it runs on serverside.. it seems to the props are spawned twice.. one visible on invisible :s
[editline]3rd October 2011[/editline]
[img]http://img204.imageshack.us/img204/1769/bugbeg.png[/img]
so i tried to save a prop above the ground, when it spawn there is one visible and one invisible, it's like the invisible dropping down :/ video comming!
[url]http://www.youtube.com/watch?v=x97f9g6NDn4[/url]
as you se in the video the invisible one falls right to the ground, if i try to push it it moves.. :P i try to jump on the top of it and it make some weird glitches
it seems to
[lua]
ent:SetMoveType(MOVETYPE_NONE)
[/lua]
is making the bug.. :'(
also i added this right after spawning :)
[lua]
ent:Activate()
local phys = ent:GetPhysicsObject()
if phys:IsValid() then phys:Wake() end
[/lua]
fixed with this
[lua]
phys:EnableMotion(false)
[/lua]
Sorry, you need to Log In to post a reply to this thread.