-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
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.
-
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.
-
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
-
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.
-
@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.
-
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.
-
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
-
First rule of video game developer for newbies. Start small and build on that. Good luck in your game development!
-
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.
-
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
-
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.
-
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.
-
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.
-
A couple of extra forum boards to help organize the site a little
Rick replied to epsilonion's topic in Suggestion Box
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. -
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.
-
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).
-
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.
-
Normally Josh has posted a link to the hangout as a status update on this site and it is first come first serve.
-
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.
-
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.
-
That's a great idea Josh. Would love that "don't collapse" flag as well.
-
What's the biggest development challenge you face?
Rick replied to Josh's topic in General Discussion
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. -
What's the biggest development challenge you face?
Rick replied to Josh's topic in General Discussion
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.