create a new unknown type?

BlitzMax Forums/BlitzMax Programming/create a new unknown type?

well originally i had a list of tasks that could be completed in 2 ways each:

type task
field first_solution:task
field second_solution:task
field description$
end type

my game was written in Blitz3d using only 2d commands so I transferred the project over to blitzmax quite easily.

each solution had a pointer to a different new task. So, if you completed a task in a certain way it would change the story.

Then I used XML notepad to design the structure of the tasks.

then I used a different type for each game character that was handing out the tasks

e.g.
type wizards_tasks extends task
field first_solution:wizards_tasks
field second_solution:wizards_tasks
end type

this was a convenient way of being able to get to the first in the list.(using the first command)

then I didnt want to write a new function to read each characters tasks in the xml file.

so I created this function

function read_children(xmlnode,parent_pointer:object)

end function

to recursively read all the tasks,in the xml file and create new type instances.for the first and second solutions.
but I didnt know which type was being used at the time,

I may have to just merge all the tasks into the same type,
but i was afraid that was going to slow the game down going through every single task each time to find one.