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
  • Direct Macro

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

  • 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. So i was starting a new project and modeled an Player with some bones. It is in a third person view and the problem is that you cant see where the player looks (to pick up objects). So I just started to Insert the camrotation on the x axis inro a SetRotation function. 1. function Script:UpdateWorld() 2. self.entity:SetRotation(Math:self.camRotation.x,0,0) 3. 4. end I get the error: function arguments exspected near "." , (in the 2. line) The herarchy looks sth like this : Player(fpsPlayer) SantaModel ->arms ... -> Head (right here is the Script attached) Camera(this has no script but is attached to Player) I dont know wheres the problem , it is probably some newbie mistake. To make sure, the camRotation.x is in an other script.
  2. So i was starting a new project and modeled an Player with some bones. It is in a third person view and the problem is that you cant see where the player looks (to pick up objects). So I just started to Insert the camrotation on the x axis inro a SetRotation function. 1. function Script:UpdateWorld() 2. self.entity:SetRotation(Math:self.camRotation.x,0,0) 3. 4. end I get the error: function arguments exspected near "." , (in the 2. line) The herarchy looks sth like this : Player(fpsPlayer) SantaModel ->arms ... -> Head (right here is the Script attached) Camera(this has no script but is attached to Player) I dont know wheres the problem , it is probably some newbie mistake. To make sure, the camRotation.x is in an other script.
  3. Platform: Windows. Downloads: FPS Player scenario (Preconfigured scenario ready to play Updated 08/may/2015) https://dl.dropboxusercontent.com/u/107114506/Leadwerks/LUA%20XBOX%20360%20controller%20FPS%20Template.rar Marble game ball (Preconfigured scenario ready to play Updated 03/may/2015) https://dl.dropboxusercontent.com/u/107114506/Leadwerks/Marblegame%20XBOX360%20controller%20template.rar Only DLL: (Updated 08/may/2015) https://dl.dropboxusercontent.com/u/107114506/Leadwerks/SDL2.dll%20and%20LuaGamePad.dll.zip Note: - You must have connected the XBOX 360 controller to work. - If you want put the code in you proyect, copy and paste the "LuaGamePad.dll" and "SDL2.dll" in your project folder. ----------------------------------------------------------------------------------------------------------------------------------- New update!! Data: 08/May2015 Working hard on my free time, I developed the LUA FPS XBOX 360 controller. What's new: - The movement is now analog (Left stick). - The view is now analog (Right stick). - The sprint is now analog (Right Trigger). - The sound of the steps are automatically adjusted to the speed of the player, also considers the sprint. It is fully preconfigured and is 100% functional, I've tested with the FPS Weapons Pack and works fine. If you find a bug please send me a report. Open the project and open the "07-AI and Events.map" The "FPSPlayer XBOX360 controller adapted.lua" is in the same folder that "FPSPlayer.lua" The empty template XBOX 360 controller is in the "Scrips / objects / XBOX 360 controller" folder. Controller mapping: ----------------------------------------------------------------------------------------------------------------------------------- Data: 03/May2015 Hello everyone! I work hard to create a Lua XBOX 360 controller template. (Based on the work of Skrakle). http://www.leadwerks.com/werkspace/topic/12476-lua-lib-game-controller-support/ Upgrade Author: Daniel0213 What's new: DRIVER: I have expanded the functions and recompile the driver. I added: - The right analog stick is now functional. - The left and right trigger just happen to be digital to be analog + digital. SCRIPT: - The script is not oriented to App.lua, now is oriented to the object you want to control, the player. (You must insert the script on the object that you want to control). - I created a template fully explained with comments. - I've written and adapted the formulas needed to converter from analog value to Leadwerks. Not any knowledge of analog sensors are required to write your own program. The code gives you automatically a converted analog value. - To change analog values you do not need to enter the code can be changed quickly from outside. - Reduced the death zone of analogue sensors, but can be changed easily. The instruction have a comment. - I separate all the buttons to make it easier to interpret the code. - You can choose externally the number of controller you want to use. ------------------------------------------------------------------------------------------------------------------------------------ I inserted the code in the template marble game, for a practical example of the operation display. Within the project it is the empty template XBOX controller and inserted into the ballplayer template for a practical example. (I have asked permission to Josh to do this) The empty template XBOX 360 controller is in the "Scrips / objects / XBOX 360 controller" folder. The "ballplayer" script has been modified to insert the sample code. Changed the name to "ballplayer Adapted to XBOX 360 controller." I'm using the Leadwerks version 3.5 Beta. ------------------------------------------------------------------------------------------------------------------------- HOW INSTALL: Very simple. 1. Unzip the .rar file. 2. Copy the "XBOX360controllertemplate" folder in your Leadwerks project folder. 3. Open leadwerks, go to "project manager" Push "import" enter to "XBOX360controllertemplate" folder and select the "XBOX 360 controller template.werk" file. 4. Select the project and press "OK". You must disable the sandbox lua libraries to work xbox 360 controller. ----------------------------------------------------------------------------------------------------------------------------------- How analog sensors work: Put the desired maximum values. In this case, when the left stick reaches its peak (up direction), the analog value which will be 15. Decreasing this value progressively until it reaches 0, when you reach the death zone. Don't touch the formula. ------------------------------------------------------------------------------------------------------------------ A bit of theory: The Analog converted formula. (Don't worry, you don't have to create, it is already written in the template code.) ENJOY!!! Future upgrades: - Add left and right vibration. - Linux support. Note: If you want put the code in you proyect, copy and paste the "LuaGamePad.dll" and "SDL2.dll" in your project folder.
  4. The lua example script used for Camera:GetProjectionMode() and Camera:SetProjectionMode() will cause an error since the variables 'Camera.Perspective' and 'Camera.Orthographic' are nil.
  5. Hello, guys. I'm coming from Unity and having played around with the Steam demo of Leadwerks 3, I'm very curious about how you normally go about composing your game objects. In Unity, you create components (scripts) where each component adds some kind of functionality to any game object you add it to. I read on a blog about how the devs of Leadwerks want to compatrmentalize logic in small chunks (much like Unity does it I guess), but in the example maps I see no such thing. You have an object (say, a CSG primitive) and you can add a single Lua script to it. So how do I add multiple scripts to a single object where each script adds some functionality? From what I've seen, both FPSPlayer and AIMonster had their own movement, health, and damage handling implementations. A lot of the same (or very similar) code copied over. I find this worrying. Is there a modular way to do this? Note: I'd prefer to work in Lua. Coz Lua rocks!
  6. I'm looking to see if there is a way to detect if the game is running in the lua sandbox (example: in the game player) or as a standalone game? I would like to detect this so I can use IO to read and write settings in standalone and load the defaults with the sandbox enabled.
  7. Hi! So, I have been looking around for a way to make a controller or gamepad work in Leadwerks, but most of the posts here seems to be outdated... Have anyone actually got this working right? Thanks! Regards, KraXarN
  8. When you create a Lua project, there are two C++ files listed under the Source folder. Suppose I want to recompile these. Does anyone know how I would go about doing this with VS 2013 (like step-by-step)? (I'm new to C++ for Windows, I primarily worked with C++ on Linux )
  9. The thing is: how can I use a variable in one script stated on other script in lua? On example: I have 2 scripts: fps_gun.lua with a variable of ammo_count and a script App.lua with a variable named ammo_ammount. How can I use a ammo_count in App.lua(4example ammo_ammount=ammo_count) Thanks beforehand!
  10. While programming it became an increasing hassle to key track of what variable was a mouse button and what command was from the keyboard. So I wrote a function that will treat the mouse and the keyboard as the same input. -- This creates a function that is capable of handeling both keyboard and mouse input function InputHit(keycode) local window = Window:GetCurrent() local context=Context:GetCurrent() if keycode == Key.LButton then return window:MouseHit(Key.LButton) end if keycode == Key.RButton then return window:MouseHit(Key.RButton) end if keycode == Key.MButton then return window:MouseHit(Key.MButton) end return window:KeyHit(keycode) end function InputDown(keycode) local window = Window:GetCurrent() local context=Context:GetCurrent() if keycode == Key.LButton then return window:MouseDown(Key.LButton) end if keycode == Key.RButton then return window:MouseDown(Key.RButton) end if keycode == Key.MButton then return window:MouseDown(Key.MButton) end return window:KeyDown(keycode) end I'm still trying to figure out how to get the mouse wheel without interrupting anything
  11. This is my code: DeathTrigger.lua (attached to a box) Script.respawnPoint = "" --Entity "respawn point" function Script:Collision(entity, position, normal, speed) if(entity:GetKeyValue("name") == "Player") then spawnPos = self.respawnPoint:GetPosition() --entity:SetPosition(spawnPos) entity:Respawn(spawnPos) end end and FPSPlayer.lua (attached to the player) function Script:Respawn(spawnPos) self.entity:SetPosition(spawnPos) end When they collision I get this error: I have a Pivot indicating the respawn point: Line 65 is this from DeathTrigger.lua: entity:Respawn(spawnPos) From my point of view it should work. Any help? Edit: I just found it out. Turns out that this works: entity.script:Respawn(spawnPos) A little explanation would be welcome
  12. Hai! I have a function for changing the music track in my game and it works fine and all, but I also want it to get the total length of the track... Here is my function I'm currently using: function App:SwitchMusic(name) App.source:Stop() local sound = Sound:Load("Sound/BGM/" .. name .. ".wav") App.source:SetSound(sound) App.source:Play() end I tried adding something like App.tracklength = Math:Round(self.name:GetLength()) But it only returns in an error, since I guess it's trying to find a loaded sound with the name "name" and not from the variable. Do anyone have any idea how I can solve this? Thanks! KraXarN
  13. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/context/contextsetscale-r728 I wanted to scale my GUI using the setscale command and found some of the drawing commands do not function correctly. The drawrect command works properly. The plot command does not scale at all. The line command does not work properly in straight lines horizontally or vertically, but it does diagonally. Hear is code to test and explain: --This function will be called once when the program starts function App:Start() --Initialize Steamworks (optional) --Steamworks:Initialize() --Set the application title self.title="MyGame" --Create a window local windowstyle = window.Titlebar if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end self.window=Window:Create(self.title,0,0,System:GetProperty("screenwidth","1024"),System:GetProperty("screenheight","768"),windowstyle) --Create the graphics context self.context=Context:Create(self.window,0) if self.context==nil then return false end return true end --This is our main program loop and will be called continuously until the program ends function App:Loop() --If window has been closed, end the program if self.window:Closed() or self.window:KeyDown(Key.Escape) then return false end --Update the app timing Time:Update() self.context:SetScale(2,2) -- everything should be twice as big self.context:SetColor(self:rgbatovec4scalar({255,255,255},255)) self.context:DrawRect(0,0,200,200) -- This is the size the line squares should be at self.context:SetColor(self:rgbatovec4scalar({100,100,100},255)) for y = 1 , 200 do -- this should make a solid square, not rectangle self.context:DrawLine(5, y , 205, y ) -- draw square at an offset so you can see its dimensions in a relative manner end self.context:SetColor(self:rgbatovec4scalar({80,100,100},10)) for x = 5 , 205 do -- this should make a solid square also self.context:DrawLine(x, 5 , x, 205 ) -- draw square at an offset so you can see its dimensions in a relative manner end self.context:SetColor(self:rgbatovec4scalar({255,0,0},255)) self.context:DrawLine(0,0,200,200) -- the line is off from actuall 0,0 by a few pixels but it is the size self.context:SetColor(self:rgbatovec4scalar({0,255,0},255)) self.context:Plot(200,200) -- this should actually be at the edge of the white box but its at real cordinates 100,100 --Refresh the screen self.context:Sync(true) --Returning true tells the main program to keep looping return true end function App:rgbatovec4scalar(rgb,a) return Vec4(rgb[1]/256,rgb[2]/256,rgb[3]/256,a/256) end As long as this is does not function as intended, my gui will have to be put on the backburner.
  14. Hello everyone, I am trying to get a count of how many crates i have but am having a hard time figuring out how to refer to them directly to get a proper count. I want to do this to be able to track crates as i get rid of them and to add in new ones as they are generated. Thanks for any help!
  15. I'm creating a FPS game but I've run into a problem with the Pistol prefab. I have a health bar for the player ( from Aggrors video tutorials) and every time I fire the pistol the health bar flashes simultaneously with the muzzle flash. Any help would be appriciated.
  16. Hello! I wanted to make some sort of message box to pop up for the player if for example an error occurred and I wanted it to show a popup box instead of just logging it into a console. Is this possible? If not, is there a module or something to add the ability to do this? Thanks, KraXarN
  17. A simple example of a multiple text. function App:Start() self.maxTextWidth = 128 self.sourceText = "Text" self.tempText = "" self.text={} self.lineCount = 0 for w in string.gmatch(self.sourceText, "[%p%a%d]+") do if defaultfont:GetTextWidth(self.tempText) < self.maxTextWidth then self.tempText = self.tempText.." "..w else --We need to find the last word, learn length, and delete it. local temp1 = string.reverse(self.tempText) local temp2 = string.sub(temp1, 1, string.find(temp1," ")) temp2 = string.reverse(temp2) local temp3 = string.sub(self.tempText, 1, string.len(self.tempText)-string.len(temp2)) --Add new line to list. self.text[self.lineCount] = temp3 self.lineCount = self.lineCount + 1 self.tempText = "" --Now we can add the last word to new line. self.tempText = self.tempText..temp2.." "..w end end self.text[self.lineCount] = self.tempText self.lineCount = self.lineCount + 1 self.tempText = "" return true end function App:Loop() --Test text self.context:SetBlendMode(Blend.Alpha) self.context:SetColor(1,1,1,1) for i=0,self.lineCount,1 do self.context:DrawText(self.text[i],150,(150)+15*i); end self.context:SetBlendMode(Blend.Solid) self.context:Sync(true) return true end
  18. A post here about theora made me remember the previous LE2.31 implementation done by community member Niosop, who graciously provided a route for us to put *.ogg videos into LE via entity scripts. After updating his scripts to LE3.2 Indie scripts, I was able to get it working. I had planned on posting it via the workshop but I had a number of issues with it. One of the issues was that I couldn't get it to expose the script variables in the properties dialog when you attached the needed workshop script - so no easy way to select the video you wanted to play. In any case until that is sorted, here are the updated LETheora scripts with the example tv model that was created by our dear late community member . LETheora.zip The script is set up to allow you to pick an *.ogg video via the properties dialog after you attach the 'video_entity.lua' script to the mesh you want to view it on. In the case of the 'Old-TV' model, you would attach the script to the child mesh named 'Screen', then pick the *.ogg file you want to play.
  19. Hi! I cannot understand how to use your font for button. And then use a standard font. --Font local context = Context:GetCurrent() button.font = Font:Load("Fonts/Test.ttf",32) --Custom button.defaultfont = context:GetFont() --Arial button.color = Vec4(1.0) Pay attention! I do not release fonts from memory. function Button:Draw() local context = Context:GetCurrent() local window = Window:GetCurrent() if self.enable then if self.visible then context:SetBlendMode(Blend.Alpha) --Set user font if self.font then context:SetFont(self.font) else self.font = self.defaultfont end context:DrawText(self.title,25,25) --Set default font context:SetFont(self.defaultfont) context:SetBlendMode(Blend.Solid) end end end Log: Maybe I'm doing something wrong?
  20. I have standard edition of Leadwerks and I'm working in beta branch now (Leadwerks 3.5). After last update I have noticed a problem with flowgraph editor. My function: function Script:EnterType()--arg return self.collidedEntityType end is not reflected in the flowgraph and therefore I cannot trasmit this agrument to the input function (with --in) Only output and input methods are showed in the graph. Arguments are not. (Windows 8.1, GeForce GTX 460)
  21. Hello! So I had an old post and find the real problem, so I made another post... Whenever I publish my game from the project manager Steamworks always fails to load, even with Sandboxing enabled or disabled. The code I used to load Steamworks is: if not Steamworks:Initialize() then Debug:Error("Failed to load Steam") end Whenever I have sandboxing enabled or not, it always works when in the editor and when just running the .exe file from the folder, Steamworks loads and everything is fine. It really feels like I'm missing something :/ Thanks, KraXarN EDIT: Forgot to add a steam_appid.txt, oops... It all works fine now
  22. Line 10 Script.playerHeight = 1.8 --float "Player Height" Line 86 --local playerTempHeight = ((self:IsCrouched() == 1) and crouchHeight or playerHeight)
  23. Playing around with a script that allows the user to pick a color from the object panel to be used with a shader. Setting the initial value of the color works as expected and fills out the property panel correctly: Script.MyColor = Vec4(1,0,0,1)--Color "MyColor" But if the color property is modified via the panel, then it will return a number based on the 0-255 scale which will fail in the shader. In an attempt to work around this, I changed my initial value to: Script.MyColor = Vec4(255,0,0,255)--Color "MyColor" which results in this: which gives weird property panel results and still would be unuseable in my shader without dividing each component by 255. Since I have no viable method to determine if the color is being set by default or by the color picker, the returned color needs to be on a 0-1 scale to work properly. example script: Script.MyColor = Vec4(1,0,0,1)--Color "MyColor" function Script:Start() local color = self.MyColor System:Print(color.r..", "..color.g..", "..color.b..", "..color.a) self.entity:SetColor(color) end
  24. This script will crash the editor (EXCEPTION_ACCESS_VIOLATION) if attached to a pivot and dragged into the Flowgraph. TriggerDelayMapLoad.lua
  25. Hello, can anyone give me a hint or a link that explains how to create Lua classes similar to those built into Leadwerks? For example, Leadwerks has a Model class, and you can do a Model:Create() in order to create a new model. I would like to have my custom classes, eg. Block, with a method Block:Create(). I know that Lua classes are, in fact, made in C++ and disposed via Lua interface. I have a Leadwerks standard edition, but would prefer not to fiddle at this point with C++ (which I've, BTW, learned, so I can use it). But if it's necessary, I would gladly ask for some hint/advice where to start. Thanks in advance!
×
×
  • Create New...