Jump to content

Aaron Symons

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by Aaron Symons

  1. Hi there! I was just wondering if anyone has any ideas of how to make a Character Controller's jump "sharper", ie: jumps to desired max height as quick as we want, then falls to ground as quick as we want? I'm using the entity:SetInput() to move the Character Controller. Thanks!
  2. @Olby I'll look into that if nothing else. Thanks. @Rick I'll definitely look into that, thank you! I'll update this topic with my findings when I get the chance.
  3. Hi Rick, I thought I'd have to go over to C++. Even though I don't have the C++ version of Leadwerks, would I be able to reference my own C++ code via Lua somehow, or would that be naughty? I'm wanting to make things happen in-game to the BPM of the played music. I have all the calculations ready, but I need to be more precise with the timing because, currently, I'm out of time with the music by quite a bit. I also have other ideas for a BPM-based timer that I'd love to implement.
  4. Hello there! I require a more precise timer that deals with millionths of a second, or more. I've played around with default Leadwerks Time commands, but the most precise I can get is a thousandth of a second, eg: Time:GetCurrent() / 1000 -- 0.654 Does anyone know a way in which I can handle millionths or billionths of a second with Leadwerks and Lua?
  5. Hang on! Haha! I'm so sorry for asking such a silly question. I must be suffering from tiredness! This topic should be deleted. xD
  6. oops! That's because I'm dividing it by 1000. This gives me a maximum precision of three decimal places, but I require more.
  7. Hello, Time:GetCurrent() seems to be rounded to a maximum precision of three decimal places, and I need it to be more precise for my timer. Is there any way I can have a more precise time, to say five or six decimal places? Thanks!
  8. You can stop playing a sound with Source:Stop() function if you load it as a Source. function Script:Stop()--in self.sound:Stop() end
  9. Hi YouGroove! I just came back here to mention I just did some searching and found your Render To Texture script! I'll be able to adapt it to create a split-screen. Thanks!
  10. Could a shader be used to to this? I haven't worked with shaders yet.
  11. Can we collide two triggers together using this? I attempted to do so without luck. I'm probably missing something.
  12. The only reason I can think of is if you wanted a "herd" of entities to stay together, following a designated leader, perhaps? I suppose, unless i did want a "herd" for some reason, I'd still use Pick() or Collision(). It'd be simpler anyway.
  13. How about a "MonsterManager" script that keeps track of each entity that are referred to in a Lua table? This could be done dynamically as well: as you load from the prefab, add the monster entity to the Lua table, then refer. The "MonsterManager" could also have a function to delete/kill the each monster in the table, perhaps by setting a boolean, eg: monsters[index].killed = true? I have a similar setup for displaying game achievements. I could adapt it to keeping track of entities. I can work on some code/pseudo code to better explain the idea if wanted.
  14. Hi Rick, I don't know why, but I never thought of that. Good points! I'll keep my mind open and get back if I think of something, if no one else does in the meantime.
  15. Hiya, You can refer to the monster's health this way: Script.monster = nil --entity "Monster" function Script:Start() if (self.monster == nil) then Debug:Error("Please attach 'monster' script.") end end function Script:PostRender(context) context:SetBlendMode(Blend.Alpha) -- Get the current health local monsterHealth = self.monster.script.health -- Set the draw color to white context:SetColor(1, 1, 1) -- Display the health on screen context:DrawText(tostring(monsterHealth), 2, 2) context:SetBlendMode(Blend.Solid) end The first line will allow you to link the Monster's script to this one via the Leadwerks Editor view. Script.monster = nil --entity "Monster" Simply attach this script to a pivot in your scene. After doing so, a blank box should be displayed labeled "Monster". Drag and drop the Monster entity to this (from the Scene tree). You will now be able to access all variables and functions contained therein via this script. I hope this helps!
  16. Hi there! Just a quick update, I think I found the original problem: originally, I was rushing through the scene quite fast (far faster than a player would) and triggered many sound sources to play at once. I'm guessing OpenAL doesn't like this, and must "overload" somehow. I have stopped rushing around since. I know it may seem silly running through the scene that fast, but I did have an excuse. Word to the wise: don't trigger loads of sound sources at once. Not good!
  17. Hi. Igor's motion blur works by blurring the full screen during camera rotation. My camera is fixed to the player, and I'm wishing to only have motion blur on the player entity alone, not the whole screen. I guess I could adapt his script and shader to do this, but I have no idea where to start.
  18. Hi Rick. Thanks for your help! I've got myself some "Loading..." text displaying during the map load now. Not really what I wanted, but it'll do - better than a blank screen! I tried to draw the name of the current entity being loaded, but it didn't display. I might be missing something simple, so I may pursue a better loading screen in the future. Thanks again for your help!
  19. Howdy! Since it looks like I can't create threads using Lua, how would I go about creating an animated loading screen during a map change using Lua? The program seems to freeze during this process, and I wish to display images, text, etc and update these of their own accord while loading the next map. For example, I wish to display: an animated loading icon, and displaying an image slideshow. Many thanks in advance!
  20. Hi all! I'm wanting to create a motion blur effect on the player entity. I'm wondering how to go about this as the camera follows the player: so overlaying the previous rendered image probably wont work, as the player is always center screen. I'm guessing I could go about achieving the effect by creating a shader which duplicates the diffuse texture of the player entity and stretches it across the screen, and/or duplicates it across the screen with a fade on the alpha. I'm just getting started with shaders, and creating effects such as this, so I'm hoping someone can offer some advice or tips. Many thanks in advance!
  21. Thank you for your replies guys! I reworked my audio managment after being inspired by Gonan's reply and changing maps no longer causes errors. It's a good thing too because I've simplified everything and it's far easier to manage. I'm still not sure whether my previous way of managing the audio was the problem or if I did indeed encounter a bug. I may look into that again in an attempt to figure it out. Thanks again!
  22. Hey guys! I'm experiencing an issue when I try to switch maps: "OpenAL: AL_INVALID_OPERATION". I have many small audio samples loaded as a Source in one map (each 1 second long), each being played whenever the player triggers them through interaction. I've noticed that if none of the samples are played the map will switch just fine, but if one or more are played the map switch will fail with the above error. I've tried explicitly telling each sample to stop playing right before the map switch, just to make sure, but this didn't work. I've also combined this with releasing each Source, again with no luck. What could this invalid operation be, and how do I solve it? Many thanks in advance!
  23. Hi there! I'm wondering if anyone has any tips or known techniques on how to create a split-screen in Leadwerks using Lua. Many thanks in advance!
  24. Yeah. I'm 100% sure it's some issue with Visual Studio itself, or perhaps the connection between Visual Studio and the project. If you use Lua, and use the Leadwerks Editor to write your scripts, I'd say you're pretty much 100% safe from this.
  25. That's a very logical guess and I'd bet that's the answer! The only thing now is to find a solution to the problem, since when the executable is deleted I can't run the game via Visual Studio. My current workaround is to copy all the relavent files to a new folder, delete the project, create a new one and paste the files into the new project. I'd rather not have to do this anymore, so I hope someone could offer a solution to the problem, or at the very least a better workaround. It seems to occur when there are errors in the code. Not always, but that seems to be the case.
×
×
  • Create New...