Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. Thats an amazing blog reepblue. When I am reading this it sounds like you have been working for months on this project. There is so much stuff that you have done in such a small amount of time. Hats off to you sir (and CrazyCarpet). Small note: its not my wiki. Rick set it up and added me as an admin. Everyone can register his account, and once approved by the admins, they can add and edit articles.
  2. I recall doing this in C++ as well and although it is incremental, the keyboard layout takes some figuring out. The letter A starts somewhere on position 22, Enter on 76 etc. This was 2 years ago so maybe things changed.
  3. I'll give it a go via the launcher on windows 10. Can you export your game as a standalone and see how that works on windows 10 and 7?
  4. A custom input check class is the way I solved it. So basicly, if I have two lua scripts that want to know if the space bar in the same update frame, you get true in one script and false in the other. Storing the value of the spacebar being pressed every frame prevents this from happening.
  5. I made a helper class with a method AnyKeyDown(). I would loop over all the keys or a specific set like enter, space, escape, etc. The downside to this is that Leadwerks has now marked those checked key as used. So if you would check the state of a button again in another script, it would return a different value. That why I store the values of every key and use my own functions to check for key down/up. Maybe this has changed though (haven't used in Le in a while).
  6. I would define an Init function in your myscript.lua function Script:Start() self:Init() end function Script:Init() System:Print(self.height) end and when you set a script to entity you can do this: box = Model:Box() box:SetScript("myscript.lua") box.script.height = 10 box.script:Init() Additionally, your Init() function can also have arguments: Since lua doesn't require for those arguments to filled when calling the Init function, you can leave it open at the start: Script.height = 0 function Script:Start() self:Init() end function Script:Init(height) self.height = height System:Print(self.height) end and when you set a script to entity you can do this: box = Model:Box() box:SetScript("myscript.lua") box.script:Init(10)
  7. Thanks guys. Added it the C++ snippets. Its good to see some activity on the C++ front.
  8. Hi Reepblue, Can this be added to the C++ section in the wiki? http://leadwerks.wikidot.com/wiki:c-snippets
  9. I have started working on preparing a video tutorial for optimizing your game. Right now I am setting up the scene with deliberate mistakes in order to show users how to tackle performance problems. In this wiki topic I have severall articles listed which take care of a lot of the common problems. If you see any thing missing, please send me pm. http://leadwerks.wikidot.com/wiki:optimize-your-map
  10. Like Josh, stated attach a script to windmill blades (needs to a subobject). Something like this (Haven't tested it) gives you also more control on the rotation speed instead of setting an animation speed. Script.turnSpeed = Vec3(1,0,0) --Vec3 "TurnSpeed" function Script:UpdateWorld() var correctTurnSpeed = self.turnSpeed*Time:GetSpeed() self.entity:Turn(correctTurnSpeed) end
  11. Are you loading the model in the game loop? If so, the animation is possibly correct, you are just reloading the model every frame.
  12. Certainly possible. All elements can be created in main lua if you want. I purely use the objects in the scene for organizing and easier access to gui styles.
  13. CSG objects get collapsed when the level is loaded. This is done for performance. Try attaching an empty script or setting a mass to the csg brush and it should work.
  14. I have yet to try it, but based on the release log this should be awesome. keep up the good work Rick Tim. edit: and Shadmar!
  15. Thanks for the clarification macklebee.
  16. Creating a script with the color picker property wont return the correct color based on its default values. Only after changing the values in the property picker, the right color is set. Create a new script Add a color property with a default green color : Script.color = Vec4(0,255,0,255) --color "Color" Attach the script to an object in the scene The property looks like this: Click on one of the arrows in the color property and color updates to the correct color.
  17. Try this. The flashlight is now hidden when the checkbox is false. I also added an option for the intensity range. FPSPlayer.lua
  18. http://www.leadwerks.com/werkspace/page/tutorials/_/models-and-animation-r8#section7
  19. It the same thing people are running in to using flowgui. I tried several things to get around this. One solution is to add the text files after publishing. This prevents crashing but requires manual steps. It also is not possible when you want to upload to the game launcher. http://www.leadwerks.com/werkspace/topic/11262-flowgui-for-leadwerks/page__st__140#entry97792
  20. So finally I just decided to remove the game from the launcher and just reupload it as a new game. Unfortunately this leads to the same error. A desktop publish works fine.
  21. The feedback isn't bad at all. A quality filter, or moderated games by Josh that could end up higher on the list could be a good idea. @reepblue. Exactly the same here. Although there comes a point where I lose interest and stop trying.
  22. It is not working. Using the following: Script.leaderboard = nil Script.leaderboardName = "testtest3" Script.type = Leaderboard.Time Script.order = Leaderboard.Descending storedavatars={} function Script:Start() System:Print("Name: "..self.leaderboardName .." --- type: "..self.type .. " --- Order: "..self.order) self:SetScore() end function Script:SetScore() if self.leaderboard==nil then self.leaderboard = Steamworks:GetLeaderboard(self.leaderboardName, self.type, self.order) end if self.leaderboard==nil then return false end result=self.leaderboard:SetScore(51.0234235) result=self.leaderboard:SetScore(81.0234234) self.leaderboard:Release() self.leaderboard = nil return result end Results in: highest score: 81. looks like we can only store whole numbers. Perhaps the sort ordering determines how the entire list is returned rather than setting the lowest time as the best score. Just test it with the 'highscore' leaderboard. The sort ordering doesn't determine the order in which entries are returned.
  23. Leaderboard* Steamworks::GetLeaderboard(std::string name="Hiscore", const int type = 1) sets time or numeric, but not the sorting order. It is not clear to me where I set this. I tried it is a third argument, but to no avail. So for the code below, I would want the score of 50 to appear on the leaderboard. if self.leaderboard==nil then self.leaderboard = Steamworks:GetLeaderboard("dontstopcounter", 1) end result=self.leaderboard:SetScore(50) result=self.leaderboard:SetScore(80)
  24. The fluctuation code needs to be inside the update loop. There we check if the flashlight is on. I haven't play tested it. See the attached script. FPSPlayer.lua
×
×
  • Create New...