-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
You might be able to use http://luajit.org/ext_ffi_api.html (C directly in Lua). Do a search on these forums as I think there was 1 guy doing this already.
-
You would probably have to do something in C++ and expose it. You'd be limited to what the OS can handle. Can I ask why you need such precision?
-
If you call Move() on an entity in the main loop when a key is held down when you release the key the entity slowly comes to a stop. It's like move is adding it's value and slowly goes back to zero over multiple frames. Is this expected? I would think Move() should only move the passed in value in that given frame. I love Move() because it's relative to the rotation of the entity so moving "forward" is as easy as passing in a value to the z parameter, but this accumulation and slowly going back to zero is strange behavior. If this is correct behavior how can I mimic Move() but have it only move the passed in value for that frame, which if there is no function call to Move() it would instantly stop moving.
-
Please don't gimp csg in any way.
-
http://www.leadwerks.com/werkspace/files/file/502-timer/ In the collision just call the Stop function on the timer.
-
Tested it out and that worked. Thanks for thinking of the game . re-uploaded with the fix just now! Much more enjoyable now lol
-
My understanding is that UpdatePhysics() is called x times a second no matter what the speed of the PC. Meaning sometimes if it needs to be called multiple times in a cycle to catch up or not called at all in a cycle to slow down it will. UpdateWorld() is called every cycle no matter what. It runs as fast as the PC can run. Nice find. I haven't looked at this in some time. Were you able to update the project? Is that why it showed up in a forum post again? If not I can update it to avoid that lag. That always bothered me.
-
Yes, most likely as you probably have that in an entity script in that 1 world and that would no longer be getting called.
-
In App.lua try only calling the following when not paused. if self.paused == false then --Update the world self.world:Update() end Now you can pause and unpause with the self.paused variable and setting it to true. Define that variable as false in App:Start(). Note that this would stop ALL entity scripts so your paused code can't be inside entity scripts but would need to be in App.lua.
-
@fallingbrickwork In the words of buzz lightyear. Never give up. Never surrender!
-
I was experimenting with this style. I still think it was my fault for poor management with this style because people did really do good with their individual tasks but the management of connections of these separate tasks really needs to be detailed and monitored carefully. It was educational if anything I love that this keeps going though and each time a new manager starts it up! I would think FPS would just be the easiest thing to get going given all the support it has now in LE. The question would be how do you make something unique and fun given there seems to be so many FPS's these days and they generally all feel the same.
-
There should be no difference in entity.script:GetHealth() vs entity.script.health given the GetHealth() is returning health. How are you defining health in the MonsterAI file? Are you using self.health = value or local health = value? Normally you want to use self.health = value inside entity scripts. However, that said I agree that functions are better, but it's important to know why direct access didn't work. If health is defined as local health = 50 then I can see why you can't access it with entity.script.health as that's not the same thing as if it was defined as self.health = 50 -- if inside Script:Start() Script.health = 50 -- if defined outside any functions
-
I think he's saying that he has a process that loops over all entities in a scene looking for the camera to apply something to it. Now when he does that he's seeing multiple cameras. He needs to know which camera is which.
-
My first thought on a herd would be ForEachEntityInAABBDo() to get other entities around you/bad guy/whoever but yeah you could go this route as well.
-
Yep, that's what I did here http://www.leadwerks.com/werkspace/page/games/_/bombkiller-r39 This style works well for dynamically created entities if you want to track them. The question still remains from the OP why do you want to access all these entity scripts at any point in time from inside another script that you couldn't do with a collision function or picking method?
-
I was wondering if this is what he wanted to do. However I'm assuming that he would find this tedious to say the least as he could have a lot of monsters in his scene. Linking them all to some other script wouldn't be the most efficient way to handle such a thing which is why I think he's asking. The question comes down to when does he need to know about the monster in question. If he needs to know about the monster when the player is attacking it then he's get the monster he is attacking via other means. If he was shooting in a FPS game then you'd get it inside the player script via picking. At that point you would have that monster entity (if the raycast hit it) and then could access the script then. Generally speaking linking entities that you could have a lot of like enemies isn't the most efficient way to handle it. It's generally better to get these from either the collision function or picking functions.
-
Not following what you want. Can you show screenshot of the scene tab explaining what you want and from what script you want it in?
-
Any way to get a stack trace from lua when errors happen?
-
Clearly an LE bug. Did you happen to save the map file that has this bug so you could give it to Josh in a bug report? This shouldn't happen and he can examine the map file further to see why it did.
-
And what is Player? Is it the player prefab or something different? Are you able to reproduce this isolated case in another test project? Have you removed and readded Player in the script tab?
-
I haven't played with water yet but I assume if another camera is there then there is some kind of script making that that we can ourselves modify (and Josh could also to make it more official so not sure if you are indirectly asking him to do so in your above statement) where another key is added to that camera that you check for. Give it a type key and after you find name = camera or object = camera check the type key for more specifics on what camera it is.
-
We have to see more. Screenshot of your scene tree view or something.
-
myEntity.script.variable If there is a script attached to an entity it'll have the .script field which gives you access to all functions and variable of that script.
-
GameStates with CStateManager
Rick commented on Averice's blog entry in Lua is better than you think.
Instead of: SplashScreen = new "CState" wouldn't you want: class "SplashScreen" : extends "CState" since that's sort of the point to why you made the extends function? Just curious why you didn't go that route? Also I notice you are a semicolon guy. They aren't needed when each statement is on a separate line, but guessing you come from C++ and just a habit or you have some plans for them? -
I always add my camera to the scene and then I personally just look at the name field myself as I control that.