Jump to content

Genebris

Members
  • Posts

    517
  • Joined

  • Last visited

Everything posted by Genebris

  1. No, it won't detect collisions then. At least it wasn't for me.
  2. Yes, I think so too, but in updateworld it doesn't work at all. Have just checked it again, in UpdateWorld the trigger lags like hell and flies away from the sword.
  3. Can't you also you sprites that were added in 3.3 Leadwerks version? They also can have collision like usual entities.
  4. I have made a simple collision based melee combat system, it seems to work fine, you can take it if you want. But I also have a question about it. As you can see on the video below, weapon collider moves with a small latency, can I do anything to make it follow weapon model faster? Or is it the best result I can get? (Sorry for the video quality) Here is the main code: The idea is very simple: when player equips sword the sword prefab is being loaded and attached to the hand bone. The sword prefab has a sword model and an extra object with collider (WeaponTrigger). Also there is a blood point in the prefab to create blood particles in it's coordinates, but that doesn't matter. In WeaponTrigger start function this entity is being separated from the sword model and in UpdatePhysics it's being moved to the sword model position. Obviously, when this trigger collides with something we can hurt it and stop attack animation.
  5. I have made this with this script form wikidot: http://leadwerks.wikidot.com/wiki:render-to-texture-security-cam Take the texture that this script creates and drw it in the interface.
  6. In code you set position in meters so I guess you are simply placing your prefabs too far away.
  7. Ok, so you were using Rick's weapon loading mechanism with with weapons that already have this mechanism programmed. In the end of the start function of FPSPlayer script you have these lines: if self.weaponfile~="" then local prefab = Prefab:Load(self.weaponfile) if prefab~=nil then if prefab.script~=nil then self:AddWeapon(prefab.script) else prefab:Release() end end end This is how loading of these weapons work (they have everything else in their start function). And this is what your LoadWeapon function should be. So I simply commented out your LoadWeapon function and added new one with this code. And I have commented out this code from player start function so the weapon won't be loaded at start twice. Here is the link to modified FPSPlayer.lua: http://pastebin.com/UNyPvtim
  8. Are you sure you have correct file path and correct prefab? "weapon file loaded" shows and it means something is loaded. If you want to use teamviewer ask Rick or someone else, I can't help you with that, sorry. Or send me the whole project dirrectory and I'll look into it tomorrow.
  9. Try replacing this: if self.weapon.offset~=nil then self.weapon.entity:SetPoint(self.weapon.offset) else self.weapon.entity:SetPosition(0,0,0) end with this: self.weapon.entity:SetPosition(0,0,100)
  10. There should be an output section in this grey window. You probably neeed to grag it from the right side of the vindow.
  11. Do you have "weapon file loaded" in console now?
  12. In WeaponPickup.lua you have entity.script.weaponfile = self.vmodel self.vmodel should be self.vModel (case sensitive). Line 28.
  13. Do you see "weapon file loaded" message in the output?
  14. It's "~=" in his video: http://youtu.be/VWBGtJ7NQ4Y?t=13m25s
  15. Your LoadWeapon function: function Script:LoadWeapon() --Load the default weapon, if one is set if self.weaponfile=="" then local entity = Prefab:Load (self.weaponfile) if entity ~=nil then System:Print("weapon file loaded") if entity.script~=nil then entity.script:Start() entity.script.player = self self.weapon = entity.script self.weapon.entity:SetParent(self.camera) self.weapon.entity:SetRotation(0,0,0) if self.weapon.offset~=nil then self.weapon.entity:SetPoint(self.weapon.offset) else self.weapon.entity:SetPosition(0,0,0) end end end end end The second line is: if self.weaponfile=="" then Shouldn't it be ~= instead of ==? Also, I suggest you making it like this: if self.weaponfile=="" then return end This will stop the function if wapon file path is empty.
  16. You are taking local camera position and it's always the same for camera. Use :GetPosition(true) and :SetPosition(place, true) to work with global position.
  17. In the beta 3.3 update you can do this by holding shift and dragging mouse.
  18. I simply did this to make my ingame console: for i=48, 90 do window:KeyHit(i) end
  19. Ok, shouldn't be a big problem, thanks for your help.
  20. This works, thank you. But I have a different problem now: my trigger now detects collision only with models, not with brushes. I have a default shelf model and a brush primitive. They both have collision type scene and GetCollisionType() returns 2 for both of them, but my trigger detects collision with brush only if it has mass or script attached. Can I do anything about it?
  21. I'm trying to make a trigger that will detect collisions with characters, scene and props, but it seems like trigger response type works only for characters. Collision:SetResponse(10, Collision.Scene, 2) Collision:SetResponse(10, Collision.Prop, 2) Collision:SetResponse(10, Collision.Character, 2) self.entity:SetCollisionType(10) This makes my entity work as trigger for characters, but it collides with props and scene. Using 1 as a third parameter makes it collide with everything, using 0 makes it collide with nothing. Is it a bug or intended? Or am I doing something wrong?
  22. Genebris

    Workshop Design

    Would love to see it as you described here. I find current Workshop completely unusable.
  23. There is this thread: http://www.leadwerks.com/werkspace/topic/10865-does-rakknet-work-with-lua/page__hl__raknet__st__20
  24. For me your model seems to move just like in blender. Check file that I exported. Also here is my own model that also works as it should. https://docs.google.com/file/d/0B5h7P9bq9NmIbXlCaUUxdU15ckU https://docs.google.com/file/d/0B5h7P9bq9NmITWhfTmU2cENhd2c
×
×
  • Create New...