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

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. 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 )
  2. 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!
  3. 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
  4. 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
  5. 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
  6. 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!
  7. 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
  8. 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
  9. 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?
  10. 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
  11. 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)
  12. Line 10 Script.playerHeight = 1.8 --float "Player Height" Line 86 --local playerTempHeight = ((self:IsCrouched() == 1) and crouchHeight or playerHeight)
  13. This script will crash the editor (EXCEPTION_ACCESS_VIOLATION) if attached to a pivot and dragged into the Flowgraph. TriggerDelayMapLoad.lua
  14. 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!
  15. 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
  16. can someone please help me i made a inventory for my game but when you place items in the inventory the image does not show i have gone over and over cant cant find the error. can anyone do me a working inventory script please :-) would appreciate it.
  17. If anyone needs, I'll leave it here Timer: if Timer~=nil then return end Timer={} function Timer:Create(name, interval,enable) local timer={} timer.name = name timer.interval = interval timer.enable = enable timer.time = Time:GetCurrent()+timer.interval local k,v for k,v in pairs(Timer) do timer[k] = v end return timer end function Timer:Update() if self.enable then if Time:GetCurrent() > self.time then self.time = Time:GetCurrent()+self.interval return true else return false end end end How to use: function App:Start() --Timer self.time_hours = 0 self.time_minutes = 0 self.time_seconds= 0 self.timer = Timer:Create("timer",1000,true) end function App:Loop() --Very complex calculation time if self.timer:Update() then self.time_seconds= self.time_seconds+1 if self.time_seconds== 60 then self.time_minutes = self.time_minutes+1 if self.time_minutes == 60 then self.time_hours = self.time_hours+1 self.time_minutes = 0 end self.time_seconds= 0 end end --Draw current time self.context:SetColor(1,1,1,1) --Seconds local seconds if self.time_seconds < 10 then seconds = "0"..self.time_seconds else seconds = self.time_seconds end --Minutes local minutes if self.time_minutes < 10 then minutes = "0"..self.time_minutes else minutes = self.time_minutes end --Hours local hours if self.time_hours < 10 then hours = "0"..self.time_hours else hours = self.time_hours end local time_string = hours..":"..minutes..":"..seconds self.context:DrawText("Timer: "..time_string,2,2) end
  18. There is a way to get the texture of the buffer, without a strong drawdown FPS? Simple code of Monitor: function Script:Start() --Material self.material = Material:Load("Materials/Monitor/monitor.mat") self.entity:SetMaterial(self.material) --Buffer self.buffer = Buffer:Create(App.window:GetWidth(),App.window:GetHeight(),1,0); self.buffer:SetColorTexture(Texture:Create(App.context:GetWidth(),App.context:GetHeight())) self.buffer:Disable(); end function Script:UpdateWorld() self.buffer:Clear() self.buffer:Enable() self.entity:Hide() --self.camera:Show() App.world:Render() --self.camera:Hide() self.buffer:Disable() self.material:SetTexture(self.buffer:GetColorTexture(),0) Context:SetCurrent(App.context) self.entity:Show() end One monitor, point light and room 4x4 As a result, the FPS - 5 If two monitor FPS - 10 etc Implementation in irrlicht engine: ITexture* RTTTex = driver->createRenderTargetTexture(dimension2d<s32>(512,512)); Result over 75 fps (For me) Demo, Source code and shaders: irrlicht.zip
  19. Where can I find tutorials for LUA?
  20. I want to hire a programmer to code a Login System or HWID lock with an online database. So I can manage my tool sales easier... I managed to make the tool but I don't know if I'm able to make the login system in LUA. I'm willing to pay someone to do this!
  21. Just got this message ???? Why is that? Is it my ram (i have 16gb)? Is it my gpu memory (I have an nvidia 650 ti boost 2gb superclocked)...
  22. Please add in the next update - opportunity to get a type from the file material. I think it will be very comfortable and functional. You can make a return type int... int Material::GetType(); //Returns the type of material "Metal, Concrete, Wood, Water, Flesh, Grass etc.." Example of use: --FPSPlayer Footsteps Get type function Script:Collision(entity,position,normal,speed) if speed>20 then self:Hurt(100) end if entity:GetMaterial():GetType() ~! nil then if entity:GetMaterial():GetType() == Material:Type:Concrete then self.sound.footsteps.type = 1 end if entity:GetMaterial():GetType() == Material:Type:Metal then self.sound.footsteps.type = 2 end --etc end end Useful for the sound of footsteps, traces of bullets, particles etc.
  23. Something weird is happening. I have two objects with the scame script on them. Here is the code: Script.enabled=0 --bool "enabled" Script.int=0 Script.tab={1} function Script:UpdateWorld() System:Print("------------starts "..self.entity:GetKeyValue("name")) System:Print("int="..self.int) System:Print("#="..#self.tab) System:Print("[#]="..self.tab[#self.tab]) if not self.enabled then return end self.int=self.int+1 self.tab[#self.tab+1]=math.random(1,9) System:Print("-----------END "..self.entity:GetKeyValue("name")) end It has boolean variable which is set to true for one entity and to false for another entity in the editor. it also has one number variable (int) and one table (tab). Script with "enabled" entity ads +1 to int variable and one extra table element with random value each update. And here is what I get in output: ------------starts Pivot 1 (enabled) int=0 #=1 [#]=1 -----------END Pivot 1 (enabled) ------------starts Pivot 2 (disabled) int=0 #=2 [#]=4 ------------starts Pivot 1 (enabled) int=1 #=2 [#]=4 -----------END Pivot 1 (enabled) ------------starts Pivot 2 (disabled) int=0 #=3 [#]=8 ------------starts Pivot 1 (enabled) int=2 #=3 [#]=8 -----------END Pivot 1 (enabled) ------------starts Pivot 2 (disabled) int=0 #=4 [#]=7 ------------starts Pivot 1 (enabled) int=3 #=4 [#]=7 -----------END Pivot 1 (enabled) ------------starts Pivot 2 (disabled) int=0 #=5 [#]=9 ... (Added space after each update for easier reading) As you can see int variable increases in "enabled" entity and doesn't change in "disabled". Also disabled entity doesn't print last ("---END") line, so it is really disabled. But for some reason the table changes for both of those entities. It has same amount of elements and the last element is the same (it was generated randomly) for both scripts. Can you please explain me what is going on here?
  24. Hello, Ive been working off and on on learning the in and out of Leadwerks but I am running into a problem when it comes to scripting in lua. You see while I understand the basic syntax of the language I am having trouble using the built in editor due to the fact that I am having trouble with the technical command terms. I have a hard time with spelling some of these terms like transform and others I simply cant remember if they even exist without combing through the wiki. So does the built in editor have a option to bring up a list of suggested commands like if one types in a "t" it will bring up a list of all commands that begin with the letter t. Or is there another editor all together exist that will do this? Basically I need this to be idiot proofed, thanks.
  25. Hi there! I was just wondering if anyone has any ideas of how to make a Character Controller's jump "sharper", ie: jumps to desired max height as quick as we want, then falls to ground as quick as we want? I'm using the entity:SetInput() to move the Character Controller. Thanks!
×
×
  • Create New...