thehankinator
Members-
Posts
436 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Everything posted by thehankinator
-
Perfect, thank you!
-
To provide a cmake project Josh would have to provide the Leadwerks source code, I don't think he wants to do that.
-
I've got a texture, something like below. I when the player fires a gun, I'd like to rotate the image around. Anyone know a way to do that without creating an image frame by frame?
-
I'm sure other people have other reasons to use mingw over MSVC but for me, in my experience, mingw provides the path of least resistance to build open source libraries on Windows. For a given library there is a better chance that the library will provide a makefile(or some other mechanism to build) for gcc than a MSVC project file. cmake has really improved the situation but isn't always available. Like nick.ace, I use both, I think they are both great (nothing touches the MSVC IDE). I can see why you wouldn't bother with mingw and I don't disagree but there is something to be said for tool consistency between platforms.
-
I get why Josh doesn't plans to support it but it's ignorant to say supporting other compilers is useless.
-
mingw support would be nice (preferably mingw-w64 fork)
-
Have you looked at this? http://lua-users.org/wiki/LuaCsv
-
IMO It's not fair to say that drawing to a texture is a current feature of LE since the Buffer class isn't documented.
-
Have you tried the workshop on steam? http://steamcommunity.com/workshop/browse/?appid=251810&requiredtags[]=Script
- 6 replies
-
- 1
-
- Scripts
- programming
-
(and 2 more)
Tagged with:
-
PlayTV -- A word of warning to AMD users!
thehankinator replied to Michael_J's topic in General Discussion
I think if you uncheck Gaming Evolved App in the driver installer you won't get that junk. -
Prints out garbage because the format bytes are not always alpha numeric when printed as a character plus I don't think the floats are encoded in a way that is human readable when packed. Gotta print each character as a byte. To inspect the packed data I did: str_mpac = "" for i=1, string.len(mpac) do str_mpac = str_mpac..string.format('%02X', string.byte(string.sub(mpac,i,i))) end System:Print(str_mpac) Which printed 9283A179CA400EF9DBA178CA3F8FBE77A17ACA4056147B83A179CA40A77CEEA178CA4083EF9EA17ACA40CB0A3D
-
I agree, I wouldn't do any heavy lifting in Lua. They have libraries for like every language, for C/C++ there are multiple implementations to choose from. http://msgpack.org
-
I rebuilt lua-enet and linked it to LuaJIT 2.0.2 and enet 1.3.13. The significant result with this build is you don't need to duplicate lua51.dll (Step 4 of Rick's post). I've not thoroughly tested it but if anyone wants it I'll upload it.
-
I haven't tried it with lua-enet but you can use lua-MessagePack to encode arbitrary data into a string. It isn't too space efficient but it should work if you don't have a large amount of things to synchronize. http://fperrad.github.io/lua-MessagePack Here is an example of how I encoded a couple Vec3s into a string to be sent via lua-enet (or whateva) mp = require 'Scripts/Functions/MessagePack' thing1 = Vec3() thing1.x = 1.123 thing1.y = 2.234 thing1.z = 3.345 thing2 = Vec3() thing2.x = 4.123 thing2.y = 5.234 thing2.z = 6.345 data = {{x=thing1.x, y=thing1.y, z=thing1.z}, {x=thing2.x, y=thing2.y, z=thing2.z}} mp.set_number'float' mp.set_array'with_hole' mp.set_string'string' mpac = mp.pack(data) System:Print("Len="..string.len(mpac)) unpacked_data = mp.unpack(mpac) System:Print("pos.x="..unpacked_data[1].x.."pos.y="..unpacked_data[1].y.."pos.z="..unpacked_data[1].z) System:Print("pos.x="..unpacked_data[2].x.."pos.y="..unpacked_data[2].y.."pos.z="..unpacked_data[2].z) Result Len=45 pos.x=1.1230000257492pos.y=2.2339999675751pos.z=3.3450000286102 pos.x=4.1230001449585pos.y=5.2340002059937pos.z=6.3449997901917 45 bytes compared to 24 if it was raw c++. Not ideal but it'd work. EDIT: I'm dumb, require works fine, no change required to MessagePack.lua
-
[LUA] Get any entity in world with "health" ?
thehankinator replied to dennis's topic in Programming
Good catch! Old habits die hard. -
Have you poked AMD about this lately? Still broken with the newest driver.
-
[LUA] Get any entity in world with "health" ?
thehankinator replied to dennis's topic in Programming
I'd use GetEntityNeighbors() function in Scripts/Functions/GetEntityNeighbors.lua. You could do something like: local radius = 10 local entities = GetEntityNeighbors(self.entity, radius, true) for e=1, #entities do if entities[e].script.health ~= nil then --deal damage end end -
A script that is attached to an element will only stay alive until you call world:Clear() (this is done when you load a new level for instance). For something to persist through loading levels you would probably want to use a global variable to store that information. You can also load scripts in Main.lua, the items in those scripts would be global and would persist through a world:Clear(). This tutorial talks more about global variables. Bare in mind that the Journal script will likely need to be modified to use global variables to track progress through a world:Clear() http://www.leadwerks.com/werkspace/page/tutorials/_/variables-r14
-
Still having rendering issues with AMD
thehankinator replied to tindolt's topic in Leadwerks Engine Bug Reports
I think this change has made it to stable by now. Looks like 2 is the default but FPSPlayer.lua (which most people use) sets it back to 1. I'm not sure anyone will see the benefit of the change unless it's clamped at a minimum of 2. -
Do you have the Journal.lua script on a pivot in your scene?
-
Hiding the exported standalone lua console
thehankinator replied to Dragonfreak's topic in General Discussion
You need professional or someone to rebuild it for you with that change to the linker settings. -
Hiding the exported standalone lua console
thehankinator replied to Dragonfreak's topic in General Discussion
All it should take is changing the subsystem option(in the linker options) from "Console" to "Windows" in MSVC then rebuild. You would need to rebuild every time there is an update to LE(and don't forget!). -
How to export from tex files to images
thehankinator replied to tipforeveryone's topic in General Discussion
I can do it, I've been meaning to for myself anyway. -
How to export from tex files to images
thehankinator replied to tipforeveryone's topic in General Discussion
Do you have Professional Edition? If so you can write a program to that uses Texture::GetPixels() to get a buffer containing the image (I assume in RGBA byte format), then you could dump it to a PNG using an image library like lodepng -
You could convert the video to a series of PNGs then cycle through the PNGs on the surface. Ghetto and awkward if it's a long video but it'd work. http://superuser.com/questions/135117/how-to-convert-video-to-images