<Hub>
<New name="dialogue" on="1">
<Print str="Cloud : ... I don't know" />
<MoveObject name="randomnpc" x="100" y="160" />
<StartThread name="blankout" />
<Print str="Random : ok, ok , ok" />
</New>
<New name="blankout">
<Wait time="200" />
<BlankOutScreen />
</New>
</Hub>
and im thinking about replacing it with a scripting language (i use Perl alot so that would be ideal), and have been looking at GDNet articles.
In the game engine Hub contains Threads (which have a list of various events which it runs through when the thread is triggered). There is also a lookup table where the thread on creating its list of events, passes the xml element to the table which parses it for the event name and passses this to the event (to initialize its variables), and returns the ready event to the thread.
So the on every game loop, the hub runs through every event, calling currthread->Run(), and inside the thread calls currevent->Run() ++currevent.
BTW ++currevent is only done once currevent returns OK (the other choice being WAIT - i.e if it was an event testing for a condition).
I want to know, would moving to a scripting language approach improve the ease of creating event structures? Would i need to make any serious changes to my event structure at the moment (could I tie events to function calls?)? What languages would you recommend (would Perl work?)?
Am i correct in thinking the above would become
print("Cloud : ... I don't know");
MoveObject("randomnpc",100,160);
blankout();
print("Random : ok, ok , ok");
sub blankout()
{
wait(200);
BlankScreen();
}
How could I have the main code and blankout run at the same time (i.e wait and print happen in same loop)?
(im new to scripting languages integrated into compiled code)