Jump to content

Lunarovich

Members
  • Posts

    166
  • Joined

  • Last visited

Everything posted by Lunarovich

  1. Here, I have cubes made out of brushes with scripts attached to every cube: It works really neat in the game. Just as expected. I can turn on/off individual cubes with camera mouse picking. If I make a prefab out of the single cube (made using CSG, ie. brushes), it still works as intended. However, it does not work with models (even if I attach scripts to them). This agrees with what Josh has said: But why does it work then with prefabs (with scripts attached)? Aren't prefabs made out of brushes internally turned into models? And finally, why does it work with individual pieces of CSGs with scripts attached? P.S. Josh, thanks for this nice framework. Really enjoying it! Haven't found a 3D framework so transparent and so easy to use, but still not simplistic a bit... And I've tried a lot of them
  2. Yeah, adding scripts effectively solved the issue with models (EDIT: with prefabs made out of brushes) as well as with brushes. Thanks! Is there some logical reason why adding scripts would help in this case? Does adding script do some under the hood "individualization" of the object? If yes, in what exactly consists this individualization? P.S. Sorry for philosophical terms. I'm a philosopher by profession
  3. I've tried to release a cube upon picking it, and the engine released every other connected cube. It probably has to do something with the way brushes work. I'm testing the behavior on the models right now... Just tested it. I get the same behavior with models and with prefabs.
  4. Hello! I'm puzzled by the SetMaterial() behavior. I have a scene with randomly disposed cubes made in the editor. When I do the mouse pick on a cube, I check its material, and switch/toggle the material of the cube. I have two separate materials, one with and the other without the emission texture/shader. Now, when I pick the closest cube and toggle its material, some of the other cubes (but not all) get the same material. Sometimes only one cube switches material, sometimes two or more. Everytime the same group of cubes react to the single cube picking/material setting, so apparently that's not something random. For the sake of completeness, I have tried to make individual cubes both with brushes and CTRL-axis drag & drop. The result is similar. Now, I suppose that this behavior has something to do with the Entity:Instance() VS Entity:Copy(). But could be totally wrong N.B. I use the closest entity option in the Pick routine. Here is my pick routine: local window = Window:GetCurrent() local context = Context:GetCurrent() if (window:MouseHit(1)) then local pickinfo = PickInfo() if (self.camera:Pick(context:GetWidth() / 2, context:GetHeight() / 2,pickinfo,0,true)) then if (pickinfo.entity:GetMaterial() == self.blokMatNormal) then pickinfo.entity:SetMaterial(self.blokMatEmissive) else pickinfo.entity:SetMaterial(self.blokMatNormal) end end end
  5. @Olby I agree completely. I've started using Leadwerks only yesterday. Learned a bunch of things in a day (Lua syntax, engine program's flow and API basics). Never seen an engine so transparent, so logical and yet not sipmlistic. Best engine I've used so far, definitely. That said, editor feels really clunky. No window autofocus on tab switch (always have to focus a window with a additional mouse click), as you've said, no autocomplete, even the CTRL - arrows for text navigation does not work as is case with every text editing app that I know! I've started using Atom io with a lua-language package. The only downside is that it does not color semantically valid constructs.
  6. Hello! This one's driving me crazy. I can't simply understand why I get an attempt to call method 'setPosition' (a nil value) et the entity:setPosition(spawnPos) This two lines print(entity:GetKeyValue("name")) print(self.respawnPoint:GetKeyValue("name")) give me a desired output: Player name Spawn point name Here is the code... Script.respawnPoint = "" --entity "Respawn point" function Script:Collision(entity, position, normal, speed) if (entity:GetKeyValue("name") == "Player") then spawnPos = self.respawnPoint:GetPosition() print(entity:GetKeyValue("name")) print(self.respawnPoint:GetKeyValue("name")) entity:setPosition(spawnPos) end end It seems to me that in the editor everything is setup correctly:
×
×
  • Create New...