_Kilburn
27 Aug 2006, 15:22
Hi, i'm almost sure that nobody will answer my question but... I'm trying to make some funny game modes by modifying stdvs.lua. And I made a simple function that spawns a crate at a random position:
function lib_QuickSpawnCrate(CrateContainerData)
SendMessage("GameLogic.ResetCrateParameters")
SetData("Crate.Type", CrateContainerData.Type)
SetData("Crate.Contents", CrateContainerData.Contents)
SetData("Crate.NumContents", CrateContainerData.NumContents)
SetData("Crate.Index", CrateContainerData.Index)
SetData("Crate.LifetimeSec", CrateContainerData.LifetimeSec)
SetData("Crate.GroundSnap", CrateContainerData.GroundSnap)
SetData("Crate.Parachute", CrateContainerData.Parachute)
SetData("Crate.Spawn", CrateContainerData.Spawn)
SetData("Crate.FallSpeed", CrateContainerData.FallSpeed)
SetData("Crate.Gravity", CrateContainerData.Gravity)
SetData("Crate.TeamDestructible", CrateContainerData.TeamDestructible)
SetData("Crate.TeamCollectable", CrateContainerData.TeamCollectable)
SetData("Crate.UXB", CrateContainerData.UXB)
SetData("Crate.Hitpoints", CrateContainerData.Hitpoints)
SetData("Crate.Pushable", CrateContainerData.Pushable)
SetData("Crate.RandomSpawnPos", CrateContainerData.RandomSpawnPos)
SetData("Crate.CanDropFromChute", CrateContainerData.CanDropFromChute)
SetData("Crate.WaitTillLanded", CrateContainerData.WaitTillLanded)
SetData("Crate.TrackCam", CrateContainerData.TrackCam)
SetData("Crate.Scale", CrateContainerData.Scale)
SetData("Crate.AddToWormInventory", CrateContainerData.AddToWormInventory)
SetData("Crate.CustomGraphic", CrateContainerData.CustomGraphic)
SendMessage("GameLogic.CreateCrate")
end
But how can I spawn a crate at a wanted position? I found a Crate.ExplicitSpawnPos property in Local.xml, but it is a VectorResource, so I can't modifiy it, neither with SetData, nor with EditContainer.
GetData("Crate.ExplicitSpawnPos") and QueryContainer("Crate.ExplicitSpawnPos") return nil. (nil is a Lua value which means NULL)
I dumped all variables with "for key,value in pairs(getfenv()) do ... end" and i don't see any function with "Vector" in its name. :(
And i would like the same thing for creating particle emitters, explosions and triggers.
If someone answers to my question, it would be extraordinary... :rolleyes:
function lib_QuickSpawnCrate(CrateContainerData)
SendMessage("GameLogic.ResetCrateParameters")
SetData("Crate.Type", CrateContainerData.Type)
SetData("Crate.Contents", CrateContainerData.Contents)
SetData("Crate.NumContents", CrateContainerData.NumContents)
SetData("Crate.Index", CrateContainerData.Index)
SetData("Crate.LifetimeSec", CrateContainerData.LifetimeSec)
SetData("Crate.GroundSnap", CrateContainerData.GroundSnap)
SetData("Crate.Parachute", CrateContainerData.Parachute)
SetData("Crate.Spawn", CrateContainerData.Spawn)
SetData("Crate.FallSpeed", CrateContainerData.FallSpeed)
SetData("Crate.Gravity", CrateContainerData.Gravity)
SetData("Crate.TeamDestructible", CrateContainerData.TeamDestructible)
SetData("Crate.TeamCollectable", CrateContainerData.TeamCollectable)
SetData("Crate.UXB", CrateContainerData.UXB)
SetData("Crate.Hitpoints", CrateContainerData.Hitpoints)
SetData("Crate.Pushable", CrateContainerData.Pushable)
SetData("Crate.RandomSpawnPos", CrateContainerData.RandomSpawnPos)
SetData("Crate.CanDropFromChute", CrateContainerData.CanDropFromChute)
SetData("Crate.WaitTillLanded", CrateContainerData.WaitTillLanded)
SetData("Crate.TrackCam", CrateContainerData.TrackCam)
SetData("Crate.Scale", CrateContainerData.Scale)
SetData("Crate.AddToWormInventory", CrateContainerData.AddToWormInventory)
SetData("Crate.CustomGraphic", CrateContainerData.CustomGraphic)
SendMessage("GameLogic.CreateCrate")
end
But how can I spawn a crate at a wanted position? I found a Crate.ExplicitSpawnPos property in Local.xml, but it is a VectorResource, so I can't modifiy it, neither with SetData, nor with EditContainer.
GetData("Crate.ExplicitSpawnPos") and QueryContainer("Crate.ExplicitSpawnPos") return nil. (nil is a Lua value which means NULL)
I dumped all variables with "for key,value in pairs(getfenv()) do ... end" and i don't see any function with "Vector" in its name. :(
And i would like the same thing for creating particle emitters, explosions and triggers.
If someone answers to my question, it would be extraordinary... :rolleyes: