Search found 11 matches

by Flamore
Tue Apr 14, 2020 11:06 am
Forum: Support and Development
Topic: [Solved] Failure at writing a wireworld implementation
Replies: 6
Views: 2567

Re: Failure at writing a wireworld implementation

You're reading from temp. Don't use temp for reading. if get_tile(x,y,buffer) == wire_c and count(x,y,wire_c_head,temp) > 0 and count(x,y,wire_c_head,temp) < 3 then set_tiles(x,y,wire_c_head,temp) end ^^^^ ^^^^ count() should use buffer, not temp. Oof, i'm blind. i should have re-read the code twic...
by Flamore
Mon Apr 13, 2020 7:04 pm
Forum: Support and Development
Topic: [Solved] Failure at writing a wireworld implementation
Replies: 6
Views: 2567

Re: Failure at writing a wireworld implementation

It seems the problem still exists. Even if i flip the electron pair to go right it rotates to go left. Filling the space between last and new point It still does teleport. But now the electrons flicker from head to tail. I don't really know if the way i made neighbour sum function does that or is it...
by Flamore
Mon Apr 13, 2020 5:35 pm
Forum: Support and Development
Topic: [Solved] Failure at writing a wireworld implementation
Replies: 6
Views: 2567

Re: Failure at writing a wireworld implementation

With that little code, it's not possible to tell what's going on. Judging by what function step() appears to be doing, it looks like you might not be using an alternate buffer correctly. The idea of the alternate buffer is that it's write-only. All reads are done from the main buffer; all writes go...
by Flamore
Mon Apr 13, 2020 5:32 pm
Forum: Support and Development
Topic: Direct mouse input?
Replies: 8
Views: 4620

Re: Direct mouse input?

You should definetly try adding player position to mouse cursor position as it would make it relative to the world.
love.mouse.getX() gets the X value of cursor inside the window
love.mouse.getY() gets the Y value of cursor inside the window
by Flamore
Mon Apr 13, 2020 1:40 pm
Forum: Support and Development
Topic: [Solved] Failure at writing a wireworld implementation
Replies: 6
Views: 2567

[Solved] Failure at writing a wireworld implementation

It seems. the electron heads just "clone" and flicker. I don't really know why this happens but it's really useless. I don't know why this happened, it's my first time writing a 2d cellular automata. 1d was easy compared to this. The "loop" aka the oscillator should have only one...
by Flamore
Thu Mar 19, 2020 3:42 pm
Forum: Support and Development
Topic: Isolating dofile() from love.* functions?
Replies: 3
Views: 3444

Re: Isolating dofile() from love.* functions?

First, dofile doesn't really work in real scenarios. For your real solutions, you can use love.filesystem.load(file), setfenv the resulting function, and call it. Alright so i merged the example setfenv function with lua.filedropper -- EXECUTE CODE function love.filedropped(file) local ext ext = fi...
by Flamore
Wed Mar 18, 2020 7:38 pm
Forum: Support and Development
Topic: Isolating dofile() from love.* functions?
Replies: 3
Views: 3444

Isolating dofile() from love.* functions?

Let's say i've got a variable like "score" that equals zero. and if i dofile i want the dofile function to be only able to access variables from main.lua and not from the rest of the Love2d engine. I've saw setfenv but it isn't really that straight forward.
by Flamore
Sun Mar 15, 2020 12:16 pm
Forum: Support and Development
Topic: [SOLVED] Executing Lua code from external file in LÖVE?
Replies: 8
Views: 6014

Re: Executing Lua code from external file in LÖVE?

pgimeno wrote: Sun Mar 15, 2020 11:02 am Try with dofile(file:getFilename())
Thank you, it works like a charm. but is it possible to stop the execution like reset the sandbox?
by Flamore
Sun Mar 15, 2020 10:12 am
Forum: Support and Development
Topic: [SOLVED] Executing Lua code from external file in LÖVE?
Replies: 8
Views: 6014

Re: Executing Lua code from external file in LÖVE?

I just wrote a simple function function love.filedropped(file) local ext ext = file:getExtension( ) if ext == "cart" then dofile(file) else print("Filetype not supported") end end But yeth dofile() does not support FileData just strings. Giving this error below. Error: main.lua:2...
by Flamore
Sun Mar 15, 2020 9:49 am
Forum: Support and Development
Topic: [SOLVED] Executing Lua code from external file in LÖVE?
Replies: 8
Views: 6014

Re: Executing Lua code from external file in LÖVE?

Alright, gonna try these methods. Also i have heard that dofile isn't secure, is it just like some bias or something