Custom Problem Start for ToL


Author
Message
chunhoilauhk
chunhoilauhk
Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)
Group: Forum Members
Posts: 9, Visits: 34
Hi All,
I realised this way too late into editing the task, and discovered that all the problems has the same position for all the blocks and pegs. Inside the code it has the start positions as:

/ r_startX = parameters.h1
/ r_startY = parameters.v2
/ g_startX = parameters.h1
/ g_startY = parameters.v1
/ b_startX = parameters.h2
/ b_startY = parameters.v1

Which isn't ideal if I want each problem to has its own custom start point. I figured that I will have to create a list such that:

<list r_startX>
/items = (parameters.h1,parameters.h2...)

and so on for the other problems. But how do I get the script to change the start positions according to the list as the problems progress?





chunhoilauhk
chunhoilauhk
Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)
Group: Forum Members
Posts: 9, Visits: 34
So i've worked on it a bit more and so far I developed lists so that:

<list g_startX>
/items =(parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2)
/ selectionmode = list.problemnumber.currentindex
</list>

...

and so on for the rest of the fields (the h2 is temporary to just get it working first).

Then I modified the trial.newround such that:

values.b_targetY=list.b_targetY.nextvalue;
values.r_currentX=list.r_startX.nextvalue;
values.r_currentY=list.r_startY.nextvalue;
values.g_currentX=list.g_startX.nextvalue;
values.g_currentY=.list.g_startY.nextvalue;
values.b_currentX=list.b_startX.nextvalue;
values.b_currentY=list.b_startY.nextvalue;
picture.R.hposition = list.r_startX.nextvalue;
picture.R.vposition = list.r_startY.nextvalue;
picture.G.hposition = list.g_startX.nextvalue;
picture.G.vposition = list.g_startY.nextvalue;
picture.B.hposition = list.b_startX.nextvalue;
picture.B.vposition = list.b_startY.nextvalue

but I get the error: Expression '.list.g_startY.nextvalue' is invalid. Expression contains an unknown element or property name. What am I missing?

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
chunhoilauhk - Wednesday, May 9, 2018
So i've worked on it a bit more and so far I developed lists so that:

<list g_startX>
/items =(parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2)
/ selectionmode = list.problemnumber.currentindex
</list>

...

and so on for the rest of the fields (the h2 is temporary to just get it working first).

Then I modified the trial.newround such that:

values.b_targetY=list.b_targetY.nextvalue;
values.r_currentX=list.r_startX.nextvalue;
values.r_currentY=list.r_startY.nextvalue;
values.g_currentX=list.g_startX.nextvalue;
values.g_currentY=.list.g_startY.nextvalue;
values.b_currentX=list.b_startX.nextvalue;
values.b_currentY=list.b_startY.nextvalue;
picture.R.hposition = list.r_startX.nextvalue;
picture.R.vposition = list.r_startY.nextvalue;
picture.G.hposition = list.g_startX.nextvalue;
picture.G.vposition = list.g_startY.nextvalue;
picture.B.hposition = list.b_startX.nextvalue;
picture.B.vposition = list.b_startY.nextvalue

but I get the error: Expression '.list.g_startY.nextvalue' is invalid. Expression contains an unknown element or property name. What am I missing?

See the attached script. It has an additional problem with a different start position at the end, and the <list>s defining the start positions are all present. You can use that as a guide for your own.

Attachments
toweroflondon_additional_problem.zip (359 views, 553.00 KB)
chunhoilauhk
chunhoilauhk
Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)Expert (1K reputation)
Group: Forum Members
Posts: 9, Visits: 34
Dave - Wednesday, May 9, 2018
chunhoilauhk - Wednesday, May 9, 2018
So i've worked on it a bit more and so far I developed lists so that:

<list g_startX>
/items =(parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2)
/ selectionmode = list.problemnumber.currentindex
</list>

...

and so on for the rest of the fields (the h2 is temporary to just get it working first).

Then I modified the trial.newround such that:

values.b_targetY=list.b_targetY.nextvalue;
values.r_currentX=list.r_startX.nextvalue;
values.r_currentY=list.r_startY.nextvalue;
values.g_currentX=list.g_startX.nextvalue;
values.g_currentY=.list.g_startY.nextvalue;
values.b_currentX=list.b_startX.nextvalue;
values.b_currentY=list.b_startY.nextvalue;
picture.R.hposition = list.r_startX.nextvalue;
picture.R.vposition = list.r_startY.nextvalue;
picture.G.hposition = list.g_startX.nextvalue;
picture.G.vposition = list.g_startY.nextvalue;
picture.B.hposition = list.b_startX.nextvalue;
picture.B.vposition = list.b_startY.nextvalue

but I get the error: Expression '.list.g_startY.nextvalue' is invalid. Expression contains an unknown element or property name. What am I missing?

See the attached script. It has an additional problem with a different start position at the end, and the <list>s defining the start positions are all present. You can use that as a guide for your own.

Thank you so much again for your guidance Dave! My approach was correct, but something must've went wrong when I was coding the lists for list.g_startY. I copied your formatting over for that list and it works perfectly.

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
chunhoilauhk - Wednesday, May 9, 2018
Dave - Wednesday, May 9, 2018
chunhoilauhk - Wednesday, May 9, 2018
So i've worked on it a bit more and so far I developed lists so that:

<list g_startX>
/items =(parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2,parameters.h2)
/ selectionmode = list.problemnumber.currentindex
</list>

...

and so on for the rest of the fields (the h2 is temporary to just get it working first).

Then I modified the trial.newround such that:

values.b_targetY=list.b_targetY.nextvalue;
values.r_currentX=list.r_startX.nextvalue;
values.r_currentY=list.r_startY.nextvalue;
values.g_currentX=list.g_startX.nextvalue;
values.g_currentY=.list.g_startY.nextvalue;
values.b_currentX=list.b_startX.nextvalue;
values.b_currentY=list.b_startY.nextvalue;
picture.R.hposition = list.r_startX.nextvalue;
picture.R.vposition = list.r_startY.nextvalue;
picture.G.hposition = list.g_startX.nextvalue;
picture.G.vposition = list.g_startY.nextvalue;
picture.B.hposition = list.b_startX.nextvalue;
picture.B.vposition = list.b_startY.nextvalue

but I get the error: Expression '.list.g_startY.nextvalue' is invalid. Expression contains an unknown element or property name. What am I missing?

See the attached script. It has an additional problem with a different start position at the end, and the <list>s defining the start positions are all present. You can use that as a guide for your own.

Thank you so much again for your guidance Dave! My approach was correct, but something must've went wrong when I was coding the lists for list.g_startY. I copied your formatting over for that list and it works perfectly.

Great -- thanks for letting me know!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search