All I'm hearing right now is that it's better for me to just make a separate card, call it "Brain" and just cram it with buttons and sliders to use as variables to keep track of. Which, the more I try to make this interactive fiction engine, is becoming more appealing as I do so.

JimBoReee
Recent community posts
And can I rewrite the data with commands? I tried doing that with
me.data[(Row number)][(Column number)]:(some number)
Where the phrases in parentheses are arbitrary numbers. but it doesn't seem to work, so, I tried rewriting the entire table with
me.data: (list 0,0), (list 1,0) if Command.text = "north" & "%l" format Command.text & (me.data[1][0] = 1) me.data: (list 1,0), (list 0,0)
Which should be parsed as if north, whether capitalized or not, were to be ran and the me.data of the cell is 1, then the entire table will be rewritten.
I'm also thinking of ditching the table format for a list one instead.
So... I'm trying to use a grid cell's value to store variables. Here's the code:
on run do
if Data.cell(0,0)=1 & ("room" = "%l" format me.text)
Log.text:Log.text,"\n\n","> ",me.text,"\n","You are in room 1."
elseif Data.cell(1,0)=1 & ("room" = "%l" format me.text)
Log.text:Log.text,"\n\n","> ",me.text,"\n","You are in room 2."
elseif Data.cell(2,0)=1 & ("room" = "%l" format me.text)
Log.text:Log.text,"\n\n","> ",me.text,"\n","You are in room 3."
elseif Data.cell(3,0)=1 & ("room" = "%l" format me.text)
Log.text:Log.text,"\n\n","> ",me.text,"\n","You are in room 4."
else
Log.text:Log.text,"\n\n","> ",me.text,"\n","I do not understand."
end
And the Grid value is
Rooms 0 0 0 0
Which should produce "I don't understand" but it says, "You are in Room 1." No matter how I format the grid itself.
Am I doing something wrong?
Sorry, I was contemplating if creating a fake 3D first person engine was worth persuing if I could just make a bunch of images at less of a headache. In other words, yes, this does help.
Edit: Actually, no, no it does not help. I'm not looking to create a top-down explorer or a 2D platformer... yet. What I want to tackle first is creating a tile system that reads a text and makes that text into a pseudo-3D projection a la Wolfenstein 3D or Duke Nukem 3D. Each text in the array tells the ray caster to render that tile as a specific 3D shape. Does that make sense?
So, first order of business: creating a tile map from a set of pixels. I understand that I can have Decker read each pixel (or set of pixels) and draw a tile based on that pixel's position but offset. But what I don't understand is how to put that idea into practice. Any ideas on how I could turn a pixel map into a tile map?
I'm trying to create a fake 3D raycaster engine in Decker. But every step I take feels like me falling flat on my face in my own ignorance. Since making a game engine is ambitious and involved, I'm making this thread so that I might have some help without bloating the Lil or General questions thread.
How do I copy from an image from a segment of a card and paste in a canvas via script?
I tried both of these programs in the canvas:
on click pos do me.copy[Map.image.paste[]] end
on click pos do me.paste[Map.image.copy[]] end
but neither work. I might be misunderstanding something.
Edit: got it to work! Here's the code:
on click pos do me.paste[Map.image.copy[]] end
So... Let me get this straight, I could compress each tile in the map to a pixel and write a program that could read each one and and draw the map itself? The idea is appealing, and, maybe, I can double the number of possible tiles by having the program read the pixels two at a time, or sixteen times with four pixels. If that is possible.
The thing Is that I don't know how to write a program that could read the pixels and turn that into a full map. Maybe with an if-statement and some stored textures... I still don't know, yet.
Yeah, I can work with that.
Okay. Here's the thing, I want to make a raycaster engine in Decker. I understand most of the tutorials that I've watched, except for one thing, making a tile map array. I think I can do it with a list of lists, like
list(list(1,1,1,1,1,1,1,1),list(1,0,0,0,0,0,0,1),list(1,0,0,0,0,0,0,1),list(1,0,0,0,0,0,0,1),list(1,0,0,0,0,0,0,1),list(1,0,0,0,0,0,0,1),list(1,1,1,1,1,1,1,1)
Am I on the right track? It'd make more sense if it was arranged in a block, but I don't think Lil allows for line brakes.
on run val do if (me.text = "hello") | (me.text = "Hello") log.text:log.text + " Hello to you as well!" else log.text:log.text + " I do not understand." end me.value:"" end
I thought this code would allow me to add text to log, instead of rewriting it, but it just writes "0." Is there a way to add line breaks in a string and new text in addition to the already existing one?
Edit, figured out the line break, but I still can't figure out the adding text function.
I imported an image that looks like this:

But it comes out looking like this:

I used this palette hex:
000000 555555 FF0000 FF8800 FFFF00 88FF00 00FF00 00FF88 00FFFF 0088FF 0000FF 8800FF FF00FF FF0088 AAAAAA FFFFFF
But it thinks that FF00FF is the default color and it doesn't see FFFFFF as the transparent. I got Color and Transparency styles on. Am I doing something wrong?
Edit: I was doing something wrong! I just needed to export the images as PNGs. The colors and transparency were correct.
Very much, thank you!
Though, now I have a new problem.
I got a canvas, a slider (Switch), and a field (Circle) with two images.
The Code for the canvas
on click pos do if me[pos] = colors.black Switch.value:Switch.value + 1 end end
And the Code for the slider
on change val do if Switch.value = 1 canvas1.paste[Circle.images[1]] else canvas1.paste[Circle.images[0]] end end
When a black pixel is clicked, it's supposed to change the value of Switch from 0 to 1 then paste the image of that value from Circle into canvas1. It does the second step, but not the third. And the slider works when clicking on it but not when changed by another widget.
Figured it out! Here's the code:
on drag pos do val:Switch.value if (me[pos] = colors.black) & (Switch.value = 0) Switch.value:Switch.value + 1 elseif (me[pos] = colors.black) Switch.value:Switch.value - 1 end Switch.event["change" val] end
Hm... I have an idea. In that I could have a bunch of canvases, shaped into a rough hexagonal shape, which I will call the "Player," like this:

And then have different canvasses act as, I don't know, geometry for the Player to "collide" with. Like this:

I theorize that I can use the Draggable module to collide with the other canvases.
Again, this is theory for me and probably labor intensive, but better than nothing, lol.
I want to make an isometric game in Decker. I'm able to make things move. But there are some places where I don't want to move beyond.
In other words, I want to have collision mechanics. How do I program that? I vaguely remember someone saying to use the Path module to text whether a patter is or is not to be moved into, but I don't know how that works. I tried looking into Sokoban, but I can't make heads nor tails of it and, after looking into its resources, cannot find anything on the mover module within it which might be able to help me, but I am not sure.
In all honesty, I don't even know where to start and could appreciate some pointers.
Follow up question: How can I implement the windows and rtext? I see that it can help. but how do I format the script to actually replace multiple characters or individual words?
Do I use a code like this?
on change val do a1:2 window "thwhshqu" a2:1 window "tvzc" a1 dict a2 II.text:rot13 @ I.text end
on click do slider1.value:slider1.value - 1 slider1.event.change[val] end
I tried using this code to change the value of the slider and execute this script:
on change val do Sphere.paste[Assets.images[val]] if me.value = 0 button1.show:"solid" button2.show:"solid" else button1.show:"none" button2.show:"none" end end
There is a range from 0 to 4 for the images in a field going down. But, for some reason, the 0th image gets pasted and not the third in the field.
I want it to paste the images in the order of values in the slider with each click and not skip to zero.
Some questions I have about grids:
1. What are some ways that I could "lock," for lack of a better term, a column of a grid? I mean, I suspect I can use a format function to make it so that whenever a cell in that column gets changed to something else that it would replace the original letter, but I'm only half aware on how to pull that off and curious as to whether their exists a lock function for parts of a grid. But I digress.
2. Follow-up question to the first one, how would I rearrange the order of values in a column via button pressing? For example, changing the arrangement of values in a column, letters specifically, from alphabetical to by frequency, etc.
3. Is it possible to extract the values from a column in a grid and turn it into a string that can be used in dictionary functions?