Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Everything posted by Rick

  1. What is your thinking here? If you have a script attached to a model the way your refer to that model from inside the script is self.entity. This assumes LE 3.x. The reason you saw nothing before was because self.model doesn't refer to anything so it's nil and you were setting the parent of the light to nothing/nil which means your light would have been at the center of your scene since you set it's position to 0,0,0. Is this a csg box? If so then it's position value is the center of the box. So your light would be inside the box shining outward but might look funky since it's inside the box. You'd want to offset it a little. For testing hardcode the offset, but you can get the bounding box of the csg box and split the width in 1/2 to be more accurate but for now I'd leave that for another day and just manually move it forward with Move() after you set it's parent.
  2. Do you get an error? What is self.model? If you want that to refer to the entity the script is attached to it's self.entity.
  3. You first need to get access to that entity somehow. Normally you'd make a script property that is of type entity like: Script.Target = nil ---entity And then drag the other entity into this position in the script tab. Now inside your script self.Target refers to that other entity and since that other entity has a script attach (assuming it does) you access that script and all of it's functions and variables via self.Target.script.VariableName or self.Target.script:Function(). The key is to get access to an entity first. You can also check if an entity even has a script attached by seeing if the .script variable is nil or not. if entity.script ~= nil then entity.script.variable = 5 end
  4. Note that I don't think your csg trigger can be touching anything. In your test scene if the pad is level with the ground setting to Trigger didn't work, but if I raised the pad so it's floating in air, it worked.
  5. @randomkeyhits As far as I know there is no torus csg, which is why I just use a cylinder in the center, but yes the rest of what you said is basically how I made it in the video. @bansama I'm not sure if you watched my video but your map is not like what I did in the video so you might not get the same results. (It's failing to load the script let me reset it and try) [EDIT] OK, yes this happens now, but all I can tell you is if you follow what I have in my video it works. If you change the pads to trigger and raise them off the ground a little so it's not touching the ground then it works just fine. So something with scene collision and the player that causes the Collision() callback to be called differently than a trigger.
  6. The script is attached to the pads but nothing is happening. Note that what you are doing isn't exactly what I do in my video. In my video I have separate cylinder csg in the middle of the pads set to trigger that act as the collision and transporter and the pads are just for visual. My advice is to follow my video linked above exactly and see if you see the issue. There might be something with collision callback when using scene vs trigger and moving/stopping. At least that is something for you try and test to keep debugging.
  7. When I run your map I don't have any trigger objects. The scene only has: Directional Light 2 Box 1 Pad 1 Pad 2 Pivot 2
  8. Rick

    EVE LBS Studio

    First rule of video game developer for newbies. Start small and build on that. Good luck in your game development!
  9. I wouldn't use multiple cameras as who knows what a pain will happen there. I'd use pivots as location/rotation markers and just move your 1 camera around to those pivots. I think an "unsupported" way is world:FindEntity(""). Not sure what it'll do if the same name exists with more than 1.
  10. So I took the script above and remove it to just be the below and it works fine for me. When I teleport and if I'm still touching the trigger I can move very small increments inside the trigger and stop and nothing happens. I then move out of the trigger and back in and I get teleported. I don't get what the problem is. In my example and what I did is make a pivot and set it as the player (collision type of character and physics mode of character controller, and attach the FPSPlayer.lua script to it). Are you doing something different maybe that's causing an issue? Script.entered = false Script.exited = false Script.hadCollision = false Script.Target = nil --entity Script.Enabled = true --bool function Script:UpdatePhysics() if self.entered then if self.hadCollision == false then if self.exited == false then self.exited = true self.component:CallOutputs("OnExit") self.Enabled = true self.entered = false end end end self.hadCollision = false end function Script:Collision(entity, position, normal) -- speed self.hadCollision = true self.component:CallOutputs("OnCollide") if self.entered == false then if self.Enabled == true then self.component:CallOutputs("OnEnter") self.Target.script.Enabled = false entity:SetPosition(self.Target:GetPosition()) -- Teleports end self.entered = true self.exited = false end end
  11. Really? I don't recall that happening at all. Are you saying when you get teleported and you move slightly but are still inside the trigger it'll say you've exited? If you don't move at all after teleportation does it do anything? [EDIT] You know what I recall doing. In my video I recall linking each teleporter via a script variable so that I can manipulate the other teleporters script variables because when you teleport over to the other one you have to set it's variable to prevent what you are talking about, and getting telported back. Did you watch the video because I think I go over that in there. I haven't watched it in some time but I recall having to do something like that. Linking each teleporter to each other, but I don't see that in your script.
  12. What would help is not having updates bring in the original files again if that file doesn't exist anymore. I delete files that the base LE project adds and when I update an existing project they are added back in. It should check if the file exists and if not just don't add it. Assume the reason it doesn't exist in an existing project is because the user deleted it, because that's probably the case. If not, the user can get it from another project or a new project and copy it over. Usually the first thing I do on a new project is delete all the stuff I don't want, but updates bring them back in it seems.
  13. I think you'd have to loop over the world->entities list to get all entities loaded (this will be via the map or manual load it doesn't matter. if it got loaded and a world was created it'll be part of that world). So basically you can make your own function like you describe if you like via this method.
  14. The idea is that the API is about 99% the same between both languages so one should be able to translate back and forth with not much effort.
  15. Did you compile in Release mode in VS? There is a drop down at the top to switch between the 2. The debug play button runs the debug build, and the Run button runs the release build. Also about seeing, do you have a camera in your scene? I can't recall if the C++ version has a camera or not.
  16. A prefab isn't an FBX file is it? I assume you aren't storing a prefab in the same format as an FBX file. So you can store a prefab however you want and do whatever you want with it. So if each instance of a prefab has the prefab filename in it, then when we save a prefab, you can loop over every prefab in the map and look for prefabs that have this prefab filename in it and update that instance to match the new prefab.
  17. I'm confused by this. If I save a prefab I would expect the name of the prefab or some kind of ID to be stored with it and all instances of it so that if I make a modification to the base prefab file, it can search for all the other prefab instances that have that ID in my map and update them with the change I just made. If you modify the base prefab file and resave the entire idea is to update all instances of that prefab. We will never get our prefabs right the first time and design decisions change over time. If I have 50 of 1 prefab in my scene and I decided to add something to the prefab I don't want to readd those 50 prefabs. As long as I didn't break the link to any of those instances the link should still exist. That's the entire idea of the link right? To be able to track all instances already in the scene and update them when I update the base prefab file. I would think storing the base prefab filename inside all instances would be all you need to do this. When that file gets saved you go through the map (or on map open this would have to be checked) and look for any base entity that has this prefab name and compare/update all it's limbs according to the base prefab. Or better yet, when we resave a prefab file ask if we want to update all instances of this prefab in the current map (or we can select a map(s) we want this to happen in).
  18. Get the bounding box of the sword and then do a ForEachEntityInAABBDo() to see what it's colliding with.
  19. I'm guessing you are getting that lag because you are setting the position/rotation in the UpdatePhysics() function which is called at a specific rate (ie not as fast as possible). Try doing that in UpdateWorld() and see if you get the same lag.
  20. Normally Josh has posted a link to the hangout as a status update on this site and it is first come first serve.
  21. You don't need to set the camera to orthographic if you are using DrawImage(). This is more to make 3D things look 2D but if he's going true 2D and using DrawImage() then there is no need to do this, as I recall.
  22. Nice gamecreator! @xtrempb LE is missing some handy methods for doing 2D like drawing parts of bigger images and 2D physics. You can either mess directly with OpenGL commands to give such functionality or just use DrawImage() and switch what image to draw (for animated sprites). You can implement simple 2d bounding box collision detection for some physics stuff.
  23. That's a great idea Josh. Would love that "don't collapse" flag as well.
  24. If you setup a small project that shows how to reproduce this you can post it in a bug report and instructions and Josh can check it out and possibly fix anything on his end that he sees. He will run your project through the engine in debug mode and can see exactly what line in the engine it's crashing at and determine what's going on.
  25. I do offer 1 on 1 Lua and Lua for LE training if you are interested. $10 for 1 hour sessions. I've been with LE since version 1.x. I'm a professional programmer and have been for 13 years. I'm a friendly person who has patience and enjoy teaching. I have 1 student who has been doing 1-2 sessions a week for months while I help him make a chess game. Just send me an PM if you are interested.
×
×
  • Create New...