Jump to content

Search the Community

Showing results for tags 'lua'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Models
    • Animals
    • Barriers
    • Characters
    • Containers
    • Environments
    • Furniture
    • Props
    • Rocks
    • Vegetation
    • Vehicles
    • Weapons
  • Materials
    • Brick
    • Cartoon
    • Decals
    • Dirt
    • Grass
    • Industrial
    • Medieval
    • Metal
    • Plastic
    • Plaster
    • Rock
    • SciFi
    • Sky
    • Signs
    • Tile
    • Stone
    • Walls
    • Wood
  • Plugins
  • Scripts
    • GUI
    • Object
    • Utilities
  • Shaders
    • Post-Processing Effects
    • Surface
  • Sounds
    • Ambience
    • Effects
    • Music
  • Tools
  • BATTLE LEAGUE's Assets
  • BATTLE LEAGUE's Mods

Blogs

There are no results to display.

There are no results to display.

Forums

  • Leadwerks
    • Technical Assistance
    • General Discussion
    • Programming
    • Game Art
    • Suggestion Box
    • Bug Reports
  • Platforms
    • Windows
    • Mac
    • Linux
  • Community
    • Showcase
    • Promotion
    • Off-topic
  • BATTLE LEAGUE's Topics
  • Away from Home's Zone Script
  • Away from Home's General
  • Away from Home's Zone Rigging / Modeling
  • Vec-Tec's Releases
  • Vec-Tec's Topics
  • Forth's Development
  • Forth's Game design
  • Forth's Graphics
  • Forth's Documentation
  • Forth's TODO
  • Forth's IMPORTANT
  • Forth's Screenshots
  • The uncertain world's Game Design
  • The uncertain world's Programming
  • The uncertain world's TODO
  • The uncertain world's Graphics
  • The uncertain world's Screenshots
  • Muerte's Discussion

Categories

  • Records
  • Entity
  • Command Reference
  • Vec3
  • Vec4
  • Script Reference
  • Shader
  • Index
  • Material
  • Object
  • Buffer
  • Asset
  • Font
  • Shape
  • Sound
  • Texture
  • App
  • Context
  • Model
  • Light
  • DirectionalLight
  • PointLight
  • SpotLight
  • Attractor
  • Camera
  • Emitter
  • Listener
  • Pivot
  • Bone
  • Sprite
  • FileSystem
  • Key
  • Source
  • Surface
  • Math
  • AABB
  • dVec3
  • Mat3
  • Mat4
  • Plane
  • Transform
  • Vec2
  • Vec3
  • Vec4
  • Mutex
  • Prefab
  • PickInfo
  • Map
  • Stream
  • System
  • Thread
  • Time
  • Window
  • World
  • Driver
  • SoundDriver
  • GraphicsDriver
  • PhysicsDriver
  • OpenGL2GraphicsDriver
  • OpenGLES2GraphicsDriver
  • OpenALSoundDriver
  • NewtonDynamicsPhysicsDriver
  • Draw
  • Color
  • Blend
  • Joint
  • Debug
  • Component
  • Steamworks
  • LensFlare
  • Vehicle
  • Decal
  • Quat
  • Leaderboard
  • Probe
  • Analytics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


Interests

Found 362 results

  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. How do I end a Leadwerks program using a script. I would to like to end the program when the quit button is pressed but can't work out how to do this. Also should I release all entities and sounds before closing or doesn't it matter. Thanks in advance.
  3. 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
  4. 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):
  5. 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
  6. 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'
  7. 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 ?
  8. 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.
  9. MarkusR

    LUA compile?

    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.
  10. 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?
  11. I think it would be valuable to have the Steam achievements API exposed through Lua since some people buy games only for achievements.
  12. 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.
  13. 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.
  14. 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.
  15. 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
  16. 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
  17. 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?
  18. 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
  19. 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!
  20. 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
  21. 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
  22. 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
  23. 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.
  24. 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.
  25. 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.
×
×
  • Create New...