Page 1 of 1

Add new animations during runtime through script?

PostPosted: Tue Aug 30, 2011 2:52 pm
by Ivosh
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.

Re: Add new animations during runtime through script?

PostPosted: Tue Aug 30, 2011 3:03 pm
by Jagmaster
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. :)

Re: Add new animations during runtime through script?

PostPosted: Tue Aug 30, 2011 8:36 pm
by lcl
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.