Alright, I want to implement a shapeshift feature in my game. I understand that its easily possible if you're there are a total of 1-5 number of shapes. What I mean is, if you know what your character is going to change into, you can easily replace it with the active of that object.
Here lies the problem. I want the player to be able to turn into any and i do mean any NPC he or she desires. Any one have any ideas in this regard? There has to be an easy way to do this in mmf instead of saying something like:
if A is 1 and right is pressed --> move active object A1
if A is 2 and right is pressed --> move active object A2
Let's just assume that all the actives have the same animation names for maximum compatibility, is there anyway to do it?
I guess in an algorithm I could solve this problem by saying:
If right is pressed --> move active object(var) in which Var is the name of the active object. or number. I just dont know how to accomplish this in mmf. Can you remove objects and add objects to groups at runtime?
If you're using two objects, detector and sprite, you should be able to set some odd flag to ON to signify that the NPC sprite should be attached to the detector. Then, when you need to move the sprite, use the pick or count thing to make it choose the right one.
You could also have a single sprite object, with all forms as different animations. Then when you need to pick a form, just do something like setting a value to reflect which form to pick, and set the animations to (form#)*(# of animations)+(animation to play).
Kudos to you if you understand whatever I'm saying (I'm tired).
uh...no, i didnt get that. You did mention a lot of animations though, right? I dont want the main character to have all those animations. I just want him to be replaced with the npc.
Ok, even if there are many animations, I want the code to know which ones to pick and not do everything manually. Refer to what I was saying above to understand. Any help, as always, is most appreicated.
I think you really overcomplicated the thread from the beginning.
If you want a different way to have different shapes from the same object you could use the Active Picture object. It's a pretty neat extension that comes with MMF2.. It is however less easy to change animations with if you're not very used to it.
Well I've never tried animated gifs, but I suggest you should give it a try.
Alot of people like to work with the active picture object simply because it's a real life-saver when you want to be able to rotate images/animations up to the whopping 360 degrees. Of course it makes the images look slightly bad.
A different alternative would be the Alpha Channel object (I think that's what it's called) which will allow you to add a kind of "antialiasing" effect to the object. Since this object can also be rotated, that might be the thing for you.. But I'm not entirely sure if it can animate gifs.
Good luck anyways, my experience with graphical objects is abit outdated but if noone here is here to help then I'll do my best to contribute.
Nope, UrbanMonk's solution didnt work. Unless Im not doing it right, which im pretty sure I am. So please, someone have a look at this file and let me know how its doneee.
If you want me to look at it your going to have to upload it somewhere's else, Firefox is giving me trouble, its saying its an attack site or something
@ Urbanmonk - I know firefox does that but my file isnt infected, i just downloaded it. Anyway, I uploaded it to rapidshare. Sorry for the wait and the ads
http://rapidshare.com/files/162280051/Application1.cca.html
the application just contains what you posted earlier.
@ ecstazy - Its a side scroller pretty much with rpg elements and 5 different classes. One of them's a shapeshifter, hence why I need to be able to do this.
It worked fine to me, BUT I'm not sure if that's what you wanted so I tweaked it a little bit.
Anyway I'm guessing you don't have MMF 2 so I hope you can read the file as thats what it was resaved with.
IF you can't read it I'll just post the code for ya, a exe is also included