Jump to content

Slastraf

Developers
  • Posts

    705
  • Joined

  • Last visited

Everything posted by Slastraf

  1. I am using gitkraken and having fun . Who reads this should try it out, too. Its for handling git stuff easier.
  2. very nice. Have you figured out my scripts ?
  3. Faces are made of verticles which are connected by edges , which are filled by the face. You can only see it from one side, thus the name. if you want to make a corridor which you can see from both sides you need to keep this in mind from start. The problem is that the mesh algorithm for create physics mesh thinks this is a solid normal model. if you go with the camera inside the model (in LE) you can see trough it. The face is "facing" outside := the normals are pointing outwards. If you want to have a proper collision mesh you need to somehow make faces that are on the inside and have normals looking inside. In blender, you can use the "Solidify" modifier to make this happen. It will make the mesh both inside and outside, with faces for each side.
  4. u need to uv unwrap the cube , go in edit mode select all faces and press u or search for "unwrap" then makle a new material and select texture to material
  5. use 2.7 then open blend file with 2.8
  6. The art style is taking shape
  7. Can I get a reply by everyone who will be able to do anything Project related sometime soon ? Aiaf and me made much progress in the last week. I would be happy if some of you got time soon. We are also rewriting the game design document, and have some solid plans. (Some of them like fps hands + animation and some atttacks already there). Also otherwise Design related improvements that make the game easier for us to make and more playable and fun.
  8. It was fixed. Please ignore / remove this thread
  9. Maybe make a new fps project and try out the default crawler and so on there ? Because I didn't experience so bad behaviour yet.
  10. Call needs to be a global function. So far you have Call in the Script as a local function. To make it global paste it in main.lua , maybe somewhere at the top : function Call(entity,extra) --not use function Script:... because it is a global function System:Print("See "..tostring(entity:GetKeyValue("name"))) end
  11. function Script:CastRay(other) local sprite = Sprite:Create() sprite:SetViewMode(6) local p0 = self.entity:GetPosition(true) local p1 = other:GetPosition(true) self.allignvector = p0 - p1 sprite:SetPosition((p0+p1)/2) sprite:AlignToVector(self.allignvector:Normalize(),2) -- Find distance between the two points. local total_distance = p0:DistanceToPoint(p1) -- Modify the size of the beam based on the 2 points. -- Argument #1 is beamwidth, default .25 sprite:SetSize(.25, total_distance) end Here the script again , inside a function where other (in the parameter) is an entity. Also used LE Math functions to make it run much faster.
  12. I found this which could possibly help, but did not test it yet: Update: I added a post there, with my edition of the script.
  13. Update : Player does not have turbo mode, but can charge electricity spheres by holding a button, and realeasing it sooner will do less damage. For anyone not using discord, prototype already implemented.
  14. What would be the best way to make a raycast between two points visible ? It is needed for a mechanic inside the game (no debug DrawLine) local selfpos = self.entity:GetPosition(true) sprite:SetPosition(selfpos+(other:GetPosition(true)-selfpos)*Vec3(0.5, 0.5, 0.5)) So far I came up with this. In this case other is an entity at the second point. It will place an object in the middle of the two Points. The question is how I rotate the model (plane) that it looks toward the Camera without many lines of code, and be reasonable efficient ? And then how do I scale it so that it will have its edges at each point ?
  15. I have not exactly tested this, but if you put this in a n update function it will crash, so after it gets called often times when the value should be very low, probably 0 but it should not at exactly 0. Perhaps with a number that has too many bits from too many decimal places
  16. if self.face:GetScale().x > 0.001 then local newscale = Math:Lerp(self.face:GetScale().x,0,.1) self.face:SetScale(Vec3(newscale,newscale,newscale)) end If you set the scale of a model to a value with many decimal places, LE will crash without warning. Code snippet above will crash without if case
  17. Okay so for everyone who has the same problem in the future, I fixed this by just transforming the origin point and then adding vectors to make each min and max, as josh said. -- activate currently selected spell --working code if window:KeyHit(Key.Q) then --local model1 = Model:Box() --local model2 = Model:Box() local p1 = Transform:Point(0,0,2.5, self.camera, nil) local pMin = p1 + Vec3(-2,-2,-2.4) local pMax = p1 + Vec3(2,2,2.5) --model1:SetPosition(spellPointMin) --model2:SetPosition(spellPointMax) local aabb = AABB(pMin, pMax) world:ForEachEntityInAABBDo(aabb,"Callback") end
  18. Do you mean take only the middle point from the Transform:Point() function and then add / substract to make the vectors ? Or do you mean some function I dont know of yet.
  19. No I have not, but I don't use cpp because I wouldn't know how to set it up. Although if its really necessary I could. There is no documentation on debugAABB also ?
  20. I think this counts as bad behaviour on leadwerks engine side, I posted this thread and so far haven't been able to solve it:
  21. If I make an aabb in front of the player's camera like this : if window:KeyHit(Key.Q) then --local model1 = Model:Box() --local model2 = Model:Box() local spellPointMin = Transform:Point(-2,-2,0.1, self.camera, nil) local spellPointMax= Transform:Point(2,2,5, self.camera, nil) --model1:SetPosition(spellPointMin) --model2:SetPosition(spellPointMax) local aabb = AABB(spellPointMin, spellPointMax) world:ForEachEntityInAABBDo(aabb,"Callback") end I believe it will work in the standard fpsplayer script, and it uses various functions like ForEachEntity which should call the global "Callback" function on an entity the callback function looks as follows (and works): function Callback(entity,extra) --this function needs to be global, for the aabb in the player script (Somewhere around ...Key.Q... line) if (entity:GetClass()==Object.ModelClass) then if(entity:GetKeyValue("type") == "movEntity") then entity:SetColor(1,0,0) end end end And to make a moveable Entity detect I set a key value as above to the entity. It works all fine, but only sometimes. When I walk toward an object with the KeyValue and constantly press q, nothing happens. However if I then move, and press q again, it works fine. If the angle is right (it sometimes will never work under certain angles no matter if its obfuscated or not) Here is a video : 2019-02-07 22-21-18.mp4 Thats it. I hope someone can help me solve this problem, and its not a bug.
  22. I made an aabb infront of the camera to check what could be in front of it, but I cant figure out how to do this in lua. so far I have this: if window:KeyHit(Key.Q) then local spellPointMin = Transform:Point(-2,-2,0,self.camera,nil) local spellPointMax= Transform:Point(2,2,5,self.camera,nil) local aabb = AABB(spellPointMin, spellPointMax) world:ForEachEntityInAABBDo(aabb,"PushSelf") end the vectors for the aabb are fine, but the code snippet does not work as expected. I have a function PushSelf on an object inside the aabb box. I guess you cant use it like this ? Ah I understood that the parameter is a global function, and entity is the collided object.
  23. if you would go to the learn section, soon you would know. But anyway I will give you a start. make a script on the trigger and put this at the top: Script.pivot = nil --entity "Cam Tp Pivot" --pivot the camera teleports to Script.enabled = true then in the scene drag the pivot in there now in the collision function, which is called every time something collides with it, even if its a trigger, put this: function Script:Collision(entity, position, normal, speed) if self.enabled then if(entity:GetKeyValue("type") == "player")then if(self.pivot) then entity.script.camera:SetPosition(self.pivot:GetPosition(true)) entity.script.camera:SetRotation(self.pivot:GetRotation()) end end end end you can read it line by line, it s pretty self explainatory. the entity in the function paramter is everything that collides with the trigger. This would work if the camera is referenced in the player. But I dont know where your camera is in the scene, youcould use this to find it: self.camera = world:FindEntity("Camera")
  24. mabye you could have only one camera in the scene, and make a pivot object with the rotation and position of the second camera. And then move the first camera to the pivot rotation and position when the player hits the trigger. And maybe store a reference to the pivot in each trigger, so that you can choose later when you have alot of camera changes
×
×
  • Create New...