Jump to content

Search the Community

Showing results for tags 'lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

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

Forums

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

Categories

  • Tutorials
  • Games
  • Work in Progress

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location

  1. If I buy the pre-order for 3.1 then will I get the latest version right now? There is nothing else in the store. (no other versions)
  2. OK, sorry that this is not really a specific programming with the Leadwerks engine question, but more towards the language in general. I haven't got the engine yet but I will get it once I am able to, but I want to start learning some LUA before I purchase the engine so that I am able to jump in and start using it and learning how to use LUA with the engine. So my question is, how might you guys (and gals?) recommend me going about learning LUA, do you know of any good books I can pickup or free websites that I could use, also keeping in mind that I fully intend on using Leadwerks with LUA as soon as I can... I'm going to be off Googling some stuff on my own anyway but I'd appreciate your opinion's and thoughts or advice towards this! Kind Regards Patrick
  3. I'm totally new to Leadwerks, I currently play with the Indie edition for windows until Linux get released. I implemented my own FPS Controller using the default script on a cylinder object. Now I wonder what makes the camera not to render the object it attached to? I did not find anything in the FPS script nor the weapon script. I'm trying to convert the FPS controller to 3rd person one...
  4. I think it would be cool if we had a forum here just for snippets because I have a lot that aren't full fledged files so I don't want to put them in the asset store, and I'm horrible at organizing this stuff myself, plus I sometimes code on different machines so it would be nice to have it stored online and since they are LE oriented why not have a forum here for them? Going to see how this is accepted So using Lua I have a script attached to multiple entities that I want to know when they get picked. It would be inefficient to place picking checks in the entity script since it would run that code for every entity in the scene. So instead I decided to make a generic picking function that I'll place in App.lua and it'll call a function to an attached script to the entity that was picked if said function exists. This assumed App has a camera variable. By default in the Lua template no camera is created. What I did was make a camera entity, attach a script, and inside Script::Start() I did: App.camera = self.entity function App:HandlePicking() -- look for mouse picks and fire a function in the attached script if one exists if self.window:MouseHit(1) == true then local pickinfo = PickInfo() local p = self.window:GetMousePosition() if self.camera:Pick(p.x, p.y, pickinfo, 0.5, true) == true then if pickinfo ~= nil then if pickinfo.entity.script ~= nil then if pickinfo.entity.script.Picked ~= nil then pickinfo.entity.script:Picked(pickinfo) end end end end end end Then in any script you want to handle these define: function Script:Picked(info) [size=4]end[/size]
  5. ZioRed

    C++ and Lua

    Is there any documentation somewhere about how to use C++ and Lua together? What I'd like to know is (from a C++ point of view, basically I use empty Lua scripts just as placeholder and then initialize my component system on scene load): how to know what is the script class that is attached to an entity in the scene (and if it's possible to set it at runtime) how to access to the members and methods attached to the script how to call C++ methods from a Lua script Thanks
  6. Hello, First I would like to apologize that I write here. I don't own Leadwerks, yet, so I can't view Bugs section of the forum. I just watched tutorial by Aggror about Flowgraph - - and it's REALLY awesome feature but it strike me that it breaks connection at any change in the script. For me it looks like serious problem for using it in a project bigger than testing level. Is it a bug? Or maybe it's already fixed and will be part of 3.1?
  7. Hi all - I'm looking for two examples of Leadwerks 3.0 content with some specific constraints. Goggle isn't returning anything, so I figured I'd ask here. (1) Are there any examples of 2D games (sideview scrollers) done with Leadwerks? Primarily interested in pixel-perfect rendering of 2D sprites (even better if there are also polygon backgrounds). (2) Are there any examples of building 2D jointed physics bodies in Leadwerks using Lua? 2D ragdolls and such... And having them behave as a ragdoll operating in a 2D space... Before Unity 3D's latest update, developers were using 2D Toolkit to get pixel perfect rendering of sprites. Just wondering if the Leadwerks solution would be to use pixel filtering on the texture and ensuring a strict size ratio between the mesh containing the sprite and the current screen resolution.
  8. In LE2 the following code worked for setting a global variable in lua, BP L=GetLuaState(); lua_pushobject(L,camera); lua_setglobal(L,"camera"); lua_pop(L,1); but in LE3 GetLuaState() and lua_pushobject() doesn't seem to exist... Are there other ways to set global variables from c++ now? A command like GetCurrentCamera() would be useful...
  9. Beside the driver issue with 2.5x I had a very strange behavior lately. I created a portal mirror ( like the q3a one ) - I create a camera on surface ( its a plane ) which is looking from a orgin towards a target ( works as mirror and portal cam ). I need to switch main camera with a portal camera because of the listener ( which would be re positioned if I just would move it in framework )... plus I have a camera render buffer to paint the camera image on surface. The buffer is local to object and created like CreateBuffer(..., 1+2+4) iirc. I had no issues with that - I changed to only use color buffer. Yesterday it failed because of that ... so, how can such ever happen ? Please note - the issue is not that I messed up my code - the issue is that the engine doesn't realized the fact. Does structures be keept in memory even if the host gets "destroid" ? How to clean/overwrite memory ( and that is hilarious ) if such can possible be the case ?
  10. Ok, I'm mostly interested in doing lua stuff for the sake of simplicity, but I also want some degree of structure. So here is my little exercise in lua I want a team of solders fighting, so I create two "classes" Person.lua Team.lua Since lua uses tables for everything they aren't really classes in the tradional way, but simple OO is still possible without any thirdparty tools or libs using plain vanilla lua : Person.lua - Here I add some stats and actions. --Register class module("Person", package.seeall) --Functions and methods function New(name,age) local object = {} object.name = name object.age = age object.ammo = 20 object.health = 100 function object:sayName() return object.name end function object:fireGun() if object.ammo > 0 then object.ammo=object.ammo - 1 end end function object:hitTaken() if object.health > 0 then object.health=object.health - 1 end end return object end Then I create the Team.lua where I include Person, and adding new team mebers + a team report --Register class module("Team", package.seeall) include('Person') --Functions and methods function New() local object = {} object.members = {} function object:AddMember(name,age) local nextmember = #object.members + 1 object.members[nextmember] = Person.New(name,age) end function object:FindTeamMember(name) for i=1,#object.members,1 do if name == object.members.name then return object.members end end end function object:Report() for i=1,#object.members,1 do print( "Name:"..object.members:sayName().. " Ammo:"..object.members.ammo.. " Health:"..object.members.health) end end return object end Now I move on to App.lua which is my "Main" At the very top I just added a little helper so I can use include for the other lua files + includes the Team "class" ------------------------------------------ -- Helpers ------------------------------------------ --home made include function include(name) require("Scripts/"..name..".lua") end ------------------------------------------ include('Team') In App:Start() I create my team and start shooting : .. --create team myTeam = Team:New() --recruit members myTeam:AddMember("Joe",20) myTeam:AddMember("Bill",30) myTeam:AddMember("Josh",33) --report myTeam:Report() --Lets have some action : local player1 = myTeam:FindTeamMember("Bill") local player2 = myTeam:FindTeamMember("Josh") player1:fireGun() player1:fireGun() player1:fireGun() player2:hitTaken() player2:hitTaken() --report myTeam:Report() ... The output will now be : Probably better ways and better tools for this stuff, but it works, and you can split stuff into smaller bits using multiple files.
  11. Hello all - new to the forums, and so a few ubernovice questions. I did a lot of Google searching, but I'm unsure of what information pertains to versions of Leadwerks prior to 3.0... Hoping a forum dweller might be able to help me sort it out. Sorry if I missed a FAQ somewhere. Background: I'm a game designer and gameplay content scripter, currently using Corona SDK (and hence, Lua). I've used Lua a few other times, primarily with support from a programming team working in C++ or Objective-C, and shooting me Lua scripts from time to time. This time I'm planning to work on a project solo - with a little support from a contract programmer. I am attracted to Leadwerks due to the comprehensive Lua scripting tutorials on the youtube and the web (albeit for Leadwerks v2.3). I just wanted to ask a few questions pertaining to Lua support and more recent Lua scripting documentation for Leadwerks v3.0 - can a complete game be created with Lua script? No C++ required? For all supported platforms? - are scripts still compiled into .luac (and are there any other obfuscation tools available?) - can I create and/or heavily modify first and third person controllers from Lua? (I will be creating a 'floating' first-person character that turns freely but 'snaps' to face in the direction of compass headings. - my enemies require pathfinding that uses floor, ceiling and walls. Is this possible with default pathfinding and navmeshes? And accessible from Lua? Thanks for any info that you folks can provide. Even better if you can point me to extensive Lua docs for v3.0!!! [edit] Are the old v2.3 Lua tutorials on youtube still relevant? They are very extensive!
  12. Hello again fellow developers. I've been busy with trying to set up the first test-level for our game, which is a small house that I've build using only BSP. The house also includes a grandfather clock model, but I couldn't get light to render onto the model. So my first step was to render the lights manually using the 'calculate light' button, but all it does is say "Lighting rendered in 21 millseconds" (the number of milliseconds varies from 20 to 24) and the load-bar never actually progresses. Even when I turn all the resolution on low, the result is the same; just an empty loadbar with the same text that never progresses. I wonder if this is some kind of bug, and if it is I would like to know if there is some kind of way around this. For your convenience, I added a screenshot to demonstrate the problem. I would love to know how to deal with this problem, because I'm kinda stuck with it right now.
  13. With the arrival of new users,should create new tutorials for Lua and Flowgragh Editor.Would be very good for Leadwerks. Sorry my bad English thanks
  14. I have a script that I attach to a pivot that I can have play a sound. Inside it makes a source from a sound and it seems I need to set it's position and then create a listener so I can contain the sound to a certain area. However, when I call SetPosition on the source it gives the error "Error in SetPosition". self.source:SetPosition(self.entity:GetPosition(true), true) It seems it's because of the true parameter to SetPosition(). If I leave that out it doesn't give the error, BUT it of course also doesn't set the location to the global location which is what I need. Maybe this entity's SetPosition() overload isn't exposed to Lua? I'm following: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/source/sourcesetrange-r321 Also, I notice this creates a Listener. Is there a Listener page in the docs because I couldn't seem to find one? I assume in general we would only make 1 listener and have it follow the player?
  15. I am not sure if that was already mentioned here. If i define values in a Lua script like this: Script.speed = 1--float "Speed" Script.active = true--bool "Active" and i assign this script to an entity with the Script-tab the editor ignores the default values and starts with 0 for every value. active is false by default and speed is 0. That happens for every script property.
  16. What's the correct way to handle GetKeyValue() & SetKeyValue() in Lua now, so I can make custom keys?
  17. I'm creating a spaceship that will have emitters based on a bone location emitting in the bone local direction. My spaceship has bones for every thruster with size location and direction. self.child = self.entity:FindChild("thruster_linear_1") if self.child then self.emitter = Emitter:Create(1000) self.emitter:SetEmissionVolume(Vec3(.01,.01,.01)); self.emitter:SetPosition(self.child:GetPosition()) self.emitter:SetVelocity(Vec3(self.child:GetRotation())) --this didin't work end Any ideas how I can proceeed to have the emitter emit along the bone vector and scale?
  18. Hi. I am trying to control camera FOV using two keys in Lua (to increase and decrese) but I cant access to main Camera FOV. I have a CameraManager node in the scene and the code is something like this: require("Scripts/class") require("Scripts/constants/keycodes") require("Scripts/hooks") local class=CreateClass(...) function class:CreateObject(model) function object:DHook() if KeyDown(KEY_U)==1 then CameraZoom(45.0) -- or what? how should I use CameraZoom? end end AddHook("Flip" , object.DHook ) function object:Free() RemoveHook("Flip" , object.DHook ) self.super:Free() end end there were CameraZoom(cam,value) in the forum but I dont know what is cam or how I can create that to use Camera zoom. actually tried cam=fw.main.camera but that is for framework I think. I did not write other parts of this code and also I don't have access to our programmer. and I'm not dump thanks before
  19. I've been so busy playing around with the editor that I never actually tried to press "Run" . I get a "Failed to launch" error when trying to run it from the editor. Then I tried to compile the project in Xcode and I get a "There is no SDK with the name or path 'macosx10.7' " error. I didn't want to post this as a bug because it is probably something stupid on my end. How to run a project without errors? I'm on OSX 10.8.3
  20. In follow up to Andy, I also want to do a little blog on my experience with Leadwerks 3 so far. The first week after purchasing I didn't have much time to spend on it. Luckily after that week, there was quite some time left for the start of a new adventure. Lua In contrary to Leadwerks 2.3, I now want to lay most of my focus on C++. That is kind of Ironic, since a lot more people are interested in Lua now that Leadwerks 3 has arrived. It is not that surprising since the advantages of using Lua have improved quite a lot. Ofcourse we have debugging and stepping through Lua scripts which is a huge gain. And the other thing is the flowgraph editor. Rick has provided me an extra motivation boost to try out the flowgraph editor, with his cool scripts. (Of which the volume trigger is my personal favorite ). I tried to create a little script myself and within minutes, real simple gameplay interaction was set up.(Gravity activator) Something that was a lot harder to do with Leadwerks 2.3. C++ and Shaders For my own portfolio and skill set I started with C++ and the LE3 API. Just like with LE2, the API is very easy to use. Chris and Josh have done an excellent job on describing commands for both C++ and Lua. Pretty much every command comes with a working example. In the future I also hope to learn more about shaders. Shadmar has allready created severall of them, which you should check out. Tutorials A good way to teach yourself something, is to try teaching it to others. Thats the motto I have been going with since I have started creating tutorials for Leadwerks 2.3. The road is wide open again with the arrival of Leadwerks 3. The first 5 video tutorials for using C++ with LE3 are uploaded on youtube and more are on their way. Eventually I hope to reach a point were we will create a game that uses a combination of C++ and Lua. For a complete overview of tutorials, have a look here: http://www.leadwerks...-lua-tutorials/ Future updates There are plenty of things that can be improved with Leadwerks 3. Thats a fact. I am not talking about the deferred rendering with dynamic shadows. It is really the little things that count. I am more than confident that these issues will be dealt with in the near future. As soon as Josh is back from the GDC, there will probably be updates every other day. For now, I am really happy with my purchase of Leadwerks 3. I am looking forward to all the cool stuff that this community is going to create. Jorn
  21. Hi, im experiencing the following two (Possibly related) issues in Leadwerks 3. I have updated to the latest version through the updater tool today (9 March), but the issues still exist. I posted these together as I suspect they are both somehow Lua related. 1. When creating a new LUA project and running the project inside the editor the result is always a jumbled screen (Screen shot below) where the map should be. If i run the binary directly i can see the 'test map' just fine. C++ projects do not have this problem. 2. When right clicking an entity in the editor and selecting 'Add Script', the editor crashes just as a file selection dialogue appears. I get the standard OS 'Leadwerks quit unexpectedly' and the following report is attached. (Paste bin available below) http://pastebin.com/WGSW03wM My system specs are as follows Mid 2012 Retina MacBook Pro OS X 10.8.2 2.6 GHz intel i7 8GB 1600 MHz DDR3 NVIDIA GeForce GT 650M 1024 MB A few bugs as of course are expected in beta, but Leadwerks 3 looks to be shaping up the be a fantastic tool!
  22. I want to create a lua script but expose the functions of this script to my C++ game. I am making the UI in lua and want to do something like this KeyHit(KEY_P) { //do lua function calls //int result=luaUIBtnPress(); } I would also like to send what button was pressed in my lua UI back to my C++ function, as shown above. Can anyone guide me on how i can do this or a better way to do this. Or should I just use wxWidgets or another UI library? Thanks ~Xtreampb~
  23. heya all when I want to update an value in my database it needs to be done dynamically (by the user) for example. when the value in the database = 1, the user may want to change that to 0 (when he sets the Bloom off) I can do it hard coded by using: for test in db:nrows("UPDATE test SET bloom = 1 WHERE bloom = 0") I already have an placeholder for this which is local bloomval =1 How to do this so the value of bloomval = 1 can be set by the user ? Regards,
  24. Hey everyone, I am currently working on some objects in lua for use in the editor levels, and I am working on a door to open when e is pressed. The activation is fine, and it plays a sound, but I can't get any rotation to work on the door. I was hoping that someone could give me some help, as I know almost nothing about Lua. Here is the lua file. require("scripts/class") require("scripts/math/math") local class=CreateClass(...) class.sound_dooropen=LoadSound("abstract::metaldoorOpen.wav") function class:InitDialog(grid) self.super:InitDialog(grid) local group=grid:AddGroup("Door") local messages="|Activate,Enable,Hide,Set Key,Run Code" group:AddProperty( "Limits", "", PROPERTY_VEC2 ) group:Expand(1) end function class:CreateObject(model) local object=self.super:CreateObject(model) function object:UpdateState() if self.active==1 then //Door is closed else //Door is open end end function object:SetKey(key,value) if key=="torque" then self.torque = tonumber( value ) elseif key=="limits" then self.limits=StringToVec2(value) if self.limits.x>self.limits.y then self.limits.x = -360.0-self.limits.x end if self.joint~=nil then self.joint:SetLimits(self.limits.x,self.limits.y) end else return self.super:SetKey(key,value) end return 1 end function object:ClearJoint() if self.joint~=nil then self.joint:Free() self.joint=nil end if self.body~=nil then self.body:Free() self.body=nil end collectgarbage(collect) end function object:UpdateJoint() local pos pos=self.model:GetPosition(1) self:ClearJoint() self.body = CreateBodyPivot() self.body:SetPosition(pos) self.joint = CreateJointHinge(self.body,self.model,pos,self.model.mat:J()) self.joint:SetLimits(self.limits.x,self.limits.y) end function object:Init() self.limits=Vec2(0,90) self.model:SetKey("limits","0,90") self.model:SetKey("mass",1) self.model:SetKey("collision",COLLISION_PROP) self:UpdateJoint() if self.class.ambientnoise~=nil then self.source=self.model:EmitSound(self.class.ambientnoise,40,0,1) end end function object:GetKey(key,value) if self==nil then return value end if key=="torque" then return self.torque else return self.super:GetKey(key,value) end end function object:Reset() self:UpdateJoint() end function object:Free(model) self:ClearJoint() self.super:Free() end function object:ReceiveMessage(message,extra) local n local target local resettime=tonumber(self.model:GetKey("resettime","0")) local args local delay if message=="reset" then self.model:SetKey("state",0) end if message=="use" then if resettime>0 then if self.state==1 then return end end if class.sound_dooropen~=nil then PlaySound(class.sound_dooropen) end --Just set the key and everything will get updated automatically self.model:SetKey("active",1-self.active) local n,target,targetmessage,args,delay for n=0,7 do target=self.model:GetTarget(n) if target~=nil then delay = tonumber( self.model:GetKey("delay"..n,"0") ) * 1000.0 if self.active==1 then target:SendMessage("activate",nil,delay) else target:SendMessage("deactivate",nil,delay) end end end if resettime>0 then self.model:SendMessage("reset",nil,resettime) end end end object:Init() end What would I need to get the door to turn? Thanks in advance to anyone who can give me some help.
  25. ChrisMAN

    Lua Promise

    Last week I wrote an emitter for doing easy events on objects. This week I wrote a library for handling deferred values. This is really nice for doing asynchronous programming. These 2 components are all that I really need to do async/evented programming. https://github.com/friesencr/lua_promise Promises are one of those things that are so elemental / simple they can be hard to grasp. Here is a small example of what I might use it for. function UsePotion() SelectPotion() :done(function(potion) NomNom(potion) end) end function SelectPotion() local p = Promise:new() gui = LoadPotionGui() gui:on('select_potion', function() p:resolve(gui.selected_potion) end) return p end Peace, Chris
×
×
  • Create New...