Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Everything posted by Rick

  1. Rick

    Cobra

    [GAME UPDATED] - You can run fullscreen now - Fixed the leaderboard UI some. Still some things to do here.
  2. In ZombiesSawner.lua you are loading 2 zombie prefabs: if self.zombie==nil then self.zombie= Prefab:Load("Prefabs/Characters/crawler1.pfb")end if self.zombie2==nil then self.zombie2 = Prefab:Load("Prefabs/Characters/orangecrawler.pfb")end You aren't setting the positions to the spawner positions so they are all spawning at 0,0,0 and running toward the turret. Because you have 6 spawners you get 12 zombies right away. I think you are running into an issue where you need to preload 1 zombie prefab and always keep it in your scene but disable it. That way other loads will load instances of the same one which will be basically instant. If you don't have any instances of a model and then you load it during run-time it'll pause your game. If you load an instance and then kill/release them and another one loads, most likely is what happens as you are killing zombies in a tower defense game, then you'd get this pause often. I think your best bet is to manually drag the zombie model (just the model) into your scene and drag it under the terrain and make sure it doesn't have mass so it just floats there. That will be your precache loading and now all loading of that prefab, it's the model and textures themselves that take up loading time and pause your game, will be near instant. Note this will be common practice for dynamic things in all your games. You always want to load 1 of said model at the start, most likely just drag it in at design time, and keep it loaded throughout the game so subsequent loads will be instant and not affect your FPS.
  3. Rick

    Cobra

    We plan on letting you roll to help avoid that. When you roll you won't be able to be hit but will have a stamina type thing on rolling so you can't just keep doing it over and over.
  4. Rick

    Cobra

    I think he hacked!
  5. Rick

    Cobra

    Didn't think I touched that part of the code. I will check tonight.
  6. Sounds will just allow you to play or stop. You need to make a Source FROM the Sound to allow more tweaking/checking. See examples here: http://www.leadwerks.com/werkspace/page/api-reference/_/source/
  7. I'm guessing that means your self.DryFireSoundFile variable is nil. It didn't get loaded correctly most likely. Make sure it's a Source and not Sound. Make sure the path is correct when loading. Make sure the .wav file is correct format.
  8. Rick

    Font sizes

    I'm sizing my HUD images based on fractions of screen width then use the image ratio to calc it's height to scale the images on any screen resolution. However, I'm not really sure how to get proper font sizes now in a similar way to match that scaling. Any ideas on how to get correct font sizes when scaling things?
  9. We found that things don't work right in the game launcher if anything is missing.
  10. Rick

    Leaderboards

    I know, I wasn't sure how to type it. I was trying to be gentle
  11. Rick

    Leaderboards

    if leaderboard==nil then leaderboard = Steamworks:GetLeaderboard() end if leaderboard==nil then return false end In your function on this post 'leaderboard' is a global variable in the show function so the first time you call this show function it sets it and it'll stay set. So the 2nd time you call this show function it's not nil so it won't get the leaderboard again, and doesn't get the updated score. I mean on my side I just get the leaderboard at the top of the function but your script here doesn't do that. It only does it if leaderboard is null which it won't be after the first time of calling the show function. I noticed this because I have it show when I hold the 'tab' key down so I can see it many times after setting the score and it wasn't showing the updated score. If you gave the leaderboard variable local scope at the top of the function then it would work as desired and get the updated leaderboard each time the show function is called. [edit] I suppose you might be thinking the leaderboard variable inside Set() is the same as inside Show() but they aren't. Those are 2 different variables because the one in Set() is defined as local so it's only visible inside Set() and isn't the same variable used in Show() (just because they have the same name doesn't mean they are the same because of the scope difference). The one is Show() is global and the one is Set() is local and doesn't point to the same memory location.
  12. Rick

    Leaderboards

    hmm, now it's working this morning. Of course to get current score it seems like we have to keep getting the leaderboard object in the draw function you made. I had to restart my game to see my updated score. That's kind of a bummer seeing as getting a leaderboard seems like it has a little delay.
  13. You'll have to define what "more fluently" really means. What are your exact requirements for this?
  14. for n=0,self.maxEnemies do if self.fighting == true then break end if n==maxEnemies then self.fighting = true break end local b=Math:Round(Math:Random(0, 6)) self.spawners[b].script:SpawnEnemy(b) zombiesleft = zombiesleft +1 end end This doesn't really make sense. The if statement to check if n == maxEnemies is kind of useless given your loop goes to maxEnemies anyway. That means your for loop will stop once it hits maxEnemies anyway. What are you trying to do here again? What's the goal?
  15. Rick

    Leaderboards

    Oh, so even when our game is played from the game launcher we'll be sharing the same leaderboard scope space with all other games on the game launcher? Meaning it's kind of an honor system to not screw with each others leaderboards, assuming you can't see what a game used for the name. I just tried from the editor. I made my own leaderboard for my game with a unique name. However when I display it the avatar is pure white, my name wasn't displayed and the score wasn't the score I passed to SetScore().
  16. Has anyone got any arc code laying around? I'm looking to do a grenade throw without using physics API and thought I'd ask before I try to tackle this.
  17. I guess one could use different collision types to handle that though between different characters.
  18. That raises the issue of getting thru low areas. I guess the solution would be to disable collision on the overhanging wall. Could be very specific scenarios where that doesn't work but for the most part it should I suppose. I'm doing training with bear and that game he has is something I'm helping him with in our training sessions so that's why I'm interested as I'm sure it'll come up
  19. Rick

    Vegetation Physics

    That's pretty neat!
  20. @martyj I know the logs say it's loading the texture but if the texture is already loaded into memory LE knows to not reload it from disk but to use the one that's already loaded. However, the side effect to this is that if you modify that texture during run-time ALL the models will see that modification since they are using the same instance of the texture which may not be what you want. There are various ways around that though now if you do want that functionality. The way you can tell this is happening is dynamically loading a texture during run-time that was already loaded at startup. It's basically instant and your game doesn't pause (or you don't notice it anyway) which tells you it's not going to disk but just using the existing loaded texture. This is how you can sort of "load" stuff dynamically in your game to create a huge world. You can preload every base asset you'd need and then dynamically cycle through the models you want to load on the fly during run-time 1 every couple frames and you won't notice a slowdown in the game because it's using instances. If you were to go the route of a very dynamic game. That was probably more than you wanted but I was on a roll
  21. I generally modify the existing AnimationManger to get this functionality in which I assign on Create() of the AnimationManager. Since AnimaitonManager isn't really even part of the core LE API I wouldn't think a feature like this would be part of the core API either but just a modification to AnimationManager.lua.
  22. Well, the idea I'm looking for is with that speed value it works great for Move() but not for SetPosition() but wondering why exactly. The above code is called in the same spot. @Einlander Nothing changes if I do that. It's still super fast movement. To the point where it looks like he's teleporting but you can faintly see trails so you know he was in another spots and is just moving really fast.
  23. What is Move() doing behind the scenes? I was using it to move left/right but now I need to rotate the player but still move on the x plane only so can't use Move() as it's relative and not what I need. So I figured I'd use SetPosition() and just add to the x position but it moves super fast now where with Move() it was smooth. So I assume Move() was doing something to smooth this movement that I now need to do. if self.window:KeyDown(Key.A) then x = ((1 * self.moveSpeed) * Time:GetSpeed()) end if self.window:KeyDown(Key.D) then x = ((-1 * self.moveSpeed) * Time:GetSpeed()) end -- move the player --self.entity:Move(x, 0, 0) local pos = self.entity:GetPosition(true) pos.x = pos.x + x self.entity:SetPosition(pos)
  24. Rick

    Leaderboards

    This makes it sound like because we aren't passing in the steam user ID in the editor right now that these leaderboard names are global to Steam? That can't be. I mean I can't just find the same name some other game in development is using and mess up their leaderboard today can I? That would seem crazy on Steams part to allow that. Like if you are making a game in Leadwerks and call your leaderboard "leaderboard" and run this code from the editor today and I do the same, we aren't sharing that leaderboard are we?
×
×
  • Create New...