Anyone know how to create a unified coordinate out of two separate X and Ys

So I’m using text lists and number lists to help store data on the cordanintes and state of various entities, and I want to combine the X and Y plus an additional text value that says what state the entity is in. My problem is combining X and Y to be a single line in the text list, For example, from two extractors I now know have the X and Y but now I want to route them both into a single line on the text list as X Y, not X then Y on the second line since this would become annoying when there’s 60 other coordinate sets to store and sort through too.

I hope that makes sense

1 Like

You want to display the coordinates of an object on one line?

1 Like

Pretty much yeah, with the hope of also having text attached to it too like “48 144 solid”

1 Like

Lists my beloved :heart:

So you can do 2 things here. You can use the Join input, that will cause the X and Y to be combined into text. So if you input ", " you would get an output of “X, Y”.

The other option is adding it to Text first.

So you’d do something like this. (Ignore the Message)
What is happening here is the “Text” is set to empty,
then X is added.
then ", " is added
then Y is added.
So now you get “X, Y” as a text value that will update every frame.


Storing data like this is a really good thing to learn, though not a lot of people experiment with it. So learning lists like is a great sign of being able to improve really quickly

4 Likes

Ok thank you! that was really helpful I got it now.

3 Likes

I would much rather use labels. Wait, what do lists even do?

Lists are the most revolutionary behavior to be added to Flowlab. It is not at all similar to Labels, but Lists are absolutely required when making any sort of dialogue system.

2 Likes

I just use a sprite.

Having to draw every single letter and sentence would take forever.

I think what he meant by dialogue systems was the actual text itself. Instead of having several hundred labels that just ease in and out in transparency, just have a single label and text lists to add and set new text values.

I find them very handy, especially for dialogue.

2 Likes

Yeah, it took a bit too long. I

Ah, ok. Maybe I’ll use them some time.

I know this was a while ago but I’m doing a similar things again. Could you, after combining the coordinates or anything for that matter, then take them apart again. Like you had x and y, then you put them together as x, y for simplicity of transporting the information or whatever, but now I want to take the x and y and put them in two separate number lists. Is there a way to do this, or at least a feasible way to do this?

1 Like

can I show you my system for this? I think it is much better than converting it to text and back. I’ll show you when I get back from school, okay?

1 Like

Here.


