
wildcherrii
Members-
Posts
27 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
wildcherrii's Achievements
Newbie (1/14)
0
Reputation
-
I have two box models set to box rigid body collision. I place both boxes on my map about 10 units above the terrain. When I run the map the first box falls and lands on terrain but the second box falls and goes through. This is the same prefab I'm using so the setup is identical. I've also spaced them apart so they dont initiated in the same space when created. How can I get this working properly ?
-
Is local ent = (camera:Pick(p.x,p.y,pickinfo,pickradius, true, 0)) To expensive to call per frame ? I notice a little lag spike when doing so, but how else can we detect when mouse is over an object? I cant have the mousehit(1) checked then do a pick in my situation.
-
Is there a way to make sure an animation sequence starts from the first frame of the sequence? I notice leadwerk like to pick up an animtion from the last stoping place, i need to assure my sequece gets starts from the first frame.
-
how to make my character control NOT collide with and vice versa with another entity, not all entites, just a few I put on the map. My player is walking into his own land mines and blowing up, in the real world that is true but not in this game hehe.
-
My project has a Main.lua which acts as the controller for the game loop. I have a import("scripts/pre-cache.lua") which I use to load up imgs, sounds and other prefabs that each and every map uses. But theres a serious flaw. For example : This is the pre-cache.lua that is imported from the main.lua script. It's attached to no entity or map object, it just holds the assets in a table for when they are needed. debris ={} debris.box = Model:Load("Models/Props/Land/box_01.mdl") Now, I have a box entity that is placed on the map via the editor, a simple script attached to it. Within that script I have this code - function Script:Start() self.de=debris.box:Copy() self.de:Show() Everything is fine and dandy when I run the map through, but when I go to change maps world:clear() and a map:load() things start to fall apart. The code works fine for a few times, I'm able to make a few additional copies of the box but then crash.. everythign freezes up and the window eventually closes. No error, even running in debug. This isn't the only thing that causes this error. If i create a pivot() or copy a snd, or worest yet - copy a prefabbed entity over, i get random lock ups that follow no pattern. To conveince myself this isnt an error on my part, i created a simple small project to test this and sure enough it does the same thing. Is copying/instancing global objects by map loaded entity scripts a NONO ?
-
Since my last few problems went unanswered, i assume no one knows the answer or its just some broke stuff in le, who knows. Im faced with a new problem now, possibly my last problem if I cannot get it solved. Im try to place an object, in this case a beach ball, on the map in my player hand. The beach ball is a prefab with a phycs rigid body since I need the collision data. Everything so far I described is fine, but here what I cannot figure out. Once i get the ball into the scene how do I rotate the ball to match my players rotation. If i use standard setrotation then i break physics. I need a starting orientation for this damn beach ball then i can apply velocity or force or whatever to make it go forward. This engine has been out for 12 yrs now, surely somehow a way to load a physics entity and set a starting rotation has be resolved? This is what i came up with so far local item=Model:Load("Models/Misc/damnbeachball.mdl") local pos = glo.player:GetPosition() item:SetMass(0) item:SetPosition(pos) item:SetRotation(glo.player:GetRotation()) item:Move(0,.3,-.2) --- line up to his hand // bone local seems to be off and i cannot find any damn Tformvector commands in le item:SetMass(1) item:SetVelocity(0,0,-10,false)
-
I got a pivot in the world , I've attached a script to it, emit.lua function Script:Start() --small box self.box=Model:Box() end function Script:UpdateWorld() self.MonitorBox() end Function Script:MonitorBox() self.box:Turn(0,1,0) end ------------------------------------------------------------------------------------- Please for the love of God, explain to me why this returns a " attempt to index field "box" a nil value. Is it perhaps because Im using a custom named function? Am i not allowed to make a function ? hrmmmp Lua is such a ball slap, its horrible. Nothing ever happens twice the same way, constantly having to restructure functions or globals to get them to pick up elsewhere, then hope you don't break the entire code by changing the order to much.. blah blah..
-
how to get a neg random number? Math:Random(-10,10) produces error for me
-
It seems creating or instacing or copying a prefabbed emitter inside a Start() script of an entity causes everything to shut the hell down on loading a new map up. self.dust = tolua.cast(emitcache.dust:Instance(),"Emitter") If I comment this line out the map change goes through. I guess Im just not suppose to have particles in my project. 2 months solid trying different routes to get them 100% working and always a failure.
-
In my code, I'm trying to go from one map to another map ( zones ). I have it setup as so : local mapfile = System:GetProperty("map","Maps/"..fname ..".map") if Map:Load(mapfile)==false then emsg("error, no map file") ; return end Where fname is a variable passed to my MapLoad function. No matter what I try I continue to load the same map over and over. It always seems to be the same map thats loaded in the editor. My question is, is it possible to change maps from code once you start an initial map in the editor. My project loads map1.map then if I hit f12 in code it should load map2.map, but it keeps loading back to map1.map. Debugmode is of little use, all I get is the screen closes down, no way to even see where this error is occuring. Some where in the Map:Load() the entire process bottoms out, I get no errors, I get no warnings, just a closed window. This happens in debug and normal mode. Thats pretty much impossible to to try and fix not even know where to look at. The bottom of the editor screen I see this : Debug process connected. Error: Unknown client disconnected. Please some adivce on this, its got me worried.
-
Perfect, okay one last question and I think I can solve all my map changing woes. I load several prefabbed particle emitters throughout my map at certain times. ( via lua code ). Do these emitters die and release once they run out ? or do I need to track them as well and release them on map clear?
-
OKay thank you both for the answers., If I'm loading some assets in a Script:Start() function for an NPC like this - self.footsteps = Sound:Load("Sound/footsteps/running.wav") Do I need to manually remove these assets when Im changing map files even though world:Clear() is being called?
-
I'm wondering, if I have a map entity that loads in with a script, then the Function Start() of that entity script loads a Sound File, do I need to keep track of these additional loads for when I do a clearmap(0 and load a new level ? or does these extra resources get removed on a new map load? What exactly gets removed from a world:Clear() ??? Im stuck on one major problem, I have entity:EmitSound() playing some footstep sounds as the enemy approach me. I want to kill the looping footstep sound when he gets close to me then stops. I've done intense reading on the forums and I see others had this delima to but no solution was recolved? This posts were back in 2014 and some point to dead 404 pages. So basically I have to destroy the entire entity and reload it just to stop a looping 3d emited sound ? And to add to the FUN ! this is what the docs say regarding EmitSound parms. Parameters sound: the new pick radius to set. range: the new pick radius to set. volume: the new pick radius to set. pitch: the new pick radius to set. loopmode: the new pick radius to set. source: the new pick radius to set. Good times.
-
I would like to know why this happens to me for no reason at all. In the Start() script for my monster I give him a point to travel to with the default speed. self.ai.piv:GoToPoint(pos.x, pos.y, pos.z, 1.4, 1.0) later on in side the Updatephysics() loop I have need to change the monster speed. So i issue a new : self.ai.piv:GoToPoint(pos.x, pos.y, pos.z, 2.8, 2.0) But oh NO!!!! nothing happens, he traverses at the same speed. How stupid. Is this the normal way to increase and or decreases moving speed when using a gotopoint() command. If so why does it not work for me, theres nothing special going on in the code.
-
How do I stop an entity that is going to a point via ent:GoToPoint(x,y,z) I wan to break him off his route if something else happens, but he still keeps trying to make it to the goto point.,