Search found 90 matches

by Xii
Fri Feb 19, 2021 9:17 pm
Forum: Support and Development
Topic: The rectangle isn't being drawn.
Replies: 2
Views: 1048

Re: The rectangle isn't being drawn.

function love.load() function rectMake() end end function love.update(dt) function rectUpdate() end end function love.draw() function drawRect() end end You're redefining these functions here to do nothing. What you probably meant was to call them: function love.load() rectMake() end function love....
by Xii
Sun Feb 14, 2021 9:23 pm
Forum: General
Topic: Odd Simple Error
Replies: 2
Views: 1880

Re: Odd Simple Error

Here is the offending code, if firetype = "Minigun" then baseRate = 0.75 elseif firetype = "Laser" then baseRate = 0.6 end it's because you accidentally used assignment = instead of comparison == in an if statement. if firetype == "Minigun" then baseRate = 0.75 elseif f...
by Xii
Sat Feb 13, 2021 8:47 pm
Forum: Libraries and Tools
Topic: Blob.lua - binary serialization library
Replies: 24
Views: 27778

Re: Blob.lua - binary serialization library

Awesome! And beautiful! Look at how simple and succint this is thanks to your diligent efforts: local ffi = require("ffi") local writer, reader = require("BlobWriter"), require("BlobReader") function define_struct(name, memberstr) ffi.cdef("#pragma pack(1)\ntypedef...
by Xii
Sat Feb 13, 2021 4:09 pm
Forum: Libraries and Tools
Topic: Blob.lua - binary serialization library
Replies: 24
Views: 27778

Re: Blob.lua - binary serialization library

Error BlobWriter.lua:141: bad argument #2 to 'copy' (cannot convert 'table' to 'const void *') Traceback [C]: in function 'copy' BlobWriter.lua:141: in function 'string' BlobWriter.lua:156: in function '_writeTaggedPair' BlobWriter.lua:323: in function 'write' main.lua:31: in function 'load' [C]: i...
by Xii
Sat Feb 13, 2021 3:40 pm
Forum: Support and Development
Topic: How to path-find in a non-tiled world?
Replies: 3
Views: 2701

Re: How to path-find in a non-tiled world?

If the number of entities isn't too high, what you can do is consider the distances and directions (vectors, essentially) towards each and every other entity. Begin with a vector pointing straight to the goal, or something. Then, loop over all opponents. Subtract from the initial vector the vector t...
by Xii
Sat Feb 13, 2021 3:36 pm
Forum: Libraries and Tools
Topic: Blob.lua - binary serialization library
Replies: 24
Views: 27778

Re: Blob.lua - binary serialization library

And here I was thinking I had been rudely demanding. You really delivered :3 The __serialize() and __deserialize() functions are only required for complex structs with pointers, So for plain old data structs, just need __typename ? and for cases when ffi.sizeof() is not sufficient to get the true si...
by Xii
Fri Feb 12, 2021 4:54 pm
Forum: Libraries and Tools
Topic: Blob.lua - binary serialization library
Replies: 24
Views: 27778

Re: Blob.lua - binary serialization library

cdata is supported. :raw can read and write cdata just fine. Yeah but that means I have to manually iterate over my tables doing hacky things instead of just this as per the example: local blob = BlobWriter() blob:write(data) All cdata has the same type ("cdata"). There is no ffi API that...
by Xii
Fri Feb 12, 2021 2:31 pm
Forum: Libraries and Tools
Topic: Blob.lua - binary serialization library
Replies: 24
Views: 27778

Re: Blob.lua - binary serialization library

Still no support for cdata.
by Xii
Wed Feb 10, 2021 1:42 pm
Forum: Support and Development
Topic: Client/Server UDP within a thread.
Replies: 13
Views: 4893

Re: Client/Server UDP within a thread.

I'm checking the client send for errors: local result, err = udp:sendto(message, ipaddr, 65000) print(result, err) Which should print like "1 nil", but actually prints: "nil refused". So the client is "refused" from sending anything. I don't know why. The docs say: the ...