Jump to content

wildcherrii

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by wildcherrii

  1. wildcherrii

    physic

    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 ?
  2. 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.
  3. 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.
  4. 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.
  5. 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 ?
  6. 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)
  7. 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..
  8. how to get a neg random number? Math:Random(-10,10) produces error for me
  9. 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.
  10. 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.
  11. 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?
  12. 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?
  13. 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.
  14. wildcherrii

    speed

    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.
  15. 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.,
  16. Oh I might as well throw this in, in case some other person has this happen to them - I found a work around, not sure it's conditional but for now it seems to work - emt_eff1 = Emitter:Create() emt_eff1:Release() emt_eff1=Prefab:Load("Prefabs/smoke.pfb") emt_eff1:Pause()
  17. Well its crazy, I honestly can't believe no on else has posted anything on this. emt_eff1 = tolua.cast(emt_eff1,"Emitter") emt_eff1=Prefab:Load("Prefabs/smoke.pfb") ctext (emt_eff1:GetClassName()) This returns Emitter as the class type. But if I call any commands on the emitter Pause() or Resume() then it errors out saying "Attempt to call method 'Pause' a nil value." If I set the emitter to play and loop in the editor then load it with the above code it works fine, I just cant reference it be any command without an error. How have people been loading prefab emitters this long without any reports on the forums?
  18. Hello again. Will someone please point me towards a working Animated Particle example ? I need to get this done badly but cant find any forum search on it and the demos are non existant. God only knows what it is that Google returns for search criteria these days.
  19. Hi thanks for your reply. I've tried the fps code prior to posting but I think something is wrong internally. To test this I made a blank project, in the MAIN.LUA script ( top level ), before the main While/Do loop i added this code - lo=Prefab:Load("Prefabs/Effects/smoke.pfb") lo:Play() then ran it, it does the same thing as my normal project, it says : "C:/Project/Scripts/Main.lua" : 17 : attempt to call method 'Play' (a nil value) The variable lo is not in a function but above the main while/do loop in main.lua so it's globally declared I would presume. Do i need to declare the variable as an Emitter:type or something ? Running a debug on the variable the text returned was showing a loaded entity - userdata: 0x0432dba8
  20. Edit: I wrote this loading code : if emit == null then emit=Prefab:Load("Prefabs/Effects/myeffect.pfb") emit:GetLoopMode() end But it returns "C:/myProject/scripts/util/snd.lua" : 17 : attempt to index global 'emit' (a nil value)
  21. I have some emitters I've made in the editor, I saved them as prefab. They dont attach to a map object or anything so I dont want to have them loaded up when the map loads but still i need to use them throughout my simulation. My question is that it is possible to load a emitter up via prefab in lua code? I sure dont want to have to code these emitters, if that were even possible. I couldnt find anything on loading premade emitters in code, just create(0 emitters which im trying to avoid.
  22. wildcherrii

    Skybox

    As hard as I've tried, I just cant seem to get any other skybox image but theone that LE has as default - to work. I've replicated the settings for the original but my skybox always comes out messed up looking. I've done tons of searches and read through a lot of messges here but nothing on the matter as to the save format or how to get my image into the editor and be positioned correctly. Can someone offer me a friendly nudge?
  23. When im in the world editor I click the script in the tree viee window. edit my script in a seperate window it pops up. when I run the code it closes the script window and puts me back in the world editor, I then have to go hunt up the script in the tree view and click it to reopen the editor, then find my place in the code again.. etc.. doing this 100 times a day is tidious. Was hoping there was a shortcut key to bounce from world editor to script editor.
  24. wildcherrii

    Editor

    Is there a shortcut or something to easily switch between the LUA editor and the main Map Entity editor ? have to hunt down the script in the tree view each time is really bothersome.
  25. Is there a method to paint a terrain without having to deal or worry about all the slope and height **** per layer? Really lose alot of detail by not being able to color splat a terrain freehand. As it stands I guess i'll have to bring in a terrain from external source. Also i dont suppose theres a way to apply alpha transparency to a model easily? and I need some kinda adivce off this thread
×
×
  • Create New...