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

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. Restarted my networking framework yet again. This time I gave it a new name 'Hexe'. The old name was 'Overwatch'. It was named long before the Overwatch game came out. It was based off the Half-Life Overwatch. It oversaw the players, ai spawning, contained a secondary path-finding system, but had no networking as it was not native to the LUA side of Leadwerks. 'Hexe' is German for 'witch'. I don't really know why I chose the name but I have the feeling I will be able to put it to good use. Maybe I'll even mix in some Anglish into it. This restart occurred because the framework became too cumbersome. I had the entity synchronization working correctly, but it did not differentiate between player and an object in the world. That wasn't really that bad, what made messed it up was that a lobby system and teams were needed and there was no space to squeeze any other components into the mix. This rewrite will focus on the player/client and foremost. The components that are currently being written or are complete are: The server browser. This was a side project created out of necessity. I did not want to have to hard code the ip every time. Anytime I wanted to test multiple clients I had to change the code depending on which computer was running the server. PITFALL: Since Leadwerks does not expose the servers local ip address via code, you will need to get it manually from you computer, or use some creative workarounds Network Manager Hexe is split up between a server class and a client class. Both classes use a network manager class that can automatically handle hosting or connecting to a server. The network manager currently handles the handshake and the beginnings of the lobby system. When a client joins it initiates and handles the handshake between the server and client. It also raises events so the server or client can react accordingly if need be. After the handshake is completed, the network manager starts the lobby system The connection handshake. This is was saved from the last version. It makes sure the server and client are using the same protocol version. It will then register the client on the server and give it an incremental number (similar to the source engine) that allows the client state to be manipulated The Lobbying system: This is completely new. After the handshake is complete, it will send a command launching the lobbying system. The network manager only makes sure that a client is in the servers lobby and nothing more. The client and server manually handle the team creation and player switching on their own. Teams are not part of the network manager because it would require large amounts of rewrites depending on the type of game being created. When the lobbying system is complete the client input will be added. So far things are going well and maybe soon I wont be staring at console output for feedback.
  2. Seems that scripts cannot be attached to objects, while using Linux Mint 18.2. In the following video an attempt to attach the Spectator.lua script to a camera results in failure. This was also applied to a CSG and the TriggerChangeMap.lua, ending with the same results. https://youtu.be/ucTMUP8cZSg Edit: This morning the Leadwerks contents were verified through Steam and everything checked out. Also, started a new Leadwerks configuration directory, and project, ending with the same results. Scripts are not attachable. @Josh
  3. Hello again, I finally got footsteps sounds to work properly on the correct material using triggers. But I have been unable to get a sound to be played at the correct time when the player jumps and lands on a material. How would I implement such a feature using a trigger? EDIT: I manged to work this out in the end. I did this by making global variables of both the players jump status with the GetAirborne command and the players current speed using GetVelocity():Length command. I then made a jump trigger box combined with the necessary commands for collision detection. Upon player collision, my jump trigger sets a global isJumping variable to false (isJumping is set to true when the player leaves the jump trigger). Finally I added an if statement to check if the player is airborne and moving, if this is true then I set the isJumping variable to true. (Making sure to make an if statement in the character controller to play the landing sounds when the isJumping variable = true). Not very efficient at all but it does as it is intended. As this is my first project and experience with LUA I feel I can get away with it until I can think of a better method. If anyone else is having this problem feel free to shoot me a message and I'll gladly tell you what I did and even share my code with you.
  4. I've spent the last few days creating a simple self contained server browser. It will list all the servers of a specific game, allow the user to select a server and send a callback with the selected info. Requirements: The script from this topic placed in a file here: Scripts/Functions/eventqueuemanager.lua The Script: A simple example: It will create a server and open a server browser window. + Starts the move mode, click to exit it. X closes the window. import("Scripts/Functions/eventqueuemanager.lua") import("Scripts/serverbrowser.lua") local window = Window:Create() local context = Context:Create(window) local server = Server:Create() System:Print("Server1 publish::" .. tostring(server:Publish("Example Temp Test Server", "Testing population of server list from masterserver "))) server:Release() function test(ip,port,close) -- callback function System:Print("Callback") System:Print(ip) System:Print(tostring((close == true) and "close" or "")) end local serverbrowser = serverBrowser("Example Temp Test Server",context,0,0) -- create the serverbrowser serverbrowser:SetCallback(test) -- set callback -- do stuff while true do if window:Closed() then return end if window:KeyHit(Key.Escape) then return end Time:Update() context:SetColor(0,0,0,0) -- need to clear alpha!! or the gui will stay on screen!! context:Clear() EventQueueManager:Update() context:Sync() end serverbrowser:ClearCallback() -- remove callback serverbrowser:Release() -- release everything The server browser will obey the limits of your window. If any part of it is not on screen, it will be pushed back onto it. Edits: -2017-8-24: -Added the ability to directly connect to a ip and port. -Moved the code to put the window into a function and check on server browser creation. -2017-8-25: -Added the abilitiy to automatically resize to fit inside the bounds of the current context
  5. [I had text here but in the edit it dissapeared ] I found that there can only be one instance of the EventQueue. This meant that all the widget events need to be handled in a single location leading to possible complications in code and lowering the possibility to dynamic things. This script allows the developer to subscribe to an eventqueue manager and get their event safely, without usurping all gui controls. The script will automatically create an EventQueueManager variable that all other scripts can expect. To use it from a script not attached to an entity use: EventQueueManager:AddListener(Update) -- a simple function On a script attached to an entity or a lua based class use: EventQueueManager:AddListener(serverbrowser.Update) -- convert : into . Place the script into a file at: Scripts/Functions/eventqueuemanager.lua
  6. I am trying to have a generic gui class and I realized that there can be only 1 EventQueue. This means that all widgets must be managed from a single area. This means that I can't create a gui class that handles its own events without using some creative methods that have some serious edge cases. I would like to specify my own function/callback/eventqueue to call for each widget item. It would allow people to create safe, shareable scripts. I would like to create a widget and pass it a local eventqueue such as this one and handle all the events locally.
  7. I discovered that there can only be one eventqueue in leadwerks. I wanted local eventqueue instances, so I created a lua based version of EventQueue called EventQueueEx It is initialized as such: MyQueue = EventQueueEx:Create() It is used EXACTLY the same as the Leadwerks version.
  8. Hi, pretty simple question. Is there a way to get the files/filenames of all files within an folder. Could not find something like that in the API. I used the lua io.popen function and it works ok, but seems to open up an cmd window for a second, which does not look good. However any ideas?
  9. I don't recall and Window doc doesn't seem to show this, but was there a way to get what key was hit vs having to loop over them all to check KeyDown()? This is handy for allowing uses to type in a textbox.
  10. Hi I have a small problem. I think the pictures should explain it pretty good With font size of 12 see the terrible cut on the top?: With font size 20 it is a little bit better but somehow not as sharp as it should be; This is how I would expect it to look like: I am rendering the text with the default arial.ttf font, I render the following color Vec4(0, 0, 0, 255) and with blendmode Blend.Alpha. So whats the problem? I remember the text rendered sharper another time, but I dont know what I am doing wrong atm? Any suggestions?
  11. When I use Server:Broadcast it does not send the message, it just sends nil. I am sending text to all the clients.
  12. Hi Simple question, I cannot find a GetAnimation and GetAnimationFrame function in the API. I realised those functions in my own AnimationManager script manually, but since there is the "new" entity:PlayAnimation function how to get access to this functions? Any ideas or suggestion? EDIT: Would also be good to know how to get animation index by name and the other way around. Something like: self.entity:GetAnimationName(0) or self.entity:GetAnimationIndex("Idle"))
  13. For this Zero project I have a need to call C++ classes from LUA. I have gone the same way as Josh has and used 'tolua++' for this. This works like this 1 - Create PKG For each class you need to export you have to write a corresponding 'pkg' file which is a version of the C++ header file suitable for the 'tolua++' program. 2 - Use 'tolua++' Then send the 'pkg' file to 'tolua++' which then will generate a source file with the LUA-export version of the class and a header file which defines the function to call in order to export the class. 3 - Add & Compile The two generated files should be included in your C++ project and you have to call the function defined in the header at some time after LUA has been initialized by Leadwerks. After compilation and linking you should be able to use the C++ class in you LUA scripts Here is a simple example: C++ header file: CppTest.h #pragma once #include <string> class CppTest { int _value; std::string _string; public: CppTest(); virtual ~CppTest(); int get_value() const; void set_value( int value ); std::string get_string() const; void set_string( const std::string& value ); }; C++ source file: CppTest.cpp #include "CppTest.h" CppTest::CppTest() { _value = 0; } CppTest::~CppTest() { } int CppTest::get_value() const { return _value; } void CppTest::set_value( int value ) { _value = value; } std::string CppTest::get_string() const { return _string; } void CppTest::set_string( const std::string& value ) { _string = value; } PKG file: CppTest.pkg $#include <string> $#include "CppTest.h" class CppTest : public Temp { CppTest(); virtual ~CppTest(); int get_value() const; void set_value( int value ); std::string get_string() const; void set_string( const std::string& value ); }; After you written the CppTest.pkg file you have to compile it using 'tolua++' like this. Note that I use the same filename for the outputs but with an '_' added. That way its easy to keep track of things tolua++ -o CppTest_.cpp -n CppTest -H CppTest_.h CppTest.pkg Now tolua should have generated two files. Generated CppTest_.h /* ** Lua binding: CppTest ** Generated automatically by tolua++-1.0.92 on 08/18/16 11:36:39. */ /* Exported function */ TOLUA_API int tolua_CppTest_open (lua_State* tolua_S); Generated CppTest_.cpp (shortned down) /* ** Lua binding: CppTest ** Generated automatically by tolua++-1.0.92 on 08/18/16 11:36:39. */ #ifndef __cplusplus #include "stdlib.h" #endif #include "string.h" #include "tolua++.h" /* Exported function */ TOLUA_API int tolua_CppTest_open (lua_State* tolua_S); #include <string> #include "CppTest.h" /* function to release collected object via destructor */ #ifdef __cplusplus static int tolua_collect_CppTest (lua_State* tolua_S) { CppTest* self = (CppTest*) tolua_tousertype(tolua_S,1,0); delete self; return 0; } #endif --- snip --- snip --- snip --- --- snip --- snip --- snip --- --- snip --- snip --- snip --- /* Open function */ TOLUA_API int tolua_CppTest_open (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); tolua_module(tolua_S,NULL,0); tolua_beginmodule(tolua_S,NULL); #ifdef __cplusplus tolua_cclass(tolua_S,"CppTest","CppTest","Temp",tolua_collect_CppTest); #else tolua_cclass(tolua_S,"CppTest","CppTest","Temp",NULL); #endif tolua_beginmodule(tolua_S,"CppTest"); tolua_function(tolua_S,"new",tolua_CppTest_CppTest_new00); tolua_function(tolua_S,"new_local",tolua_CppTest_CppTest_new00_local); tolua_function(tolua_S,".call",tolua_CppTest_CppTest_new00_local); tolua_function(tolua_S,"delete",tolua_CppTest_CppTest_delete00); tolua_function(tolua_S,"get_value",tolua_CppTest_CppTest_get_value00); tolua_function(tolua_S,"set_value",tolua_CppTest_CppTest_set_value00); tolua_function(tolua_S,"get_string",tolua_CppTest_CppTest_get_string00); tolua_function(tolua_S,"set_string",tolua_CppTest_CppTest_set_string00); tolua_endmodule(tolua_S); tolua_endmodule(tolua_S); return 1; } #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501 TOLUA_API int luaopen_CppTest (lua_State* tolua_S) { return tolua_CppTest_open(tolua_S); }; #endif You should include both of those in your project. You also have to call tolua_CppTest_open somewhere after Leadwerks has initialized LUA. I do it here in my App.cpp. Remember to #include "CppTest_.h" at the top of App.cpp. App.cpp (shortned down) #include "App.h" #include "CppTest_.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } bool App::Start() { int stacksize = Interpreter::GetStackSize(); //Get the global error handler function int errorfunctionindex = 0; #ifdef DEBUG Interpreter::GetGlobal("LuaErrorHandler"); errorfunctionindex = Interpreter::GetStackSize(); #endif //Create new table and assign it to the global variable "App" Interpreter::NewTable(); Interpreter::SetGlobal("App"); std::string scriptpath = "Scripts/Main.lua"; if (FileSystem::GetFileType("Scripts/App.Lua") == 1) scriptpath = "Scripts/App.Lua"; // ADDED to initialize the CppTest LUA implemenation tolua_CppTest_open(Interpreter::L); //Invoke the start script if (!Interpreter::ExecuteFile(scriptpath)) { System::Print("Error: Failed to execute script \"" + scriptpath + "\"."); return false; } --- snip --- snip --- snip --- --- snip --- snip --- snip --- --- snip --- snip --- snip --- LuaParser I read somewhere that Josh has a parser that automates this a bit by parsing lines in the header file that is commented with //lua and generates pkg-files. What a good idea. As I think programming is better that watching lousy programs on TV, I made my own version of this and called it "LuaParser". I have attached this program for those who like to use it. Here is what it does 1. Parses all C++ header files (*.h) in the folder and subfolders for lines commented with //lua 2. For such files it creates a pkg file suitable for tolua++ compilation 3. It complies the generated pkg files into _.h and _.cpp files to be included into you project Here is same example from above declared for LuaParsing C++ header file: CppTest.h prepared for LuaParser #pragma once #include <string>//lua class CppTest { int _value; std::string _string; public: CppTest();//lua virtual ~CppTest();//lua int get_value() const;//lua void set_value( int value );//lua std::string get_string() const;//lua void set_string( const std::string& value );//lua }; Extract the LuaParser.zip into you Source folder and open a command prompt there. The just type LuaParser and hit Enter. A number of files ending with '_' in the name will be generated. Include them in your project and call the function in each of the '_.h' files as mentioned. Windows version LuaParserWin-1.5.zip Linux version LuaParserLinux-1.0.tar.gz - support discontinued History 1.0 Initial version 1.1 Comment header in PKG files was inside class declaration instead of at top of file 1.2 Didn't handle class inheritance 1.3 - 1.5 Various minor fixes You can read more about tolua++ here tolua++ - Reference Manual
  14. Is there a way to get the Terrain height in Lua? I don't see any Terrain specific stuff on the API Reference page.
  15. Hi This is probably a noob question regarding the IDE. I had been able to open Lua scripts in the editor in the past; however, a source code window is not available. What am I missing? TIA J
  16. Is it possible to load external modules such as MQTT? If so, is there any documentation on how this can be done? I have a good amount of programming background but haven't done much scripting with Lua until recently. I've read something regarding Lua Rocks; however, the tool is looking for a lua.exe binary. Thanks!
  17. I wrote a script that processed all top level entities. When rearranging the scene hierarchy and running the game again WITHOUT hitting the map save button it gives the wrong result. It fixes itself when you explicitly click the map save button. Video: http://einlander.duckdns.org:8000/f/32c4297246924043960b/
  18. Welcome to the Sixth Monthly Script Challenge Each Month I will set a challenge for gifted Leadwerkers to solve. Once you have perfected your script post your map to this thread. At the end of the month I will go through all the entries and judge the winner. I will then place the winning map on the Workshop so others can learn from them. Rules. Entries must be your own work. Entries must be submitted before the end of the month ( June ). Any assets you use must be your own or Royalty free. The map that you submit can be used by others for commercial use. Have fun. June Challenge After asking for suggestions from the Leadwerks community . I've decided to use Slastraf idea of Flying Enemies. The enemy could be like a dragon that circles and swoops on the player to attack them causing damage. Or perhaps it could be a drone like enemy that tracks the player and shoots them as it gets within range. How you implement your script is up to you. Remember the winning script should not only solve the problem but should also have comprehensive comments within the script so that new users can learn from your script. Prize Damien Defranco and his company Vixeemo are now the proud sponsors of the Leadwerks community monthly script challenge. Vixeemo (http://vixeemo.com) is an all-in-one business solutions brand for your start-up or project needs. The winner will receive a free web & graphic design package provided by Vixeemo that includes a 3-page professional website design (Home, About, Contact), logo design and integration, banner/slider design, a blog section, and an additional gallery page to showcase images/video or projects. Vixeemo will work with the winner to fully customize everything to bring the vision to fruition. This prize is perfect for any Leadwerks user who wants to get their project or brand onto the internet. The winner will need to provide the domain ( TomsHardware Guide ), and Vixeemo will do the rest. This design package is valued at over $400 USD. This is a great reward for your hard work and a great way to give your game project that professional look to make it stand out from the crowd. If you have any ideas or thoughts on the Challenge please feel free to comment. I'm looking forward to your submissions. PS Josh could you kindly pin this thread please.
  19. Hi, I pretty often encounter the followning problem: I need something to be called before, or after the Start function of an script. My actual problem is that I have an NPC and his "Load" function (I wrote by myself) is called before the script actually is initiated. The problem is, in the load function some values are set (like npc health) but then the script gets initiated and the script uses the default script value of 100% health and the loading does not work. A workaround I found is to use the first step of the update function but I find this not very smart. Here an example: function Script:UpdateWorld() if self.doOnce ~= true then --do something here self.doOnce = true end end Any ideas how to solve this more elegant? Would be really glad if we could gather some ideas Markus
  20. Hi, I have a general inventory script attached to every object, which should have an inventory. In the script settings of the inventory script I put an "firstSlotOffset" value, to adjust where the inventory starts to render its slots. In code this looks like that: Script.firstSlotOffset = Vec2(0, 0) --Vec2 "Slot Offs." In the start function I do some calculation: self.firstSlotOffset.x = self.firstSlotOffset.x * context:GetWidth() self.firstSlotOffset.y = self.firstSlotOffset.y * context:GetHeight() The problem is if I load to another map and back to some other map the self.firstSlotOffset value seems corrupted. This happens only after I loaded twice (so changed the map two times). I found that out by printing the self.firstSlotOffset value in the start function. What I mentioned is if you loaded twice the self.firstSlotOffset value is not what is set in the script settings but the result of the above calculation which should not be. If you change a map, all variables should be "nil"-ed shouldn't they? And by the way what do you have to take care on when loading to an new map? Do you need to clean stuff up and if yes which stuff? I guess that could be the problem that I didnt clean up. P.S.: The error only appears for the player inventory, which is the only entity staying the same on both maps I load to.
  21. I started playing around with the networking in Leadwerks and found that I needed enums. So I wrote a function that will allow you to enumerate a table. function enumerate(array,indexstart) -- indexstart is optional if array == nil then return nil end local array2 = {} local count = tonumber(indexstart) ~= nil and tonumber(indexstart) or 0 for key,value in pairs(array) do array2[value] = count count = count + 1 end return array2 end This will take an array of strings and output a named table array. enum_netchat = enumerate({ "client", "team", "all", "servertoclient", "servertoteam", "servertoall" },1) This is the simplest way to make an enum enum_netchat.all
  22. With the last update the new default main.lua causes crashes when run. The old main.lua still works though. --edit-- Simply commenting out all the gui related related lines causes the game to 'Assert Failed' at world:Render()
  23. EDIT: Just found out that the error was somewhere else ^^. The below code just works fine. Anyway thank you for the help :). Hi there, I faced some weird behavior, testing and debugging my project. The following shows the structure of my code, it would be very kind of you, if you could tell me if you can find any error, because I dont. Maybe I messed around with global/local/script variables, which I know, often cause such errors. Explanation: Of course this script makes no sense, but it should only representate the structure, because it would be way to complicated to explain the issue within the actual script. So what is the problem? When I apply the "Main Script" to one entity, everything works fine and I get printed the data. but if I apply the "Main Script" to more than one, for example two, then the problem occurs. In the output I get the "Send my data!"-message, but now comes the weird thing. It prints the data and then, even if the "Test"-function is just called once it prints "Variable data is nil!" twice. And this happens for both entitys. So this is my output with two entities with the "Main Script": Send my data! Test Variable data is nil! Variable data is nil! Send my data! Test Variable data is nil! Variable data is nil! Main Script: Script.dataToSend = "Test" Script.data = nil import "exampleScript.lua" function Script:Start() self.myLuaClass = testClass(self) end function Script:Test(data) if data ~= nil then System:Print(data) else System:Print("Variable data is nil!") end end The "exampleScript.lua" Script: function testClass(script) local container = {} function container:CallMeFromAnywhereToSendSomething() self:SendSomething(script.dataToSend) end function container:SendSomething(sendData) if sendData ~= nil then script.data = sendData end if script.data ~= nil then System:Print("Sent my data!") script:Test(script.data) end end return container end Addition: I was able to work around this issue by simply checking if the variable is nil, or not (I actually need/do stuff with the "data" variable in my actual script), but still I am confused. Maybe you can help me out. If you find other mistakes, or have improvement suggestions for my "Class" system please tell me. Thanks for reading
  24. Welcome to the Fifth Monthly Script Challenge. Each Month I will set a challenge for gifted Leadwerkers to solve. Once you have perfected your script post your map to this thread. At the end of the month I will go through all the entries and judge the winner. I will then place the winning map on the Workshop so others can learn from them. Rules. Entries must be your own work. Entries must be submitted before the end of the month ( May ). Any assets you use must be your own or Royalty free. The map that you submit can be used by others for commercial use. Have fun. May Challenge Another weapon challenge this month. Sorry mdgunn its not a portal gun. Most of the weapons we currently have for Leadwerks operate on a single target. What we need is something that will take out a group of enemies in a hurry. So this months challenge is to make a grenade. Your grenade should damage all enemies within the blast area. It should also have an effect on physical objects in the blast area. Think barrels getting knocked over etc. How you implement your script is up to you. Remember the winning script should not only solve the problem but should also have comprehensive comments within the script so that new users can learn from your script. Prize Damien Defranco and his company Vixeemo are now the proud sponsors of the Leadwerks community monthly script challenge. Vixeemo (http://vixeemo.com) is an all-in-one business solutions brand for your start-up or project needs. The winner will receive a free web & graphic design package provided by Vixeemo that includes a 3-page professional website design (Home, About, Contact), logo design and integration, banner/slider design, a blog section, and an additional gallery page to showcase images/video or projects. Vixeemo will work with the winner to fully customize everything to bring the vision to fruition. This prize is perfect for any Leadwerks user who wants to get their project or brand onto the internet. The winner will need to provide the domain ( TomsHardware Guide ), and Vixeemo will do the rest. This design package is valued at over $400 USD. A great prize for your hard work and a great way to give your game project that professional look to make it stand out from the crowd. If you have any ideas or thoughts on the Challenge please feel free to comment. I'm are looking forward to your submissions. PS Josh could you kindly pin this thread please.
  25. 'm using the C++ SDK and lua for small objects code. I need to create the entities from C++ and later use the bool Entity::CallFunction(const std::string& functionName, Object* extra) How to 'bind' on script lua to an entity ? it looks that Interpreter is using tolua++, but I can't figure how to load the .lua properly to the object // Create 100 special entity std::vector<Entity*> list; for (int i = 0; i < 100; i ++) { Entity* entity = new MyEntity(); entity->AddToWorldTable(true ); list.push_back(entity); } // Load special script (But not working, object not callable). Interpreter::NewTable(); Interpreter::SetGlobal("Script"); // Must Script. Don't change that, because the script are prefixed with Script:myFunction if (Interpreter::ExecuteFile("MyEntity.lua")) { System::Print("Error: Failed to execute script \"" + it + "\"."); } for (auto&it : list) it->CallFunction("OnSpecialFunction") Script Lua function Script:OnSpecialFunction() print self end
×
×
  • Create New...