Code:

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":90,"y":-64,"group":"","id":"20f5ff32fd4d3746","targetId":0,"prop":"x","version":2},{"inputCount":1,"outputCount":1,"name":"Extractor","behaviorType":"logic.properties.Extractor","x":90,"y":32,"group":"","id":"20f5ffbef1fa3d4c","targetId":0,"prop":"y","version":2},{"expression":"(A+\"\")+(\".\")+(B+\"\")","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":2,"tag":"","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":270,"y":-16,"group":"","id":"20f625a38d17e344","notes":"This adds the two together, with a decimal inbetween","n_o":1},{"inputCount":7,"outputCount":5,"name":"Number List","behaviorType":"logic.data.NumberList","x":630,"y":-8,"group":"","id":"20f6ff63877bfa49","startVal":[]},{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":-90,"y":0,"group":"","id":"20f8c703216d2841","resetOnLevelStart":false},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":450,"y":48,"group":"","id":"20f9157a67ea284a","startVal":1,"tag":"","roundMode":1},{"expression":"(A+\"\").substr(0,(A+\"\").indexOf(\".\"))","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":2,"tag":"","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":810,"y":-112,"id":"20fa932093e73f4c","notes":"Gets integer","n_o":1},{"expression":"(A+\"\").substr((A+\"\").indexOf(\".\")+1,(A+\"\").length)","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":2,"tag":"","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":810,"y":40,"id":"20fa9320639b504d","notes":"Gets decimal","n_o":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":990,"y":-112,"group":"","id":"20fb0c6136cc4843","startVal":0,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":990,"y":48,"group":"","id":"20fb0d0754b79641","startVal":0,"roundMode":1}],"links":[{"input_id":"20f5ff32fd4d3746i0","output_id":"20f8c703216d2841o0"},{"input_id":"20f625a38d17e344i0","output_id":"20f5ff32fd4d3746o0"},{"input_id":"20f5ffbef1fa3d4ci0","output_id":"20f8c703216d2841o0"},{"input_id":"20f625a38d17e344i1","output_id":"20f5ffbef1fa3d4co0"},{"input_id":"20f625a38d17e344i2","output_id":"20f5ffbef1fa3d4co0"},{"input_id":"20f625a38d17e344i0","output_id":"20f5ff32fd4d3746o0"},{"input_id":"20f625a38d17e344i1","output_id":"20f5ffbef1fa3d4co0"},{"input_id":"20f625a38d17e344i2","output_id":"20f5ffbef1fa3d4co0"},{"input_id":"20f6ff63877bfa49i1","output_id":"20f625a38d17e344o0"},{"input_id":"20f9157a67ea284ai1","output_id":"20f625a38d17e344o0"},{"input_id":"20f6ff63877bfa49i1","output_id":"20f625a38d17e344o0"},{"input_id":"20f6ff63877bfa49i3","output_id":"20f9157a67ea284ao0"},{"input_id":"20fa932093e73f4ci0","output_id":"20f6ff63877bfa49o1"},{"input_id":"20fa932093e73f4ci2","output_id":"20f6ff63877bfa49o1"},{"input_id":"20fa9320639b504di0","output_id":"20f6ff63877bfa49o1"},{"input_id":"20fa9320639b504di2","output_id":"20f6ff63877bfa49o1"},{"input_id":"20f5ff32fd4d3746i0","output_id":"20f8c703216d2841o0"},{"input_id":"20f5ffbef1fa3d4ci0","output_id":"20f8c703216d2841o0"},{"input_id":"20f9157a67ea284ai1","output_id":"20f625a38d17e344o0"},{"input_id":"20f6ff63877bfa49i3","output_id":"20f9157a67ea284ao0"},{"input_id":"20fa932093e73f4ci0","output_id":"20f6ff63877bfa49o1"},{"input_id":"20fa932093e73f4ci2","output_id":"20f6ff63877bfa49o1"},{"input_id":"20fb0c6136cc4843i0","output_id":"20fa932093e73f4co0"},{"input_id":"20fa9320639b504di0","output_id":"20f6ff63877bfa49o1"},{"input_id":"20fa9320639b504di2","output_id":"20f6ff63877bfa49o1"},{"input_id":"20fb0d0754b79641i0","output_id":"20fa9320639b504do0"},{"input_id":"20fb0c6136cc4843i0","output_id":"20fa932093e73f4co0"},{"input_id":"20fb0d0754b79641i0","output_id":"20fa9320639b504do0"}]}}}

You can delete this stuff, it’s for you to understand how it works. Keep the equations though.
It just combines the two coordinates, with a decimal between, with an expression. Example:

X=1
Y=4
=1.4
equation: (A+“”)+(“.”)+(B+“”)

Then, you can use another two equations to get the integer and the decimal part of the number. (back into X,Y form.)

equation for integer: (A+“”).substr(0,(A+“”).indexOf(“.”))
in the example, would get 1

equation for decimal: (A+“”).substr((A+“”).indexOf(“.”)+1,(A+“”).length)
in the example would get 4

3 Likes

The system seems to work fine with positive numbers but starts to get funky with negative numbers, I think I might still be able to use it though I just have to change my system a bit.

1 Like

omg you’re right let me adjust the equations…

You don’t have to change it

1 Like

Also would it be possible to add two more integers, I’m messing around with an isometric sandbox so I would be storing an x,y,z and an id?

1 Like

I’m getting some help on the equations, I’ll get it done (the one with x,y) by today hopefully… I’m super busy rn

1 Like

Does this work for you?

