Jump to content

lxFirebal69xl

Members
  • Posts

    333
  • Joined

  • Last visited

Everything posted by lxFirebal69xl

  1. Hey all, I've just ran through all the forum posts about resolutions and everything and none of them seem to mention something that context:GetWidth and context:GetHeight don't do which is take into account the resolution at which the player is playing the game at. Here's an example of what I'm talking about: --Battery begin local battL =math.floor((context:GetWidth()))/2 - 775 local battY =math.floor((context:GetHeight()))/2 + 425 local battX =math.floor((context:GetWidth()))/2 - 800 local battery_percent = self.battery_level / self.battery_max_level --calculate the percentage of battery power remaining context:SetColor( 1 - battery_percent, battery_percent, 0, 1) --as the battery dies the red component increases while the green decreases context:DrawRect( battX, battY, battL * battery_percent, 20) --rectangle width is dependent on the percentage of battery remaining. Wider with more power. --Battery end This is the post render part of the script I use for the flashlight bar. Here's how it looks in my native 1920x1080 display: And here's how it looks in the native leadwerks display 1024x768 See the difference? The flashlight bar doesn't show up and the interaction text is way too close to the middle of the screen, so my question is, is there an easy way to take the player's resolution and dynamically change the draw functions so they fit the screen no matter the resolution used?
  2. Will test it out and give you feedback later today!
  3. I was looking to create a specific segment for my game that had a trigger happen when the player looked at something (it could be a model or a pivot, either would work). Thing is how would this be possible? Since we're talking about the player's vision and not collision I have no idea how to even start doing this. Here's an example, where you see the player running around everywhere, but only when he looks in a specific direction (in this case, up) does something happen.
  4. I just got it and it's not worth it for us that use leadwerks, most of the files are .ma or .mb There are a few .fbx here and there but they're quite scarce in comparison.
  5. I was looking into improving the already implemented flashlight, but unfortunately my limited coding knowledge made me stuck pretty quickly, so here was my idea. Have a flashlight model be a child of the fpsplayer (so it follows the mouses movement), line it up so it looks good, make a spotlight coming out of it, and then implement Hankinator's battery script to work with the new spotlight. Battery script: http://www.leadwerks.com/werkspace/topic/12783-flashlight-battery-tutorial/page__hl__flashlight Problem is, I can't really figure out how to make it so that when the player presses F, the new spotlight appears and not the current one, and also how to implement the battery part of the code to work with it. (Since the battery script interacts with the player and not a child of the player) Any guidance would be extremely helpful! Thanks!
  6. I have this problem again, as soon as I click the "New" button, I get that message, and if I try to load a level I get that message as well, if I load backup number 46 or before of that map it works, but anything from that point on(47 to 62) crashes the engine. I could rebuild everything I did again, but it's like 5 hours of work, I don't really want to go back and do it all over again.
  7. I was right, it was obvious...that fixed the error popping up, but the text doesn't show up.
  8. A day later, and I still haven't figured this one out, must be super obvious and I'm not seeing it.
  9. A long time ago I had this problem with text overlapping itself when you used some entities in the game, then Rick (thanks by the way) came along and fixed this issue. This is the code right now: Inside FPSPlayer.lua right below the default variables: Script.DisplayTimeMax = 4000 local font1 = Font:Load("Fonts/MODERN SERIF ERODED.ttf", 20) In the Start(): self.text = "" Inside the UpdateWorld() if pickInfo.entity ~= nil then if pickInfo.entity.script ~= nil then if pickInfo.entity.script.GetText ~= nil then self.text = pickInfo.entity.script:GetText() self.DisplayTime = Time:GetCurrent() + self.DisplayTimeMax end end end Under PostRender(context) if self.text ~= "" then context:SetBlendMode(Blend.Alpha) context:SetFont(font1) if self.DisplayTime > Time:GetCurrent() then context:SetColor(255,255,255) context:DrawText(self.text, 100, 600) else -- reset self.text = "" end end This is all that was required (back in 2015) to set up the player script, then we had this simple code for the entities: Script.ObjectDescription = "" --string "Object Description" function Script:GetText() return self.ObjectDescription end function Script:Disable()--in self.enabled=false end Now the only problem here is that the hand icon doesn't actually show up, so the player can't interact with it, I tried doing a Use(context) function that called the self.GetText() but that just caused the game to exit out with an error saying: Script Error attempt to index local 'self' (a nil value) Line 8 So any thoughts as to how I would resolve this issue?
  10. Found the issue, and it's a pretty dumb one. I had an "event" in that level where a monster went to a waypoint after a specific x amount of time, the thing is, I must have deleted that pivot by accident and that's what was causing the editor to crash. I thought it was something a lot more serious and now I feel dumb. GG.
  11. This is also happening when I click the "New" button to start creating a map. Although nothing shows in the console.
  12. Alright, I was working on a level today, I made all my changes to it and was happy with the results, so I saved, and started working on another one. Then when I tried to load the level I was working on before I get this: This is really bad because I've been working on that level for months now, I really can't allow it to just give up on me. The red text on the console says: Error: script connection target entity not found. Error: script connection target entity not found. Here's what I've done so far that hasn't fixed the issue: -Re-launched Leadwerks. -Made another project, copied over the files and tried to load the level there. -Published a stand alone and tried it, whenever it starts to load that level it crashes. -Opted in to the latest beta, tried to load it again, no dice. In my understanding, this should give an error when you try to play the level, not load it in the editor. Any thoughts on this?
  13. Here are a few pictures of the game! I enjoyed the game, it was simple and hilarious, love how they just send the dog out of a plane.
  14. I'm currently having the same problem, I can run the game fine in the editor. But if I publish it stand alone or game launcher it won't launch, the only fix I found (for me at least) was to copy over the "Materials" folder to the published game directory.
  15. For the past few months I've been having trouble getting in to the "developing mode". But, ever since the tournament started and I saw all these new fellas doing something productive, and not to mention that the Game Launcher seems to be getting stale, with the most popular games lacking updates. I decided to pick my sorry *** off the floor and work on my game. After a week of this mindset, I can proudly say, I did something great, most of you probably already played the Alpha demo for "A Demon's Game", but it was broken, filled with glitches and not enjoyable, this update changes that and polishes it up to be a solid title in the Game Launcher library. If any of you are thinking of giving it a shot one more time, I thank you as it means the world to me.(Just don't forget to point out what's wrong and what's right.) I also started using Trello a lot more often. It helps me maintain a good workflow. https://trello.com/b/boNQSExz/a-demon-s-game-development Here's what the update contains: http://www.indiedb.com/games/a-demons-game/downloads/a-demons-game-alpha-21 Thank you for reading and I hope you enjoy the game. P.S: Does this count as an entry to the Tournament? I never actually participated in one
  16. Just tried to do this myself but I keep messing up somewhere, could you show us an example of something simple?
  17. I'm trying to save the settings even if the player exits the game.
×
×
  • Create New...