Find in Table Issue

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
RamchuK_Ntertainment
Ultimate 001 Member
 
Joined: Tue Sep 29, 2009 10:50 pm
Location: Seattle, Washington

Find in Table Issue

Postby RamchuK_Ntertainment » Fri Feb 24, 2017 1:16 pm

I'm having a hard time in retrieving proper coordinates of an item within a Table. I have been using Table.Find() and it's either acting up, or I'm setting something up wrong. My objective is to pull (x,y) coordinates of a specific value within Table Z. If I use Table.Find(Z,1,"item",1,1,1) to retrieve X alone, it works ONLY at Y=1. If the item is moved anywhere else on the Y-axis within Table Z, it will return 0 for X. The same is true for Y, except it will only return the true Y coordinate when X=1. I suspect that I'm doing something wrong, since it seems like it wants me to feed another value in order for it to return the correct X and Y coordinates. What am I setting up wrong? What would be the correct way of going about this? I may be wrong, but I thought that Table.Find() searches the whole Table and retrieves the index of the first occurrence as it concerns the value being searched for. Is this not the case?
Travesty: 3D Survival - WIP >>> Forum Topic
University of Washington (BABA)
-REGT- Ramchuk Entertainment Games Team
Strategy/Action/Adventure
Copyrighted©2008-2017

Whoacoder
001 Support
 
Joined: Sat Oct 03, 2015 8:40 pm
Location: Fraser, CO

Re: Find in Table Issue

Postby Whoacoder » Fri Feb 24, 2017 2:44 pm

Not sure if I've got the best reply, but I'll try to help since I just messed with Find in Table recently

"If I use Table.Find(Z,1,"item",1,1,1)"

I think you may want it to say Table.Find(TableName,3,"item",1,1,1) to search on the Z=3 axis I believe?

I have only recently started testing out the Find in Table, but I've managed to get it working to pull information from a table into another based on it searching through rows to match an "ID" label basically, but searching along the Y(2) axis instead of Z(3). In my project, it searches along the Y axis of a Table called Campaign Missions and only on a single specific Z layer using "Table.Find(CampaignMissions,2,MissionID,1,1,Phase)", where Phase is just a parameter I grab a number from that tells which Z table to search through. But I think if you set your Axis to 3, it will just search through each Z-page

User avatar
RamchuK_Ntertainment
Ultimate 001 Member
 
Joined: Tue Sep 29, 2009 10:50 pm
Location: Seattle, Washington

Re: Find in Table Issue

Postby RamchuK_Ntertainment » Fri Feb 24, 2017 6:52 pm

@twitchcoe
Thank you for your response, but this doesn't resolve my issue. Specifying the axis to search will simply return the coordinate on that axis, which corresponds to the item that one is searching for; I'm searching for an item that is on Z=1, but X and Y locations vary. Even when I search on the Z axis, it only returns the coordinate when the item is at (1,1). It returns zero when the item is elsewhere.
ILL.png
ILL.png (3.12 KiB) Viewed 913 times

Assume the illustration above is a table in which an item of interest is located at (2,2). These coordinates are unknown, however, and this is where I use Table.Find(Z,1,"item",1,1,1) to find X and Table.Find(Z,2,"item",1,1,1) to find Y. The problem is that in the case demonstrated above, both of these commands return 0, as if the item does not exist, when it does. The simple question then is, how do I find the coordinates of the item above? I've used Table.Find() before and I assume that my setup is correct, but as described earlier, X only returns when Y=1 and Y only returns when X=1. If the item is at (2,2), (2,4), (4,7), etc, Table.Find() returns 0.
Travesty: 3D Survival - WIP >>> Forum Topic
University of Washington (BABA)
-REGT- Ramchuk Entertainment Games Team
Strategy/Action/Adventure
Copyrighted©2008-2017

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Find in Table Issue

Postby Mike » Fri Feb 24, 2017 6:56 pm

It did have a bug a while ago. If you can make a smaller blank project with an issue with find on an extremely small data set, I wouldn't mind looking into this for you. I'd just rather not work with a large project involving tables as there could be a lot of other issues at play.

User avatar
RamchuK_Ntertainment
Ultimate 001 Member
 
Joined: Tue Sep 29, 2009 10:50 pm
Location: Seattle, Washington

Re: Find in Table Issue

Postby RamchuK_Ntertainment » Fri Feb 24, 2017 7:02 pm

Bug report sent.
Travesty: 3D Survival - WIP >>> Forum Topic
University of Washington (BABA)
-REGT- Ramchuk Entertainment Games Team
Strategy/Action/Adventure
Copyrighted©2008-2017

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Find in Table Issue

Postby Mike » Fri Feb 24, 2017 7:14 pm

Ah, usually the use case is to scan a single axis, not scan the entire table. Usually people know where something is located in a table that's used for the purposes of spatial scanning. The intent of the axis parameter is to indicate which axis to scan, not which to return.

I will change "Axis" to "Axis to Scan" and "X/Y/Z" to "Starting X/Y/Z", to clarify things a bit.

However, I'm happy to add a use value that will scan a table all over and return a collection of the three co-ordinates.

I also noticed the "Find in Collection" use value could use a "Starting Index" parameter as well.

User avatar
RamchuK_Ntertainment
Ultimate 001 Member
 
Joined: Tue Sep 29, 2009 10:50 pm
Location: Seattle, Washington

Re: Find in Table Issue

Postby RamchuK_Ntertainment » Fri Feb 24, 2017 7:30 pm

Mike wrote:Ah, usually the use case is to scan a single axis, not scan the entire table. Usually people know where something is located in a table that's used for the purposes of spatial scanning. The intent of the axis parameter is to indicate which axis to scan, not which to return.

Okay, that makes sense.

Mike wrote:However, I'm happy to add a use value that will scan a table all over and return a collection of the three co-ordinates.

That would be pretty awesome actually and quite useful! I had the choice of a manual search or Find.Table(), so having this as an actual shortcut would make life a lot easier in certain circumstances.

Thank you for looking into this Mike!
Travesty: 3D Survival - WIP >>> Forum Topic
University of Washington (BABA)
-REGT- Ramchuk Entertainment Games Team
Strategy/Action/Adventure
Copyrighted©2008-2017

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Find in Table Issue

Postby Mike » Fri Feb 24, 2017 7:56 pm

No problem, it was a worthy mention. And thanks for the bug report, it made it a lot easier to add.

Whoacoder
001 Support
 
Joined: Sat Oct 03, 2015 8:40 pm
Location: Fraser, CO

Re: Find in Table Issue

Postby Whoacoder » Fri Feb 24, 2017 10:27 pm

After some more clarification, I get exactly what you were trying to do now.. And scanning through the table like that would be a really useful use value too, imo. I think I originally assumed that was what the Find in Table was used for, and that it could search through to locate a specific item on any axis, but figured out what I needed it to do without going that far. Would make a nice little addition!

Haha Sorry my response was not particularly helpful, but.. figured I'd give it a shot XD


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron