Is there a script engine that implements NPC auto movements?

Anything libgdx related goes here!

Is there a script engine that implements NPC auto movements?

Postby jlapton » Fri Jun 08, 2012 2:26 am

What I want to do is:
write a script and describe NPCs on the screen and let them move one by one, during the movements some of them will display some animations maybe.

I know I can chain some Actor's Actions(MoveTo,RotateTo etc) together but I find it difficult when there are mass of actions, so I'm wondering is there an existing engine so that I can just write some scripts to make this.

Thanks for any idears :lol:
jlapton
 
Posts: 23
Joined: Wed Apr 11, 2012 9:54 am

Re: Is there a script engine that implements NPC auto moveme

Postby Varriount » Fri Jun 08, 2012 6:10 pm

Well, while I don't know any script loader off-hand, I don't think it would be too hard to assemble a basic script reader.

Personally, I would use yaml, xml, or some other markup language to define a series of movements, construct a loader to load and parse the file at the start of the game, and inject the parsed movements into whatever handles NPC movement logic upon creation of the NPC. I don't think this would work too well for complicated movements, but I can see it working well for a series of predefined movements.

Alternatively, you could take SpriteBatch's approach, and have movements hooked up like the draw operations are done.
What do you think of this?
Think of the unanswered posters : search.php?search_id=unanswered
If I'm you and you're me, then who's he?
Varriount
 
Posts: 249
Joined: Tue Jun 05, 2012 2:48 pm

Re: Is there a script engine that implements NPC auto moveme

Postby jlapton » Mon Jun 11, 2012 2:36 am

Thanks Varriount, I did wrote an "engine" -- actually a loader/container, in which I put libgdx Sequences, and execute them one by one.So in this way I can combine lots of actions together.
However I'm not very clear and still trying to add some sprite animations(like character walking or waving a sword etc) into to the action list.
jlapton
 
Posts: 23
Joined: Wed Apr 11, 2012 9:54 am

Re: Is there a script engine that implements NPC auto moveme

Postby Varriount » Tue Jun 12, 2012 2:29 am

Well, if you need some help, paste some code and we can see what we can do.
Think of the unanswered posters : search.php?search_id=unanswered
If I'm you and you're me, then who's he?
Varriount
 
Posts: 249
Joined: Tue Jun 05, 2012 2:48 pm


Return to Libgdx

Who is online

Users browsing this forum: No registered users and 1 guest