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
  • Blender tutorials
  • Usefull Scripts & Components
  • Thirsty Panther
  • Ultimate Action Game Controller

Forums

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

Product Groups

  • Software

Categories

  • Streams and Events
  • 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. AggrorJorn

    FlowGUI

    FlowGUI is a flowgraph and editor based GUI system for Leadwerks 3. 1.0 release http://www.leadwerks.com/werkspace/topic/11262-flowgui-for-leadwerks/ Thank you to Rick for finding the global Lua table issue.
  2. I'm more an artist than a coder and was looking at the FPS Script to get a rough idea but can't figure out how to control a spacecraft. Basically : orbit around the spacecraft on key toggle W - accelerate S - slow down / backward A / D - roll Mouse - yaw / pitch with zero gravity If there is already a tutorial that I missed (YouTube ?) let me know, otherwise any help most welcome
  3. Hi, I have not been able to find tutorials on making GUI's, UI's and HUD's. I want to create a very simple GUI on the main menu for my game which some text you click on starts the game, goes to the options menu, credits, or exits the game. Also, for when you hover over the text it goes to for instance, the colour red (but not entirely needed, but would be great!). I hope someone can help me out here, it would make my day EDIT: This is what it should look like (just quickly done in paint):
  4. Ever since I opted into the beta build earlier today I have been getting some strange bugs when I initially load up a map in my game. An extra light is being loaded and my character (or maybe my camera) is stuck underground. Once I load another map my game works fine, more details in the video. I am using the Indie Edition and wasn't getting this error until I opted into the beta earlier today. Let me know if you need my project to look at. Video Link - https://www.youtube.com/watch?v=fyyQzORQvn0&feature=youtu.be
  5. Terrain tutorials There are 2 new video tutorials on how to use the terrain editor. Sculpting terrain: Terrain painting: Tutorials: Project Saturn It has been a while since I made a tutorial for Project Saturn, but that will change in the near future. Since there are so many new members using Leadwerks I am going to make some free time for some new tutorials. In the past 3 months there were only a handful of viewers and that didn't quite way up to time spend on making the tutorials. That said I also upgraded from a parttime to a full time job which obviously really cuts in to my Game dev time. The first new video tutorials are already here: 21: 22: 23: Lua beginner tutorials I am also going to make some tutorials for the absolute beginners. For those that have very little to no experience, theses lessons should be very useful. Although these are Lua tutorials in general, they will be aimed towards usage in Leadwerks. FlowGUI I took the plunge in to selling my own Lua GUI library for Leadwerks: FlowGUI. Selling scripts/code for Leadwerks is something I wanted to do for years but I never really had the guts to actually try it. Now that I have made an initial release via webdownload, I am glad I did. I am happy with the amount of licenses sold so far, which makes it also a lot more fun to work on upcoming features such as inventories. I also hope that by providing extra downloadable content for Leadwerks, we will attract more people, were Leadwerks on itself will only benefit from. Last but not least it might also inspire other developers/artists to start selling their own work as well. Maybe when payed items are added to the workshop, this will really kick off. Jorn 'Aggror'
  6. How to make any object (polygons) to a Billboard? I have objects and want to attach text mesh labels but so that thy face the camera regardless of camera angle. I tried to parent the sprite to the text mesh but didn't work. Is there a Billboard script ?
  7. If I import a mesh into Leadwerks and set the physics property to convex hull or polymesh in the Physics tab and enable the nav obstical option, the models do not affect the navmesh at all.
  8. now i run my game and my player script is not up to date. seems it not compiled. how is this possible? i put some infos at screen, they not appear. maybe this is a combination of crash at export game. i will restart pc. very strange, restart pc not helped. my solution, save map under new name, run. script is up to date. load my work in progress map. script is up to date and i can edit there as usual, stay up to date at start.
  9. Hello everyone, I'm a newcomer to Lua and Leadwerks. I have imported a premade animated model into Leadwerks in FBX format. It works perfectly however I can't find any reference about activate animations through LUA scripting. E.g. I would like to make a character walking forward on W KeyHit. All tutorials I've found till now are about C++.. Can anyone help me?
  10. I think it would be valuable to have the Steam achievements API exposed through Lua since some people buy games only for achievements.
  11. Taking the risk that this is another derpy bug report on my part because today is the day I miss obvious things. After a fellow forumite has kindly pointed out to me how to get the mousewheel with the z axis of Window::GetMousePosition() I tried to do just that and I'm just not seeing a value in the z component other than 0. To make sure the fast update doesn't simply always reset my text output I made sure to only capture values other than 0. if self.window:GetMousePosition().z ~= 0 then mwheel = self.window:GetMousePosition().z end self.context:DrawText("Mouse Wheel axis: " ..mwheel,2,14) Directly below the FPS counter in App.lua. I defined mwheel in App:Start() as 0.1, turns out it never changes, ergo the z axis is never not 0. This works for x and y without problems but z is always 0 so I'm fairly certain this is not being an idiot again.
  12. I have a Lua script that has the following exposed property. Script.pawns = nil --entity "Pawns" The Pawns entity is a pivot used as a parent to several other entities. Inside the script, I use this reference to iterate through the children. childCount = self.pawns:CountChildren() for i=0, i<childCount-1, 1 do --Some action end This normally works great, but I've had three occurances of this reference suddenly reading as nil when no change occurred in the script, and the UI for the exposed property still shows the Pawns entity being linked. Once this nil error occurs, nothing short of deleting the Pawns pivot, creating a new pivot and re-parenting all my child entities, and re-linking the Pawns property corrects the problem. I have tried un-linking and re-linking the reference, removing and re-adding the script, nothing else seems to work, and I've made no change to warrent reference failure.
  13. Well, I bought the software, but I know nothing about Lua, and I really want to make at least a basic game in 3rd person, but I can't find any tutorial, I'm lost. Could someone help me with a link to learn Lua for games? Or a video-tutorial since the basic? Thanks. P.s. I'm brazilian so... I don't really speak english, I understand perfectly, but write... ~edit~ I already saw the tutorials here, but it's hard to understand because anybody really explain it for beginners The best tutorial I found was Jorn Theunissen's tutorial.
  14. Intro This is a hard post for me to make, I really dislike releasing code that isn't done and polished ( as people will inevitable judge your ability by the code ) on the other hand I've had to realize that if I do not then this will be another entry on my dead project pile - and I do believe that the community could benefit from it.. once it's in a more presentable shape at any rate. For some time now I've been working on porting myGUI to Leadwerks, or well honestly "working" is a bit of a misnomer as according to my version software I've not done anything use full for 5 weeks As somebody ( i forget who ) once said; The hardest part of a any project is finishing it. And that's very much the issue here, I've done all the challenging/fun bits and now there is "just" the finishing it left, so what needs to be done? Current state of the UI The C++ binding is 90% there ​RTT is missing, but should be trivial resource paths from files specified in XML files works but needs more thought (current implementation is guessing where the files are) comments may in places be in Danish (woops) Input handling uses standard leadwerks key inputs, which is less that satisfactory leak detection, it's been a few years since I've last used c++ ( or any unmanaged language ) so I'm quite paranoid about leaks [*]Lua binding lacks real world test to see what is needed [*]Automatic event binding is not yet supporting all widget types ( bascially just a whole lot of typing ) [*]Text labels seems to bleed through overlapping windows ( apparently because your supposed to have them on different layers and the demo does not do this - myGUI is still new to me as well ) [*]Switching between mouse look and cursor mode needs to be standardized ( currently relying on a modified fpsplayer ) [*]Linux only everything *should* work cross-platform but I do not currently have a OpenGL 4 windows machine ( my old media center is a fusion e450 which should in theory be OpenGL 4 compatible - so I may install windows on that at some point ) if anyone want's to try it out on windows I can guide them through the cmake settings required. Why My GUI? The default skin looks nice It's still maintained It has an agreeable license The developers have made a host of tools to actually work with the gui - you can find pre-compiled binaries for windows here ( works well with wine, or you can compile them on linux ) ​Skin creation tool Layout tool Font map tool ( but you can also use true type font's directly ) Widget creation tool etc [*]It's well documented http://mygui.info/docs/index.html [*] What's required in order to participate? At least Leadwerks license and a willingness to contribute, beyond that experience with any of the following is a nice bonus C++ Mercurial Lua valgrind "distributed" collaboration bitbucket Goal The ultimate goal is to provide a royalty free, free to use UI library to any and all Leadwerks users Licensing and commercial use myGUI is licensed under MIT http://mygui.info/#ui-tabs-15 but some of the companion libs have additional licenses, none of which preclude commercial/closed source use. A attribution template that can be copy/pasted into your games 'credit' section is planned. How can I participate? Assuming that I at this point sold you on the idea, shoot me a pm or reply here introducing your self and I'll add you to the bitbucket repository and help you get it working on your machine. (I've no idea how to make a publicly readonly repo there, and I'd rather not enable everybody writing to it all willy nilly) Keep in mind that as a working family father I've only about 2-6 hours / week of 'me' time so there may be some lag in replies but I'll try to be as quick about it as possible
  15. Greetings I am a newbie when it comes to the leadwerks engine and lua in general. I am trying to get LETheora to play videos in my game I assigned an ogg file to the script, but when i try to run it i get the following error message : The error occours in the following function function TheoraVideo:Init() if self.initialized == 0 then assert(package.loadlib("LETheora.dll", "luaopen_theoravideo"))() theoravideo.init() self.initialized = 1 end Please help
  16. Can't find any documentation on the mouse buttons in the KEY page Key.LButton Key.MButton Key.RButton Key.XButton1 Key.XButton2 While we are at it. What is XButton 1 & 2?
  17. I'm trying to make a terrain generator, I have the mesh plane generated, but I'm at a total loss at how to generate the uv's for all the triangles. This is the code that I currently have. How would I go about programmaticly adding uv's? function Script:MakeTerrain(TerrainSize) local terrain = nil terrain = Model:Create() terrain:SetColor(0.5,0.5,0.5) local surface = terrain:AddSurface() -- add vertexes System:Print("Generating Vertices") for TerrainWidth=0 , TerrainSize do for TerrainDepth=0 , TerrainSize do surface:AddVertex(TerrainWidth*self.TerrainSquareSize,0,TerrainDepth*self.TerrainSquareSize, 0,1,0) end end -- add triangles System:Print("Generating faces") trianglestrip = 0 System:Print(tostring(surface:CountVertices())) for triangle = 0 , (TerrainSize*TerrainSize)+(TerrainSize-2) do --(surface:CountVertices())/2 do point1 =trianglestrip point2 =trianglestrip+(TerrainSize+1) point3 =trianglestrip+(TerrainSize)-(TerrainSize-1) point4 = point3+(TerrainSize+1) System:Print("Bottom:"..tostring(point1+1).."|"..tostring(point2+1).."|"..tostring(point3+1).."["..tostring(point4+1).."]") System:Print("Top:"..tostring(point2+1).."|"..tostring(point3+1).."|"..tostring(point4+1)) surface:AddTriangle(point1,point3,point2) surface:AddTriangle(point2,point3,point4) trianglestrip =point3 end -- This is where you would add the uv's System:Print("Adding UV's") surface:Update(true) System:Print("") return terrain end
  18. Note: I'm very new to Leadwerks, so most likely I'm missing something obvious. I've created a 512x512 floor block and I'm trying to load a 4x4 square of them with the following code: --Dynamically create some dungeon geometry: System:Print("loading dynamic floor") self.floors = {} for i = 1, 4 do for j = 1, 4 do floor = Prefab:Load("Prefabs/Tinyboss/floor2.pfb") table.insert(self.floors, floor) floor:SetPosition(2048+512*i, 0, 512*j) System:Print(floor:GetPosition().x.." "..floor:GetPosition().y.." "..floor:GetPosition().z) end end self.FirstTime = false (I put it at the end of the App:Start function in app.lua. I also tried running it once in the App:Loop function, but that didn't help.) When I run with F6, I see all the stuff that I've added in the editor, but none of the dynamically loaded floor tiles show up. I can tell from the print statements that entities are getting loaded and their positions are being set, but I don't see any of them. Is there something else I need to do to add them to the current scene, or something else I'm missing here? Thanks!
  19. Calling it with no parameters it writes to the %appdata% (on windows) folder with a default filename, and this works fine when ran from the editor. When called from a published project it creates the file ok, but then crashes. To test just add something like this in App:Loop() if self.window:KeyHit(Key.F5) then self.context:Screenshot() end Output from running in editor: Executing "F:\LeadwerksProjects\BugTest_ScreenshotCrash\BugTest_ScreenshotCrash.exe"... Initializing Lua... Executing file "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Scripts/Error.lua" Executing file "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Scripts/App.lua" Initializing OpenGL4 graphics driver... OpenGL version 441 GLSL version 430 Device: AMD Radeon R9 200 Series Loading map "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Maps/temp.map"... Loading material "F:/LeadwerksProjects/BugTest_ScreenshotCrash/materials/developer/bluegrid.mat"... Loading texture "F:/LeadwerksProjects/BugTest_ScreenshotCrash/materials/developer/BlueGrid.tex"... Loading shader "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Shaders/Model/diffuse.shader"... Loading material "F:/LeadwerksProjects/BugTest_ScreenshotCrash/materials/developer/orangegrid.mat"... Loading texture "F:/LeadwerksProjects/BugTest_ScreenshotCrash/materials/developer/orangegrid.tex"... Loading texture "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Materials/Common/bfn.tex"... Loading shader "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Shaders/Misc/occlusionquery.shader"... Loading shader "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Shaders/Model/Shadow/shadow.shader"... Loading shader "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Shaders/Lighting/directionallight.shader"... Writing screenshot "C:\Users\Ben\AppData\Local/BugTest_ScreenshotCrash/Screenshots/screenshot1.tga"... Saved screenshot "C:\Users\Ben\AppData\Local/BugTest_ScreenshotCrash/Screenshots/screenshot1.tga". Setting breakpad minidump AppID = 251810 Steam_SetMinidumpSteamID: Caching Steam ID: 76561198056655896 [API loaded no] Process Complete. Output from running published project (tried both encrypted and unencrypted): Initializing Lua... Warning: Lua sandboxing disabled. Executing file "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Scripts/Error.lua" Executing file "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Scripts/App.lua" Initializing OpenGL4 graphics driver... OpenGL version 441 GLSL version 430 Device: AMD Radeon R9 200 Series Loading map "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Maps/start.map"... Loading material "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/materials/developer/bluegrid.mat"... Loading texture "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/materials/developer/BlueGrid.tex"... Loading shader "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Shaders/Model/diffuse.shader"... Loading material "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/materials/developer/orangegrid.mat"... Loading texture "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/materials/developer/orangegrid.tex"... Loading texture "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Materials/Common/bfn.tex"... Loading shader "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Shaders/Misc/occlusionquery.shader"... Loading shader "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Shaders/Model/Shadow/shadow.shader"... Loading shader "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Shaders/Lighting/directionallight.shader"... Writing screenshot "C:\Users\Ben\AppData\Local/BugTest_ScreenshotCrash/Screenshots/screenshot3.tga"... It stops there and pops up with The screenshot file is created ok but the program stops running. In the attached project press F5 and it should trigger it. EDIT: Just changed back to the non-beta branch and it is the same, crashes for me but the screenshot is written ok. BugTest_ScreenshotCrash_published.zip
  20. I first noticed this on a mesh generated using the Surface class but have also checked it against the default teapot model. The result of a pick ( World:Pick() ) will always have triangle 0 instead of whatever the correct triangle id is. I am using the latest Steam version of Leadwerks and my project is up to date. I'll try to put together a simple demonstration scene but it should be pretty easy for anyone to confirm this. It's pretty much as simple as: local Picked = PickInfo() local Hit = World:GetCurrent():Pick(StartPos,EndPos,Picked,0,true) --true for getting the 'nearest' hit --make sure StartPos and EndPos go through a model print(Picked.triangle) --always 0
  21. I'm unable to change the size of the Font in Leadwerks. I originally had the problem in my own project. To remove all of my own interference I made a map with code from the Documentation Font:GetFont. To change the font size I alter this line: local font = Font:Load("Fonts/Arial.ttf",36) Changing the "36" to 12,18,24,48,60 or 72 makes no change to the size of the font. Am I doing something wrong or is it a bug? font Test.zip
  22. Is it possible to attach a script to an entity created with code? My searching suggests that there was a function called Entity:SetScript() but I can't find it when searching the documentation (and I am not at the computer with LeadWerks to test it right now). EDIT: Ok it looks like Entity:SetScript() does exist but isn't documented. Some documentation would be nice, I still need to experiment to see whether Script:Start() is called automatically or not after attaching it.
  23. While making my game I ran into a situation where I needed to kill the player reliably and not depend on fall damage. The solution was to create a trigger that when the player touches it, they die. Kill_trigger.lua function Script:Collision(entity, position, normal, speed) if entity.script then if entity.script.health>0 then if type(entity.script.Hurt)=="function" then entity.script:Hurt(entity.script.health+1,"WORLD") end end end end WARNING: If the player is to FALL ON TOP of the trigger, the kill trigger MUST be almost paper Thin. Otherwise your dead body will keep bouncing as if were on a trampoline. I used it for when the player falls in the water. When they fall in the river they die/drown.
  24. Hi Guys. I need some help with my PlayerAmmoBar script. This script is almost identical to Aggrors PlayerHealthBar script from his excellent video tutorials. Ive made some changes to it so that it graphically represents the amount of Ammo a player has left. The problem I have is that in Aggrors script he is able to get the health information from scripts belonging to the player by using this: self.player = self.entity:GetParent() From there he creates a healthFactor from self.player.script.health / self.player.script.maxHealth (these scripts belong to the Player entity. However for Ammo the information comes from self.Weapon.script.ammo / self.Weapon.script.clipsize. These scripts belong to the Autopistol.pfb which is attached to the player. Now I've tried GetParent (doesnt work because it not the parent) GetChild, Findchild didnt seem to work for me either. To confuse matters more I was looking at the FPS player script and found this line self.weapon.entity:SetParent(self.camera) So does that mean that the weapon is a child of the camera!? Any help would be greatly appreciated.
  25. NewPalette

    require

    I'm just starting out with scripting in Leadwerks, having had a fair bit of experience with Love2d, and I'm having trouble with some standard Lua functions that I think should be working. In particular, I'm having trouble loading modules using the require function. I see people using the require function in examples, but when I try it I get "attempt to call global 'require' (a nil value)". It's as though the Lua standard libraries aren't loaded. Is there something I'm missing? Thank you, ye more-experienced-than-me, for any help.
×
×
  • Create New...