Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. xtreampb did a decent demo in LE2 showing exactly what you are wanting: http://www.leadwerks.com/werkspace/files/file/387-castle-defense-demo/
  2. +1 but no reason to stop there... add buttons for adding cameras, particle emitters, listeners, etc...
  3. Or set a custom collision response for the floors and the raycast. Then the raycast will only interact with the floor. example-code: Collision.MyFloors = 24 Collision:SetResponse(Collision.Character,Collision.MyFloors,1) floor:SetCollisionType(Collision.MyFloors) Collision.MyPick = 25 Collision:SetResponse(Collision.MyFloors, Collision.MyPick, 1) or just set the walls to Collision.Prop, and give the pick a custom collisiontype that only interacts with the floors having a collisiontype of scene or set the walls to have a pickmode of 0 --- it really depends on what you want to have interaction with and what kind of interaction you want objects in your scene to have with each other
  4. If the oil barrel has a prop collisiontype, and you set the raycast's collsiontype to prop or character then the pick will be always be true. In LE2 there was an issue with animated characters blocking the character controller from raycasts which is why you had to use hitboxes. I believe Josh made a video for the LE3.0 prototype at one point showing the same thing.
  5. Are you by chance colliding with the entity that you are using as the initial point for the pick? Either you have to move the starting point of the raycast away from the entity or you have to set the entity's pickmode to 0.
  6. I'm confused... which one is it? If the pick is set to character then it should be successful when hitting an entity with a prop collisiontype based on the collision response table. When the pick's collisiontype is not set then it will collide with any pickable entity. Example script that shows what I am talking about: function App:Start() self.window = Window:Create() self.context = Context:Create(self.window) self.world = World:Create() self.camera = Camera:Create() self.camera:Move(0,0,-4) self.light = DirectionalLight:Create() self.light:SetRotation(35,35,0) self.model1 = Model:Box() self.model1:SetPosition(-2,0,0) self.model1:SetPickMode(Collision.None) self.model2 = Model:Box() self.model2:SetPosition(2,0,0) self.model2:SetCollisionType(Collision.Prop) self.toggle = 1 return true end function App:Loop() if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end if self.model1:GetPosition().y > 2 then self.toggle = -1 elseif self.model1:GetPosition().y < -2 then self.toggle = 1 end self.model1:Translate(0,0.03*Time:GetSpeed()*self.toggle,0) local pickinfo = PickInfo() local p0 = self.model1:GetPosition() d0 = self.camera:Project(p0) local p1 = Transform:Point(6, 0, 0, self.model1, nil) local pick = self.world:Pick(p0,p1,pickinfo,0,true,Collision.Character) if pick then d1 = self.camera:Project(pickinfo.position) else d1 = self.camera:Project(p1) end Time:Update() self.world:Update() self.world:Render() self.context:SetBlendMode(Blend.Alpha) self.context:SetColor(1,0,0,1) self.context:DrawText("Pick: "..string.format("%s", pick),0,20) self.context:DrawLine(d0.x,d0.y,d1.x,d1.y) self.context:SetColor(1,1,1,1) self.context:SetBlendMode(Blend.Solid) self.context:Sync() return true end Change the pick's collisiontype to 'Collision.LineOfSight' and you will see that it doesn't return successful - just like it should according to the collision response table. If you remove the pick collisiontype parameter, it will return successful with any pickable entity.
  7. If memory serves from LE2, the collisiontype you set for a pick is just like setting the collisiontype for an entity. So setting the Pick's collisiontype to character should return true (successful) since the default collision response is for characters to collide with props. See the collision response table for reference: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778
  8. what does the uniform 'lightdirection' in the directionallight shader return?
  9. +1 Agree with an additional suggestion to be able to grab this information via code in lua. Right now there doesn't appear to be a way to get a loaded map's terrain (or its resolution or its meters per tile)... though you can get some of this info if you create your own terrain via code.
  10. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/world/worldsetambientlight-r505
  11. The problem is due to the mdl animations that do not have a skin mesh associated with them. Right now the only way to add/load animations in the model editor is for the loaded animation to have a surface/mesh. This is not intended as it wasn't this way for LE2 and when brought up to Josh last week, it wasn't supposed to be that way for LE3. The only thing I could suggest at the moment is for you to either load all the animations into the character using third party tools or for you export each animation with a skin from mixamo then load them into the character using the LE3 model editor. As far as the resizing, I haven't had that problem scaling mixamo characters down, other than having to delete the version in my editor scene and then placing a new one in there after scaling in the model editor for it appear to take effect.
  12. Maybe a finished game that you want available to everyone else that has access to workshop, but things would start to get quite messy in the workshop if everyone started posting their test builds there. Use something like dropbox to share test builds with a select group of people.
  13. The example code located here works just fine and as a test I tried it on a model and it worked as well. You are not updating the surface AABB, normals, binormals, and tangents. sfc:Update() Other than that I would just suggest you 'System:Print' each value to make sure the values are what you expect. also on a side note, the forum allows you to put code into code tags which makes reading code easier on old guys like myself. Look for the '<>' icon on the toolbar. --Edit you need to update several things - which is covered by Surface:Update() instead of just surface:UpdateAABB()
  14. thanks for sending the model - i will take a look and forward you a script.
  15. I would try it with a radius of 0 to see. -edit -- I assume pk has been defined as PickInfo pk = PickInfo() also it might be failing because it doesnt know what to do with pk.entity.script.xxx... try: local pk = PickInfo() ... self.hitmark = pk.triangle self.srfc = pk.surface self.hitnorm = pk.normal then perform the getVertexTriangle as just: pk.srfc:GetVertexTriangle(self.hitmark,i)
  16. Hmmm offhand i would guess that its GetTriangleVertex just because that matched LE2's command - but you never know. You could try a System:Print(self.hitmark) to see what that value actually is... maybe you are picking the value of CountTriangle when GetTriangleVertex is actually indexed from 0 to (CountTriangle-1). edit - Have you tried the example code to see if that works? also, how are you getting the surface? how is self.srfc defined?
  17. Ok - well the good news is that there has been an answer to this; the bad news is that apparently there isn't a default buffer per say... even though Buffer:GetCurrent() above is grabbing something and the docs mention buffers in several places with one actual script function having a buffer parameter. But in any case, unless you make your own buffer, there is only a context which is bound to a window for renderable space. And the context can only be written to without a possibility to actually grab from - at least as far as depth/color components go. So big changes from LE2 vs now in LE3. So no grabbing the depth or color or normal.of a main render window. And off hand there doesn't appear to be a way to grab the normal component of a buffer like we used to do in LE2- still waiting for an answer to that one actually
  18. Without code its hard to say, but if you are iterating through vertex index of the triangle, make sure you have the count right for CountTriangles --> 0 to CountTriangles()-1 like shown here: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/surface/surfacegettrianglevertex-r770 as for GetTriangleCorner - i dont see that command listed in the docs
  19. It looks good. Can GeoControl1 give similar output to be used in the same manner?
  20. There is an example of the sliding door script being used in the Tutorial: Switches and Events map. The video can be found here: and the tut is here: http://www.leadwerks.com/werkspace/page/tutorials/_/editor/switches-and-the-flowgraph-r104
  21. Sure anything is possible, but just be prepared to do some coding. You might want to look at the available video tutorials that might answer some of your questions:
  22. This reminds me of something... i think i am having deja vu... http://www.leadwerks.com/werkspace/topic/4503-framework-buffers-unavailable-in-lua/
  23. so similar to the 'iterations' parameter we had in LE2 that at one point needed to be increased due to issues with the terrain. documentation on this stuff would be nice.
  24. Well at least lua is showing the same results - which it should since its built off of the c++ implementation. Thanks for checking. What would be ideal is for Josh to give us maybe a direct variable like we had in LE2 like 'gbuffer'. I suspect that maybe the GetCurrent() is grabbing the BackBuffer?
×
×
  • Create New...