Jump to content

Search the Community

Showing results for tags 'lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

  • Development Blog
  • Canardian's Blog
  • Beyond Civilization Blog Ext
  • Tyler's Blog
  • macklebee's Blog
  • B-Byrnes' Blog
  • Marleys Ghost's Blog
  • omid3098's Blog
  • Richardsimpo123456's Blog
  • DJDD's Blog
  • Rick's Blog
  • --
  • xtreampb's Blog
  • Economically Disadvantaged
  • klepto2's Blog
  • Old Blog
  • Chris Paulson's Blog
  • Davaris' Blog
  • nil
  • Rekindled Phoenix's Blog
  • Flexman's Blog
  • Kattemaksu Online
  • Marcousik's Creations Blog
  • EVE LBS Studio
  • Rendering puzzles
  • Screen Size Utility
  • Niosop's Blog
  • 1299 RTS Game Project
  • Blitzbat's Blog
  • gordonramp's Blog
  • Andy Gilbert's Blog
  • Marcus' Blog
  • JornAggror Blog
  • diedir's Blog
  • wayneg's Blog
  • Masterxilo's Blog
  • Dave Lee's Blog
  • peubuy's blog
  • OD Arts -Leadwerks Blog
  • The progression......
  • Ultra Software Company Blog
  • The Progression
  • Pancake's Blog
  • Test Blog
  • BLaBZ Blog
  • Pure³d's Blog
  • dreamhead Blog
  • RVL's Blog
  • DB's Blog
  • Toxin Games Development Blog
  • CombatHelo Blog (RSS Import)
  • Foolish's Blog
  • ZioRed's Corner
  • Toxin Games Twitter
  • Shard - Third Initiative
  • Shard's Blog
  • Soamp's Blog
  • Soamp's Blog
  • Laurens' Blog
  • JT`s warehouse district
  • Kennar's Blog
  • KiteFuchs' Blog
  • KiteFuchs' Blog
  • Rachel's Dev-Blog
  • Eagle's Blog
  • zaphos' Blog
  • please delete this blog
  • Afke's Blog
  • Richard Simpson
  • knowledgegranted's Blog
  • EdzUp(GD)'s Blog
  • aGameLife's Kelasel MMORPG Blog
  • tournamentdan's Blog
  • Beyond Civilization Blog
  • smashthewindow
  • AnniXa's Blog
  • AnniXa's Blog
  • Elemental Development
  • DigitalHax Blog
  • Aria's Blog
  • Strogg76's Blog
  • Clackdor's Blog
  • Leadwerks Project Status
  • simpleprogrammer's Blog
  • Pathfinding in LE.2.x
  • Naughty Alien's Blog
  • smashthewindow's Blog
  • Ali Salehi's Blog
  • Jardar's Blog
  • Chris Vossen's Development Blog
  • Scarlet Thread Studios' Blog
  • Kronos' Blog
  • Benton's Blog
  • ChrisV's Blog
  • tjheldna's Blog
  • shadmar's Blog
  • 3D Masons, LLC
  • Andy Gilbert's Enviro Models
  • ParaToxic's Blog
  • NarkLord's Blog
  • ChrisMAN's Blog
  • ChrisMAN's Blog
  • CGMan's Blog
  • The Game
  • Chris Tutorials
  • Leadwerks 3 Experience
  • An Alien Saga
  • klepto2 & Leadwerks 3
  • Inside the mind of eternal insomniac
  • josk's Blog
  • Shader Development in Leadwerks 3.1
  • 3D Coat : Column game making of
  • Einlander's Blog
  • Ginger George's Blog
  • I have a problem
  • Michael_J's Blog
  • nasamydifol's Blog
  • Digman's Blog
  • noesisGUI
  • SavageDogg38's Blog
  • Built from Ruins
  • Remaining Days
  • test_external_blog
  • The Hunt For Food Blog
  • Crazy Minnow Studio
  • CrazyMinnowStudio
  • Guppy's Blog
  • Playing Online
  • Evayr's Blog
  • DerRidda's Blog
  • Karl's Blog
  • whiterabbit's Blog
  • Tinyboss Games
  • abendkleider's Blog
  • sacguccireplica's Blog
  • Arena
  • Imchasinyou's Blog
  • xtom's Blog
  • Lua is better than you think.
  • mdgunn's Blog
  • Crime Closer
  • lxFirebal69xl's Blog
  • Wedmer's Blog
  • Lockdown, going forward.
  • Pump-Action Captain
  • Igor's Blog
  • Dead Anyway
  • Runenrise and more
  • reepblue's Blog
  • Slippy's Corner
  • LUA Musings
  • severjack's Blog
  • mikeporter's Blog
  • miko93's Blog
  • Megalocerous' Blog
  • lxFirebal69xl's Blog
  • aiaf's Blog
  • Lostghbear's Blog
  • echo $BLOG_NAME > blog_title.tmpl
  • johnadam111's Blog
  • Dwarf Beard
  • burgelkat's Blog
  • Charrua's Blog
  • peterpaul's Blog
  • joshmathews' Blog
  • Martin Kearl's Blog
  • Brutile's blog
  • tipforeveryone's Blog
  • Glushchenko Blog
  • Express Lab Games Blog
  • Blueapples' Blog
  • DooMAGE's Blog
  • Structura devblog
  • UltraEngine - Experiences, add-ons and other Stuff
  • martyj's Blog
  • Dragonfreak's Blog
  • Brutile's Blog
  • assigmenthelp
  • Case Study Assignment Help
  • How to deal with bad grade ?
  • How to deal with bad grade ?
  • GameDev Blog
  • devcjohnson's Blog
  • devcjohnson's Blog
  • THE WHAT? Blog
  • The Demurian Scribe
  • GUI Editor
  • GUI Tutorial
  • noob_shaders
  • The Seventh World
  • Phodex Games Blog
  • Leadwerks VS Source 2
  • Work in Progress - Scifi PBR Media
  • [C++] First Player game start
  • The Blog of Yue
  • Snowboarding Development Blog
  • Ocean: Rendering in Leadwerks 4
  • Game Ready Maps
  • Ultra App Kit (Advanced Custom Widgets)
  • Poking around
  • SALVATIONLAND
  • Road & Traffic infrastructure [Vehicle based path following]
  • Usefull Scripts & Components
  • Thirsty Panther

Forums

  • Software
    • General Discussion
    • Programming
    • Game Artwork
    • Showcase
    • Suggestion Box
    • Bug Reports
  • Addons
    • Extensions & Plugins
    • Components
    • Addon Development
  • Platforms
    • Windows
    • Linux
    • macOS

Categories

  • Tutorials
  • Games
  • Work in Progress

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location

  1. Hi, I have a general inventory script attached to every object, which should have an inventory. In the script settings of the inventory script I put an "firstSlotOffset" value, to adjust where the inventory starts to render its slots. In code this looks like that: Script.firstSlotOffset = Vec2(0, 0) --Vec2 "Slot Offs." In the start function I do some calculation: self.firstSlotOffset.x = self.firstSlotOffset.x * context:GetWidth() self.firstSlotOffset.y = self.firstSlotOffset.y * context:GetHeight() The problem is if I load to another map and back to some other map the self.firstSlotOffset value seems corrupted. This happens only after I loaded twice (so changed the map two times). I found that out by printing the self.firstSlotOffset value in the start function. What I mentioned is if you loaded twice the self.firstSlotOffset value is not what is set in the script settings but the result of the above calculation which should not be. If you change a map, all variables should be "nil"-ed shouldn't they? And by the way what do you have to take care on when loading to an new map? Do you need to clean stuff up and if yes which stuff? I guess that could be the problem that I didnt clean up. P.S.: The error only appears for the player inventory, which is the only entity staying the same on both maps I load to.
  2. With the last update the new default main.lua causes crashes when run. The old main.lua still works though. --edit-- Simply commenting out all the gui related related lines causes the game to 'Assert Failed' at world:Render()
  3. EDIT: Just found out that the error was somewhere else ^^. The below code just works fine. Anyway thank you for the help :). Hi there, I faced some weird behavior, testing and debugging my project. The following shows the structure of my code, it would be very kind of you, if you could tell me if you can find any error, because I dont. Maybe I messed around with global/local/script variables, which I know, often cause such errors. Explanation: Of course this script makes no sense, but it should only representate the structure, because it would be way to complicated to explain the issue within the actual script. So what is the problem? When I apply the "Main Script" to one entity, everything works fine and I get printed the data. but if I apply the "Main Script" to more than one, for example two, then the problem occurs. In the output I get the "Send my data!"-message, but now comes the weird thing. It prints the data and then, even if the "Test"-function is just called once it prints "Variable data is nil!" twice. And this happens for both entitys. So this is my output with two entities with the "Main Script": Send my data! Test Variable data is nil! Variable data is nil! Send my data! Test Variable data is nil! Variable data is nil! Main Script: Script.dataToSend = "Test" Script.data = nil import "exampleScript.lua" function Script:Start() self.myLuaClass = testClass(self) end function Script:Test(data) if data ~= nil then System:Print(data) else System:Print("Variable data is nil!") end end The "exampleScript.lua" Script: function testClass(script) local container = {} function container:CallMeFromAnywhereToSendSomething() self:SendSomething(script.dataToSend) end function container:SendSomething(sendData) if sendData ~= nil then script.data = sendData end if script.data ~= nil then System:Print("Sent my data!") script:Test(script.data) end end return container end Addition: I was able to work around this issue by simply checking if the variable is nil, or not (I actually need/do stuff with the "data" variable in my actual script), but still I am confused. Maybe you can help me out. If you find other mistakes, or have improvement suggestions for my "Class" system please tell me. Thanks for reading
  4. Welcome to the Fifth Monthly Script Challenge. Each Month I will set a challenge for gifted Leadwerkers to solve. Once you have perfected your script post your map to this thread. At the end of the month I will go through all the entries and judge the winner. I will then place the winning map on the Workshop so others can learn from them. Rules. Entries must be your own work. Entries must be submitted before the end of the month ( May ). Any assets you use must be your own or Royalty free. The map that you submit can be used by others for commercial use. Have fun. May Challenge Another weapon challenge this month. Sorry mdgunn its not a portal gun. Most of the weapons we currently have for Leadwerks operate on a single target. What we need is something that will take out a group of enemies in a hurry. So this months challenge is to make a grenade. Your grenade should damage all enemies within the blast area. It should also have an effect on physical objects in the blast area. Think barrels getting knocked over etc. How you implement your script is up to you. Remember the winning script should not only solve the problem but should also have comprehensive comments within the script so that new users can learn from your script. Prize Damien Defranco and his company Vixeemo are now the proud sponsors of the Leadwerks community monthly script challenge. Vixeemo (http://vixeemo.com) is an all-in-one business solutions brand for your start-up or project needs. The winner will receive a free web & graphic design package provided by Vixeemo that includes a 3-page professional website design (Home, About, Contact), logo design and integration, banner/slider design, a blog section, and an additional gallery page to showcase images/video or projects. Vixeemo will work with the winner to fully customize everything to bring the vision to fruition. This prize is perfect for any Leadwerks user who wants to get their project or brand onto the internet. The winner will need to provide the domain ( TomsHardware Guide ), and Vixeemo will do the rest. This design package is valued at over $400 USD. A great prize for your hard work and a great way to give your game project that professional look to make it stand out from the crowd. If you have any ideas or thoughts on the Challenge please feel free to comment. I'm are looking forward to your submissions. PS Josh could you kindly pin this thread please.
  5. 'm using the C++ SDK and lua for small objects code. I need to create the entities from C++ and later use the bool Entity::CallFunction(const std::string& functionName, Object* extra) How to 'bind' on script lua to an entity ? it looks that Interpreter is using tolua++, but I can't figure how to load the .lua properly to the object // Create 100 special entity std::vector<Entity*> list; for (int i = 0; i < 100; i ++) { Entity* entity = new MyEntity(); entity->AddToWorldTable(true ); list.push_back(entity); } // Load special script (But not working, object not callable). Interpreter::NewTable(); Interpreter::SetGlobal("Script"); // Must Script. Don't change that, because the script are prefixed with Script:myFunction if (Interpreter::ExecuteFile("MyEntity.lua")) { System::Print("Error: Failed to execute script \"" + it + "\"."); } for (auto&it : list) it->CallFunction("OnSpecialFunction") Script Lua function Script:OnSpecialFunction() print self end
  6. I want to use multiple scripts in my character, but I don't want to change the FPS script. I hope this feature will be added in the future. Leadwerks / Unity Thanks Josh..
  7. Welcome to the Forth Monthly Script Challenge. Each Month I will set a challenge for gifted Leadwerkers to solve. Once you have perfected your script post your map to this thread. At the end of the month I will go through all the entries and judge the winner. I will then place the winning map on the Workshop so others can learn from them. Rules. Entries must be your own work. Entries must be submitted before the end of the month ( April ). Any assets you use must be your own or Royalty free. The map that you submit can be used by others for commercial use. Have fun. April Challenge This month I thought the challenge should be a weapon. Leadwerks already comes with a pistol and you can get a shotgun and automatic weapons by buying the DLC. So whats another iconic gaming weapon? A Zero Point Energy Field Manipulator. Aka Gravity Gun. Made famous in Half life 2 it was originally designed for handling hazardous materials. But with its ability to "fire" objects it becomes very handy as a weapon for knocking down barriers or enemies. Your script should replicate the functions of the Half Life gravity gun. That is the secondary fire button to attract and hold an object and the primary fire button to shoot the object. How you implement your script is up to you. Remember the winning script should not only solve the problem but should also have comprehensive comments within the script so that new users can learn from your script. Prize As announced last month we now have a sponsor. Yeah. Damien Defranco and his company Vixeemo are now the proud sponsors of the Leadwerks community monthly script challenge. Vixeemo (http://vixeemo.com) is an all-in-one business solutions brand for your start-up or project needs. The winner will receive a free web & graphic design package provided by Vixeemo that includes a 3-page professional website design (Home, About, Contact), logo design and integration, banner/slider design, a blog section, and an additional gallery page to showcase images/video or projects. Vixeemo will work with the winner to fully customize everything to bring the vision to fruition. This prize is perfect for any Leadwerks user who wants to get their project or brand onto the internet. The winner will need to provide the domain ( TomsHardware Guide ), and Vixeemo will do the rest. This design package is valued at over $400 USD. A great prize for your hard work and a great way to give your game project that professional look to make it stand out from the crowd. If you have any ideas or thoughts on the Challenge please feel free to comment. Gordon Freeman and I are looking forward to your submissions. PS Josh could you kindly pin this thread please. Members 627 posts Welcome to the Third Monthly Script Challenge. Each Month I will set a challenge for gifted Leadwerkers to solve. Once you have perfected your script post your map to this thread. At the end of the month I will go through all the entries and judge the winner. I will then place the winning map on the Workshop so others can learn from them. Rules. Entries must be your own work. Entries must be submitted before the end of the month ( March ). Any assets you use must be your own or Royalty free. The map that you submit can be used by others for commercial use. Have fun. March Challenge Weather plays a big part in any game. Be it a horror game with a scary house with the wind blowing. A survival game where you need to find shelter to get out of the snow or a racing game where the road becomes slippery when its raining. Weather provides a passive obstacle for the player. Just as a zombie or a locked door can inhibit the player so can weather. Using weather in a game can provide an add level of interest to the player and add depth to your game.. So your challenge this month is to create a Weather system. Your map should include rain, snow and wind. You are free to do this anyway you like. You could use shaders or emitters its up to you. I decided not to provide a map this month. Most entries in previous challenges make their own maps anyway. I have provided a small collection of sound effects for you to use. Weather Sounds How you implement your script is up to you. Remember the winning script should not only solve the problem but should also have comprehensive comments within the script so that new users can learn from your script. Prize Currently I have no prize to give. Your reward will be admiration of your fellow Leadwerkers and being the third winner of the Monthly Script Challenge. Your name will join the previous winners Garlic Waffle and Genebris in the Leadwerks Hall Of Fame. If any person or company would like to donate or sponsor the Challenge you can contact me on this forum. If you have any ideas or thoughts on the Challenge please feel free to comment. This is the first time I've run anything like this and I want it to be successful and useful to the community. Looking forward to your submissions. PS Josh could you kindly pin this thread please.
  8. Hey guys, I was searching the forums for a releated subject, but I couldnt find one, but I could imagine there is one, if so I am sorry to post the same topic again So I am currently trying to come up with a way to handle diffrent objects rendering in the right order. What solutions have you for this problem. For example: I have a trading menu, but my cursor is rendered behind the inventory slots and buttons rendered by the NPC Trader entity. (elements of my trading menu are rendered by two diffrent entities (Player and NPC Trader)) I was thinking about something where you can set a variable "renderPriority" which indicates in which order objects are rendered. So if render Priority is 1 those objects "PostRender" function is called before all the others, then come entities with priority 2,3 and so on. Thats the point I am stuck . How to make the other PostRender functions "wait" unitl the PostRender function of an specific entity is finished. This I a problem I occured pretty often and havent found a solution yet, I mean that you control the order entities call functions like UpdateWorld() or PostRender(). Would really appreciate if somebody can come up with an idea
  9. Operating system or device - Leadwerks Version: Windows 7 Pro x64 Leadwerks 4.2 Beta BuildID:1737986 Issue description (what happened, and what was expected): Issue Models with physics that drop onto the character controller will bounce higher [*]What was expected The model to hit the top of the character controller then fall off. Steps to reproduce Load the fps AI and events map Pick up any entity Look directly up Drop it Link to minimal example project No project just a video
  10. Spent ages trying to figure out why a certain line of code keep breaking the program. After deciding to restart Leadwerks I reopened the script file and suddenly there was a break-point at that line. I did remove it before hand, but it obviously just removed the icon, not the actual break-point. Hope this can be resolved soon.
  11. Title says it all If answer is YES I'm disappointed as it shouldn't in my humble opinion
  12. If have an entity in my scene with a script attached that holds some parameter, something like this Script.param = 10--int and then in my LUA program at some point picks that entity. Is is possible to access the script.param then (at this stage I have only the entity) I made a temporary solution for this that works by using the Get/SetKeyValue like this Script.param = 10--int function Script:Start() self.entity:SetKeyValue("param", self.param) end which allows me to get that param event though I only have the entity local value = entity:GetKeyValue("param") However this feels a bit odd. Maybe there is some better way ? Note: In C++ I could do this using my LuaBridge class, but this project is pure LUA
  13. Hi guys, I searched the forum a bit and found out that other people had the same issue as I have now. You maybe know that if you have a key check (like window:KeyHit() or window:MouseHit()) in multiple scripts then only ONE of the works as expected. I read that its because Leadwerks sets the hit check value to false right after you checked it. However I tried to find a solution for this, by making a "class" where I call all keychecks, unfortunately the problem remains, maybe you can help me? What have you come up with? Thats my attempt: Thats the class script: function KeyCheck(script) local key = {} function key:MouseClicked(command) if command == "Left" then return window:MouseHit(1) elseif command == "Right" then return window:MouseHit(2) end end return key end These are two test scripts: import "Scripts/+Morra Scripts/System/KeyCheck.lua" local keyCheck function Script:Start() self.loadClass = KeyCheck keyCheck = self:loadClass() end function Script:UpdateWorld() if keyCheck:MouseClicked("Left") then System:Print("Test1") end end import "Scripts/+Morra Scripts/System/KeyCheck.lua" local keyCheck function Script:Start() self.loadClass = KeyCheck keyCheck = self:loadClass() end function Script:UpdateWorld() if keyCheck:MouseClicked("Left") then System:Print("Test2") end end I only get printed "Test1", due to this script seems to be called faster than the second one.
  14. Welcome to the Second Monthly Script Challenge. Each Month I will set a challenge for gifted Leadwerkers to solve. I will provide a map as a starting point. Once you have perfected your script you re-post your map to this thread. At the end of the month I will go through all the entries and judge the winner. I will then place the winning map on the Workshop so others can learn from them. Rules. Entries must be your own work. Entries must be submitted before the end of the month ( February). Any assets you use must be your own or Royalty free. The map that you submit can be used by others for commercial use. Have fun and educate. February Challenge Leadwerks is very good at getting the budding game developer to create their very own FPS. One of the problems with this is that the players footsteps sound like they are walking on concrete regardless of the surface they are actually on. The player runs across grass, sounds like concrete. Runs thru water, sounds like concrete. We need a way for the player footsteps sounds to be altered depending on the surface that they are on. So your challenge for this month is to create a script that plays different sound effects for different surfaces. The map I have provided is very simple. A player with the FPSplayer script attached on a single platform with 5 different surfaces. The first is concrete, then foliage/leaves, metal, water and grass. Your script should play a different sound for each surface. The February Map. The map has various textures from Wild Textures. These are free to use in your own projects even if you don't submit an entry. I had some sound effects but I can't remember whether they are royalty free or not. So I wont post them until I can confirm. In the meantime you will need to find your own sound effects. How you implement your script is up to you. You can alter the FPS player script or add a separate script it is entirely up to you.Remember the winning script should not only solve the problem but should also have comprehensive comments within the script so that new users can learn from your script. The last challenge had 3 fantastic entries and the only way I could split them was on the documentation. So keep that in mind when submitting. Prize I still don't have a prize to give away. So your reward will be admiration of your fellow Leadwerkers and being the second winner of the Monthly Script Challenge. You will join Garficwaffle on the Leadwerks Hall of Fame (OK I just made that up). If any person or company would like to donate or sponsor the Challenge you can contact me on this forum. The last Script challenge had almost 1000 views so sponsoring this challenge would expose your product to many potential customers If you have any ideas or thoughts on the Challenge please feel free to comment. The first challenge was very well received and I have had lots of positive comments. Looking forward to your submissions.
  15. Hi, any idea haw can i change mode Chase player (Monster ai) to run away from player. thank y
  16. Hey there, Just wondering if there is a place to find scripts made by others that are ready to use? I know Leadwerks comes with some, but I'd like to play around with some others too. I've had a quick look around, can't seem to find any or maybe I just missed them all completely. Thanks
  17. Hi there, I have a problem, maybe you guys can help me. I will make it quick. Following is what I have (just an example): function Script:Start() FileSystem:CreateFile("Data/Save Data/someData.lua") self.stream = FileSystem:WriteFile("Data/Save Data/someData.lua") end function Script:UpdateWorld() --I created this to find the error and to test it out if window:KeyHit(Key.K) then self.stream:WriteLine("Some text goes here") System:Print("It should work!") end end So I get printed "It should work!" AND the file gets created, but I can click "K" as often as I want, the text which should be written does not show up in the file. I need this to save data for my game. Whats the mistake. I noticed, that sometimes it gets written, after I close the application, but sometimes is has also been written while "ingame", but mostly it doesnt, especially with the scenario you can see above. Anyways this stream:WriteLine() seams to behave very akward. Further then solving my problem, what are your solutions for saving massive, or not so massive data (object positions, player position, npc states etc)? Thanks for your answers! EDIT: Just checked the data file again, and now the data is written a hundred times??? But I triple check if it gets written after I pressed "K". The problem is I need the file to be written immediately, because I grab the file again with dofile (I normally write code into the file that gets called (a simple "return" and some data))
  18. Currently to expose settings to the editor users have to use the format: Script.variable = value --Type "Label" I propose a breaking change to the way editor properties function. First the syntax/method would need to change. Script would become a table: Script = {} All entries would be become named variables holding tables: Script = { --variable = {value, "type as string","label as string"} ground_height = {100, "uinteger","Ground Height" }, jump_height = {4,"uinteger", "Jump Height"}, player_name = {"","string", "Player Name"} } What this would mean is the editor would need to actually load the script itself, which brings a few drawbacks. 1. the entire script would need to be able to load without any errors. 2. if the script fails there is a chance that the properties will fail to load. 3. if the script property section is malformed or wrong it will not show up. or just grab it from the debug info (i would assume it's rather hard) A solution for this would be: 1. To hold a copy of the properties in memory/cache and restore them when the properties returns. 2. add a small reset button to reset the value to default. (since the editor will always be remembering the last value). If this is implemented there is an additional benefit: function Script:test1() return {"Good","Neutral","Bad"} end Script = { --variable = {value, "type as string","label as string"} ground_height = {100, "uinteger","Ground Height" }, jump_height = {4,"uinteger", "Jump Height"}, player_name = {"","string", "Player Name"}, dynamic_list = {self:test1() ,"choice","Team"} } You can now dynamically populate lists!! 1 draw back is you would either need to forward declare functions or put the functions above the script declaration. Even if this is not implemented, it could be useful if editor plugins are ever added.
  19. I recently had a bad go around with a project in leadwerks. I nearly had an entire map finished and ready to play and then alluva sudden, the script editor decided it didn't want to work anymore, as in clicked on it and nothing happened no matter how many times I tried. I started a new project to see if it was something wrong with my project files. Same thing happened. After realizing it wasn't going to work, I deleted all of my local content and reinstalled Leadwerks. After getting another map going, I attempted to play what I have, for debugging and it says that the Animation Manager Lua is missing. It only ever asks for it when I have an active enemy on the map. I went into steam and verified local files and tried again. The Animation Manager Lua is still missing. I've scoured template files and all of my scripts and nothing. I don't know how I'd ever manage anything without these forums...
  20. I have got this Astar script, that I want to use again. https://github.com/lattejed/a-star-lua/blob/master/a-star.lua But I dont know how I managed to do it, the import itself works with import"Scripts/Astar.lua" but I get an error at the line 7 of the Astar script, : module ( "astar", package.seeall ) I dont know what I did to do to make this work, can anyone help ?
  21. If I create a prefab of decal with "Paint models" option disabled and load this prefab in code, this decal will still be visible on models and GetRenderMode(Object.ModelClass) will return true. Though, loading this prefab in editor will work correctly, Paint models will be off.
  22. Does anybody have good experience using a lua lib for calling webservices/making http requests? Currently looking at Luasockets but tinkering about whether this is even possible when you are making a game using the Leadwerks game player.
  23. I was looking for a way to avoid having to make time variables manually and a more inline way when I wanted to do something on an interval. I came up with the function below. The idea is that it's something that's in an Update function so it's called every frame (normally what you would do anyway if you were tracking it manually). First it's usage: -- this will play an attack animation every 2 seconds. the false variable tells if it should call the function you are passing in right away the first time or wait until the interval is up for the first time only. after that it'll do it at the interval DoEvery(2000, false, function() self.animMgr:SetAnimationSequence("Attack"..tostring(1 + task.actor.attackmode), 0.05, 300, 1, self, self.EndAttack) end) This should be slap in ready. Just copy it to your project and use away. function DoEvery(interval, doRightAway, method) local info = debug.getinfo(method, "S") local id = info.linedefined..string.gsub(string.gsub(info.source, "/", "_"), ":", "") -- if this is the first time every calling this then create the global class that will hold all instances of these if DoEveryInstances == nil then DoEveryInstances = {} end -- if this is the first time trying to do this specific function then create it's entry if DoEveryInstances[id] == nil then DoEveryInstances[id] = {} if doRightAway == true then DoEveryInstances[id].lastUpdateTime = interval * -1 else DoEveryInstances[id].lastUpdateTime = Time:GetCurrent() end end -- handle the do every function for a specific instance if Time:GetCurrent() >= DoEveryInstances[id].lastUpdateTime + interval then DoEveryInstances[id].lastUpdateTime = Time:GetCurrent() method() end end
  24. Hello! So, recently this error has been starting to pop up at random when I change map Possible reference count error for asset "models/crates/crate_small.mdl" And then it just crashes. I have 3 crate_small models on the map, but some maps work and some don't, even if they are just mostly copies of each other. Suggestions? Thanks!
  25. Hello, currently I am working on my AI system, but I have a problem setting up multiple NPCs. What you need to know: - My AI is able to randomly move around in the world using waypoints. - I coded an own animation manager "class" The Problem: I set one NPC to not move around and the other to do so. It works fine. One is moving, one is standing still, BUT the one moving is not playing an animation. So he is kind of floating around. The one who is standing is playing the walk animation. So I printed some values to find the error. By the way if I just have on NPC active everything works fine without any trouble. This is the code of my animation manager class: function AnimationManager(script) local model = {} function model:StartAnimation(animation, speed, objects, playOnce, reset, blendMultiplier) --some code self.objects = objects local printIt = self.objects[1]:GetKeyValue("name") System:Print(printIt) end function model:DrawAnimation() --some code end return model end The scripts are called like this: function Script:Start() --Load Classes self.loadClass = AnimationManager self.animManager = self:loadClass() --Start Animation self.animManager:StartAnimation(argument1, argument2, ...) end function Script:Draw() --To play an animation self.animManager:DrawAnimation() end I only put the nessecary information in the code block, that you understand what I am talking about. My NPCs have diffrent names in the editor. The moving one is named "Fox" the standing one "Jacob". The class works, that is not the problem. In the AI code I printed the name of the NPC who is calling the StartAnimation() function. It prints "Fox", so the correct NPC is calling StartAnimation(). The NPC called "Jacob" is NOT calling StartAnimation(). The NPC is sending his entity (self.entity) so the animation manager knows on which model to perform the animation. In the animation manager if I print the name of the entity to play the Animation on it prints "Jacob". o.O Why does this happen how is it possible that the two NPC scripts seems to communicate with each other. Why does the AI script of "Jacob" send its information? I am really, really confused. I am pretty sure I am doing something wrong. I watched this behavior before, but now it was the time to ask you guys for help, because I dont find the error. P.S.: In function Script:Start() of the AI script I set self.npcModel[1] = self.entity to be able to play the animation on multiple models at once. self.npcModel is then sent to the animation manager.
×
×
  • Create New...