Jump to content

Haydenmango

Members
  • Posts

    434
  • Joined

  • Last visited

Everything posted by Haydenmango

  1. Changing my weapons shape was what I thought would fix this problem but it doesn't. My issue still occurs whether I change my weapons shape or not. Here is my code so you may understand what is happening-- --pickup code if window:KeyHit(Key.G) then if (App.world:Pick(self.camera:GetPosition(),Transform:Point(0,0,self.useDistance,self.camera,nil),pickInfo,0,true)) then if pickInfo.entity.script then if pickInfo.entity.script.weapon then if self.carryingEntity==nil and self.weapon~="torch" then if self.weaponentity~=nil then self.weaponentity.script:Drop() end self.weaponentity=pickInfo.entity self.weapon=self.weaponentity.script.name self.weaponentity:SetShape(nil) --you can comment this out and the problem still occurs self.weaponentity:SetMass(0) self.weaponentity:SetCollisionType(Collision.None) self.weaponentity:SetPosition(self.palm:GetPosition(true)) self.weaponentity:SetRotation(self.palm:GetRotation(true)+self.weaponentity.script.rotation) self.weaponentity:SetParent(self.palm) self.weaponentity:SetShadowMode(0) end end end end end --drop code function Script:Start() self.shape=self.entity:GetShape() self.shape:AddRef() end function Script:Drop() self.entity:SetParent(nil) self.entity:SetShape(self.shape) --you can comment this out and the problem still occurs self.entity:SetMass(self.mass) self.entity:SetCollisionType(Collision.Prop) self.entity:SetShadowMode(1) end
  2. So I have a player and a weapon. I pickup the weapon by parenting it to my entity. I drop the weapon by calling weaponentity:SetParent(nil) and then it drops like it should. My problem is that the weapons collision shape doesn't change back to normal when it drops. I imagine that it keeps the shape it inherited from its parent. It is hard to describe so I added a video to show what's going on. If anyone knows what I can do to fix this let me know. I have tried to change the weapons shape back to its original shape when it is dropped but that hasn't worked. --video https://www.youtube.com/watch?v=woqWma6JJUQ
  3. One way I can think of doing this is giving all of your collision objects a unique mass like 2.2. Then the script would look like this- if mass==2.2 then self.carryingEntity=pickinfo.entity elseif mass>0 and mass<=self.carryweight etc. That would make any object with a mass of 2.2 usable though so be careful with that method...it can get kind of messy. edit--im tired and my previous suggestion actually doesn't make that much sense. I am guessing that your collision objects have a mass of 0 and that is why they are unusable? or are they hidden? If they have a mass of 0 you could give them a script with something like Script.object=true then change your fpsplayer script to check for it like-- if pickinfo.entity.script then if pickinfo.entity.script.object==true then self.carryingEntity=pickinfo.entity end end local mass=pickinfo.entity:GetMass() ..etc if your object isn't to complex just do what rick suggested below.
  4. It should still work. I have a box that uses 5 "collision" objects to create the physics for the box and I can pick it up using the pickup system. You might have to hide the "collision" objects that are parented to your entity so that your pick hits the entity and not the "collision" object. That worked for me at least and it kept the physics I wanted even though the objects were hidden.
  5. I started having this issue before I even used a terrain. I had a giant BSP box for the ground and things still fell through. No matter how thick the box was entities would still fall through. It did happen less often then it does when I am using terrain but it still happens nonetheless. Also I am using leadwerks terrain and I don't think there is a way to just thicken the terrain.
  6. Good idea. I may make an attempt at that as I still am having this issue. Scaling everything up didn't work because Character Controller physics wouldn't scale with everything else. Scaling up the throwing objects didn't solve the issue either.
  7. oh geez I feel dumb now. Next time I'll search harder before posting noob questions. Thanks. I tried using sharpen with soften mipmaps and it doesn't seem like they counter each other but I still don't fully understand these features so I'm not sure what to look for.
  8. Noob question: What does the soften mipmaps option on textures actually do?
  9. Looks like a good start! Eventually I will have to tackle GUIs as well and I only have Lua (so I can't use tjheldnas ). I will keep track of your progress (if you post updates on this) and learn from your learning!
  10. That's a nice looking GUI you got going there Patrik. *thumbs up* (reached my like limit today) Little update on The Hunt For Food (game I'm working on). I added a Terrain and made my rabbits follow the terrain using the Align to Ground script by Beo6. thanks Beo6! More info in the short video and video desciption. update video- align to ground script link- http://leadwerks.wikidot.com/wiki:align-to-ground
  11. Sorry, old post but... Does PhysicsDriver::GetCurrent()->virtual void SetCollisionResponse(const int collisiontype0, const int collisiontype1, const int response); work in Lua? I tried converting the code but it isn't working for me. This would be super useful for a game I am working on at the moment.
  12. Well I learned something today! I've only been using pick::entity so far for whatever reason. This information could be useful in the documentation because I would still be using Entity::Pick over Camera::Pick as there is no way to tell that Entity::Pick 'shouldn't be used by the end user, except in special cases.'
  13. I may be totally misunderstanding you and if I am then disregard this. But the Entity::Pick() function works pretty much the same as the Camera::Pick(). The only difference I can see is the option for x and y coordinates for the screen(while using camera pick) and the option for Vec3 starting pos and Vec3 ending pos(while using entity pick).
  14. I noticed you are using the Camera pick function. You can set the Pick distance when you use the entity pick instead- http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitypick-r158 might be worth testing out to see if it goes any quicker but it sounds like you got it working pretty good.
  15. Awesome, thanks for clearing that up for me Rick!
  16. I could do that but the thing is the log is the least of my worries. I have much smaller models (rocks,food,etc.) that I have to account for as well so it seems everything just needs to be bigger.
  17. Thanks Rick that actually makes a lot more sense then using Release(). A bit off topic but when trying to get a Script to run do you have to call App.script:Function() or does App:Function() just work?
  18. I think it may have to do with Calling:Clear() on your current World and creating a new one for your new map. Check out this code below. if self.mapnum==1 then self.mapnum=0 self.currentmapnum=1 self.world:Clear() Map:Load("Maps/Fight Fire with Fire.map") elseif self.mapnum==2 then self.mapnum=0 self.currentmapnum=2 self.world:Clear() Map:Load("Maps/Save the Trees 2.map") end It's kind of hard to tell with the example you gave though. Maybe if you also showed the App.lua I could get more insight as to what is going on.
  19. Hmm I may have to scratch my game idea if this is the case.... most of the combat in my game was based around throwing objects at enemies. The log you see in the example video was going to be the slowest and probably one of the bigger thrown weapons. Hmmm I just had an interesting thought though.... What if I scaled everything up a good amount so that the objects still look small but are actually pretty big??? hmmmmmm... Thank you for the responses!
  20. I agree that documentation could be useful for this function as I am not completely sure what values work. Just a guess but maybe 1 would be static and 2 would be dynamic. Not sure how lights work but judging from cassius' post it's probably something similar like self.model:SetShadowMode(Light.Static) or self.model:SetShadowMode(Light.Dynamic).
  21. Yeah that is werid because that example is way more extreme than mine. What is even more weird is that entities still go through the ground in my example even with SetPhysicsDetail() set to exact(0)! I even made a completely new map with SetPhysicsDetail(0) in the App start and then I made a script that turns on SweptCollisionMode and added it to a couple entities with varying masses(.5,1,and 3). The model the entities used was the small crate model from the tutorial maps. I also changed the throw force in the FPSPlayer.lua script to 2000*entity:GetMass(). So far I haven't seen an entity with a mass of 3 fall through the floor but entities with a mass of .5 or 1 almost always fall through the floor. --i take this back after making the throw force 2000*entity:GetMass() every single object I throw eventually falls through the ground no matter the mass.
  22. When you throw a small entity (with rigidbody physics, above 0 mass, swept collision mode on or off, and a generated or convex hull physics shape) the entity will sometimes fall right through the ground (whether the ground is a imported model, terrain, or BSP box). The throwing script I use is a slightly modified version of the FPSplayer.lua script. I made a video to help show the problem. https://www.youtube.com/watch?v=NYBlJxsM04k
  23. Those particles look awesome! I really like the how the fire looks and the other ones (on far right and far left) look like they could be used for some spell-casting or trippy outer space effects. Good job and keep it up!
×
×
  • Create New...