The Daily Click ::. Forums ::. Klik Coding Help ::. Shapeshifting
 

Post Reply  Post Oekaki 
 

Posted By Message

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
21st October, 2008 at 03:38:43 -

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?



 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

aphant



Registered
  18/05/2008
Points
  1242
21st October, 2008 at 04:44:24 -

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).

 

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
22nd October, 2008 at 03:44:37 -

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.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

WillWill

Give me stuff

Registered
  24/07/2006
Points
  552
22nd October, 2008 at 11:11:29 -

Doesn't this kinda all depend on how you want the actual "shifting" to look like?

You could do it in tons of ways anyway.. Like having different objects that have different animations simply.

 
http://www.morphboy.newgrounds.com/
^ Free tunes, as long as you contact me.

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
23rd October, 2008 at 04:06:09 -

Ahh, in simple words, I just need some events that will select an object and move the selected object.
E.g, there's a text box that says 'active 1'

so what i want is;

right is pressed = move 'active 1' (from textbox)

similarly, if text box said 'active 2', mmf should move 'active 2'
because now it should look like:
right is pressed = move 'active 2' (from textbox).


 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
23rd October, 2008 at 07:32:09 -

Put all of the actives in the same group, then spread value 0 across alternate variable A of the group. Make a counter and then a condition like this

if alternate variable A of (group) is equal to (counter)
and if right is pressed
--move (group) right

Then only the object in the group with the same number stored in it alternate variable A as in the counter will be affected by the action

or whatever, that should work!

 
n/a

WillWill

Give me stuff

Registered
  24/07/2006
Points
  552
24th October, 2008 at 08:55:19 -

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.

 
http://www.morphboy.newgrounds.com/
^ Free tunes, as long as you contact me.

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
24th October, 2008 at 20:13:10 -

Haha, maybe. I dont know, I still havent tried urbanmonk's solution but it sounds promising Active picture object? Does it support animated gifs?

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

WillWill

Give me stuff

Registered
  24/07/2006
Points
  552
27th October, 2008 at 12:47:15 -

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.

 
http://www.morphboy.newgrounds.com/
^ Free tunes, as long as you contact me.

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
27th October, 2008 at 20:44:02 -

I appreciate that I'll try it as soon as I get home. I've been away for nearly 2 weeks now with no access to mmf.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
1st November, 2008 at 03:27:14 -

http://www.freewebtown.com/wolfpackgames/Application1.cca

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.


.....nothing???

Image Edited by the Author.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
7th November, 2008 at 06:58:01 -

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

 
n/a

Ecstazy



Registered
  04/01/2002
Points
  179

VIP Member
9th November, 2008 at 22:46:32 -

You got me curious about your game.
Is it something like Shiny's Messiah?

 
Amongst Strangers
http://www.create-games.com/project.asp?id=1445

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
10th November, 2008 at 00:15:09 -

@ 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.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
10th November, 2008 at 06:05:28 -

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

http://www.jsoftgames.com/ActiveReplacment.zip

 
n/a
   

Post Reply



 



Advertisement

Worth A Click