Add new animations during runtime through script?

Questions, comments and discussion about the Game Editor development.

Add new animations during runtime through script?

Postby Ivosh » Tue Aug 30, 2011 2:52 pm

Hello,
I would like to ask, if it's possible to add new animation to the actor during runtime, through script (from external file).

I need to make items and map tiles easy addable to the game. I started to work on RPG, but I don't want to release new game version each time I add an item.

Example:

NewAnimation(char * actor, char * animation_name, char * animation_file_path, int vertical_frames, int horisontal_frames, int frames_per_second, ...);
NewSequence(char * actor, char * sequence_name, char * animation_name, int frames_count, int * frames_array, int frames_per_second, ...);

Is that already possible or should I send feature request?

Thanks.
Ivosh
 
Posts: 1
Joined: Mon Aug 29, 2011 7:07 pm
Score: 0 Give a positive score

Re: Add new animations during runtime through script?

Postby Jagmaster » Tue Aug 30, 2011 3:03 pm

I wonder. If this were possible, it would be quite handy. I know for the playmusic command you specify a file path for the music but when you save, the path changes to data/music.mid because the file automatically gets copied to the data folder. Anyway, I don't think GE can open external files unless they are in the same location as the game itself. If GE had the capability to load files from other directories, that would be a feature that would be greatly appreciated, but I think the developers are working on other things at the moment. :)
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Add new animations during runtime through script?

Postby lcl » Tue Aug 30, 2011 8:36 pm

Well, you can do it if your animations are in same folder as the game and if you will draw your actor by canvas and if you don't fear coding. :D
What you can do is to make a function which reads a file (bitmaps are easiest), and stores the pixels values to an array where you could then draw single frames from.

I could try to make an example for you. :)
It may take few weeks because I'm very busy currently.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest