- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cant load data through a task node
how can i load data from my json file through task node here is the code for mainscene and taskreader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: cant load data through a task node
Several issues:
- On the task you are doing everything in init(), this is render thread. You dont define m.top.FunctionName to specify a sub to actually run on a thread. Defeats the entire purpose of a task.
- The task never observers or even looks at the datapath field. You are specifying a field then hardcoding it where you would have used it.
- The task never does anything with it's result. You defined a dataarray field but again never used it, never assigned you result to it. You may have intended to in line 23?
- The mainscene never observes or references the dataarray field.
I get the impression you were trying to create onscreen objects in the task, but a task (had it been properly in a thread sub) would not be allowed to do this anyway.
If this is a one time load and render before the user sees it, you could just do it in mainscene.
If this is a menu load system that you dont want the user to wait for, have a task with a field and update a content node array and you load "Tiles", assigning it to the field at whatever iteration group size you need. Meanwhile observe it from render and update the tiles as the content node array as it changes.
You might be better off using a MarkupGrid if you are just trying to create a menu of custom tiles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: cant load data through a task node
You aren't addressing the defined fields in the task, observing the input or setting the output and observing it in the render thread, so they are accomplishing nothing being there. You also aren't really using the task as a thread - everything is in Init (which is for a quick setup and runs on the render thread). You never define a task level sub/function or trigger it via m.top.FunctionName in your tasks Init (which is the main purpose of the Init).