Code:

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":-360,"y":392,"group":"","id":"37ded127a4b15c42","resetOnLevelStart":false},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":256,"group":"","id":"37dedde69a285349","startVal":1,"tag":"X","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":344,"group":"","id":"37dede98fbc99143","startVal":2,"tag":"Y","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":432,"group":"","id":"37dedf3da3956443","startVal":3,"tag":"Z","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":520,"group":"","id":"37dee28f5d1b4246","startVal":4,"tag":"ID","roundMode":1},{"inputCount":2,"outputCount":4,"name":"Router","behaviorType":"logic.logic.Router","x":0,"y":368,"group":"","id":"37e091897321a34f","loop":true,"routes":4,"mode":1},{"inputCount":5,"outputCount":2,"name":"Text","behaviorType":"logic.data.TextBlock","x":540,"y":368,"group":"","id":"37e155a60351fc4b","startVal":""},{"inputCount":2,"outputCount":2,"name":"Repeater","behaviorType":"logic.logic.Repeater","x":-180,"y":392,"group":"","id":"37e36b9fe10d5f40","repeatCount":4},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":0,"y":280,"group":"","id":"37e421c58343c54d","startVal":0,"roundMode":1},{"inputCount":5,"outputCount":2,"name":"Text","behaviorType":"logic.data.TextBlock","x":360,"y":184,"group":"","id":"37e4c32c2d6a1e47","startVal":"."}],"links":[{"input_id":"37e36b9fe10d5f40i1","output_id":"37ded127a4b15c42o0"},{"input_id":"37dedde69a285349i1","output_id":"37e091897321a34fo0"},{"input_id":"37e155a60351fc4bi3","output_id":"37dedde69a285349o0"},{"input_id":"37dede98fbc99143i1","output_id":"37e091897321a34fo1"},{"input_id":"37e4c32c2d6a1e47i1","output_id":"37dede98fbc99143o0"},{"input_id":"37e155a60351fc4bi3","output_id":"37dede98fbc99143o0"},{"input_id":"37dedf3da3956443i1","output_id":"37e091897321a34fo2"},{"input_id":"37e4c32c2d6a1e47i1","output_id":"37dedf3da3956443o0"},{"input_id":"37e155a60351fc4bi3","output_id":"37dedf3da3956443o0"},{"input_id":"37dee28f5d1b4246i1","output_id":"37e091897321a34fo3"},{"input_id":"37e4c32c2d6a1e47i1","output_id":"37dee28f5d1b4246o0"},{"input_id":"37e155a60351fc4bi3","output_id":"37dee28f5d1b4246o0"},{"input_id":"37e091897321a34fi0","output_id":"37e421c58343c54do0"},{"input_id":"37e091897321a34fi1","output_id":"37e36b9fe10d5f40o0"},{"input_id":"37dedde69a285349i1","output_id":"37e091897321a34fo0"},{"input_id":"37e421c58343c54di1","output_id":"37e091897321a34fo0"},{"input_id":"37e421c58343c54di1","output_id":"37e091897321a34fo1"},{"input_id":"37dede98fbc99143i1","output_id":"37e091897321a34fo1"},{"input_id":"37e421c58343c54di1","output_id":"37e091897321a34fo2"},{"input_id":"37dedf3da3956443i1","output_id":"37e091897321a34fo2"},{"input_id":"37e421c58343c54di1","output_id":"37e091897321a34fo3"},{"input_id":"37dee28f5d1b4246i1","output_id":"37e091897321a34fo3"},{"input_id":"37e155a60351fc4bi3","output_id":"37dedde69a285349o0"},{"input_id":"37e155a60351fc4bi3","output_id":"37dede98fbc99143o0"},{"input_id":"37e155a60351fc4bi3","output_id":"37dedf3da3956443o0"},{"input_id":"37e155a60351fc4bi3","output_id":"37dee28f5d1b4246o0"},{"input_id":"37e155a60351fc4bi3","output_id":"37e4c32c2d6a1e47o0"},{"input_id":"37e36b9fe10d5f40i1","output_id":"37ded127a4b15c42o0"},{"input_id":"37e091897321a34fi1","output_id":"37e36b9fe10d5f40o0"},{"input_id":"37e421c58343c54di1","output_id":"37e091897321a34fo0"},{"input_id":"37e421c58343c54di1","output_id":"37e091897321a34fo1"},{"input_id":"37e421c58343c54di1","output_id":"37e091897321a34fo2"},{"input_id":"37e421c58343c54di1","output_id":"37e091897321a34fo3"},{"input_id":"37e091897321a34fi0","output_id":"37e421c58343c54do0"},{"input_id":"37e4c32c2d6a1e47i1","output_id":"37dede98fbc99143o0"},{"input_id":"37e4c32c2d6a1e47i1","output_id":"37dedf3da3956443o0"},{"input_id":"37e4c32c2d6a1e47i1","output_id":"37dee28f5d1b4246o0"},{"input_id":"37e155a60351fc4bi3","output_id":"37e4c32c2d6a1e47o0"}]}}}
1 Like