Attaching multiple active objects
Hi all,
I'm developing an action RPG where the player character can equip different items into each hand (and this is reflected visually). Normally, you would combine two active objects by telling one to follow the others hotspot (so the animation would line up correctly).
However since I need two equipped items to follow the animation of my player sprite, I'm not certain how to approach this.
Is there any way to get a second hotspot for an active object?
I know I could create whole other animations for the secondary items, and have them overlap the player sprite completely, but this is too costly.
Thanks in advance for any assistance.
Re: Attaching multiple active objects
Maybe use a 2x2 active and set this to the hot spot of the character, then set your equipped item to the hot spot of your 2x2.
Re: Attaching multiple active objects
Hey!
And I have similar question. I know how to link objects when I have 1 instance of each object. I need it for something like "view range" for my platform game. I have multiple enemies and creating copies of it AND linked view range and programming each enemy X times even with copy-paste method instead of creating instances of these objects isn't good, right? Later I will give an example.
And for artician's question, because I linked as a parasite to his topic, you should combine with adding, substracting pixels to/from your hotspot, e.g. Set x position of active 2 to XHotspot("active")+23
//EDIT: nivram's method is too complicated.
Re: Attaching multiple active objects
Try setting the hero's action point to be the other hand, and then set weapon 2's X to XActionPoint("Hero") and Y to YActionPoint("Hero").
Also, if you're using the hot spot of the hero for weapon 1's position, and the hero has platform movement, you may run into bugs with regard to platform detection (at least this happened in MMF 1.x). There was a complicated workaround that we can dig up if you need it.
Hope this helps!
Re: Attaching multiple active objects
I'd be curious what the best way to do more than just weapons. Like say you want to have armor, head, chest, legs, etc.
I guess you could make actives for each and combine them somehow? I'm not sure.
In 3d games, you can do texture swapping for new armor and stuff. Not really sure how you'd achieve something similar in a 2d sprite game.
Re: Attaching multiple active objects
All -
Thanks! I will try the "set weapon 1 to hotspot. set weapon 2 to hotspot + XY offset" That sounds like it should work okay.
Shawn -
For armor: My characters are 96x128 pixels. I just made the armor/helmet/etc sprites fill up a 96x128 pixel area, so when I add them to my character they automatically line up. It's a bit more memory intensive, but the animation is smoother and it's very easy to implement.
Thank you all again! If anyone has any other suggestions I'm all ears for other methods.
Re: Attaching multiple active objects
You can use the action point. Set the weapons to 0,0 from the action point. But between the hotspot and action point, you can only equip two weapons.
Re: Attaching multiple active objects
If you find you need to attach more than 2 objects to the hero, here is a complete tutorial.
Happy coding!
Re: Attaching multiple active objects
why dont u test the 'sticky object' extension? I beleive this does what you want..