Grabbing animation from active
Ok, I have 12 actives that are inventory slots. They all have the same animation frames/suquences inwhich each direction contains a different item, when I add a new item to the game I have to add to all 12 actives which can take quite a few damn minutes.. (copy and pasting) So I wonder if I can just add the item animation to 1 of the actives and then make the other actives grab the animation from that updated active rather than me having to waste time doing it all.
Re: Grabbing animation from active
You can simply use duplicates (not clones) of the object. That way, when you update one, you update them all.
Re: Grabbing animation from active
But I've already coded it all now to use seperate, so that would be a pain to remake.
Re: Grabbing animation from active
Then, I would say it will require a copy/paste to update them. You would need to decide if the pain of recoding will outweigh the pain of copy pasting a single animation across a couple actives.
Live and learn. ;)
Mobichan
Re: Grabbing animation from active
That's over 100 events of recoding, I don't know which one will be worse. Isn't there some kind of object or something to make it so on start of frame it will set all the animations of slots 2-12 to slot 1?
Re: Grabbing animation from active
Run a loop that creates all the "slots" by making duplicates of one slot active object. In the loop, create and position each slot and set the animation based on whatever criteria you want. It is only a few lines of code, depending on the configuration of your slots in your menu.
There is no "do it for you" object. You just need to think about all the things you need your slots to do ahead of time and then design your slots around that.
Re: Grabbing animation from active
Yeah. Create one single slot object. Make it exactly like the ones you already have. Give it an Alterable Value... something like "Slot ID".
Then run a loop:
Code:
Start of Frame:
== Run Loop "Identity" Number of "Inventory" object times.
On loop "Identity":
== Set "Slot ID" of "Inventory" object to Loop Index of "Identity".
This will make each of your 12 duplicate actives numbered 1 to 12. Then, just compare the Slot number when you want to use a specific inventory slot.
This method is probably better in the long run anyway. Like mobichan said, live and learn.
Re: Grabbing animation from active
Do you guys take this seriously? I'm not a dumbass I know how to do that and I'm no noob either. That's the easiest thing to do ever and JimJam are you a noob? Because it does'nt take a loop to do that.
Start of Frame:
Spread Value in ID of "Inventory"
I'm sorry if I was too harsh but both of you have offered no such more knowledge to me, So I guess I won't use this forum anymore. Because every topic I do on this forum, never get's solved and they all either are lazy and can't be arsed answering it, or tell me something I already know. They refer to **** I already have tried, And it never get's done.
Re: Grabbing animation from active
If you don't give information as to why you CAN'T use what they suggest, or state that you HAVE tried that, then how are the people who are willing to take time out of their lives to help you out supposed to know?
People are not mind readers.
They presented a solution for you that based on the information you gave seemed to them to fix your problem, and then you get angry stating that you know how to do it and it's easy.
Yet, you don't state that it will not work for you, so we can only assume it will work, and for some reason you are angry at them for suggesting a solution that is both easy to implement and will solve your problem.?!?!?!
Forums have a bunch of people with a wide range of skills and experience, if you feel that no-one on these forums is as experienced or skilled as you and therefore is a waste of your time, then I have to say that's not really a good attitude.
You should be willing to share your experience and knowledge to help everyone else out.
Eventually, you will get a good community of experienced people all willing to help out and give back into the forum that they learned so much from.
Re: Grabbing animation from active
Well, I can't say much about what you said. Because I understand that all what you said is true. I would do the suggestion and understand that I didn't say I already knew it, But I did ask if there was an object for what I asked for. I didn't say "Oh is there like an event where I can give a bunch of duplicated actives different ID's" did I not? I'm sorry if I meant so harshly.
Re: Grabbing animation from active
dcrew: you must know (being such an experienced user) that there are many ways to approach anything in MMF. That said, you seem to have chosen a very inflexible way of doing an inventory slot. We have offered solutions that you can choose to use or ignore. Just realize that just because YOU want to approach your coding one way doesn't mean it is the common way of doing it or even the most efficient. And since your approach is probably not the common way of doing it, it is very unlikely that someone has made an extension to do what you are asking. Sorry you had bad experiences on the forums, but you might want to explain your situation very clearly next time so everyone knows where you are coming from.
And as BREK stated, we take time out to try and help, so yes we take this stuff seriously. Because there are tons of new users on here every week that ask very basic questions, I assumed that your situation was one in which you didn't know the ins and outs of MMF. Sorry if that was an error on my part.
Re: Grabbing animation from active
Well this is my first game I've done propper inventory, most of my games never needed or had inventories.
Re: Grabbing animation from active
Sorry, I don't know what to tell you. If I understand correctly, it seems you've coded yourself a very inflexible inventory system. There is no easy method to share animation frames between multiple different actives. Any method that you could come up with would probably take more time to code than to just redo the inventory from scratch in one of the methods suggested.
We suggested a looping method to sort multiple objects of the same type, and you suggested Spread value as a better alternative. We gave a good suggestion, and you gave yourself a better (and simpler) one. You solved your own problem!
If you knew how to use multiple instances of the same object via spread value (a feature that took me a while to fully understand) I don't see why you didn't use that method in the first place.
So again, I'm going to say this: redoing the whole inventory system using indexed duplicates of one object would probably take LESS time to code than figuring out a way to share individual animation frames between cloned objects. Because I know for a fact that there isn't an easy way to do this.
The only easy way I could think off of the top of my head would be to create your sprites for your inventory items in a BMP file, formatted for box mode import. This way you could just press the "import box mode" button and have each frame set up automatically. But then again, since you used directions instead of animation frames for the individual inventory items, you would still have to copy/paste each frame into each direction.
I'm sorry to say, but you kind of worked your way into a corner with this one. Your options are pretty much to copy/paste each item every time, or recode it from scratch to be more flexible. Which should only take tens of events anyway.
You've got to weigh the trade-offs here. Does it save more time for you in the long run to copy/paste, or to redo the inventory? This is something you have to figure out for your individual situation. It could save you more time to just copy/paste. But from my limited perspective I would suggest redoing the inventory to save yourself headache in the long run. But this is just my suggestion from my point of view, given the information you have provided.
I'm not trying to be mean here. As stated above, I am trying to help. I'm taking time out of my day to help you. The truth of the matter is that with programming there are many ways to achieve the same thing. There is nothing wrong with the method you are using. But given that you have come here looking for an alternative, we have suggested an alternative. Your only options are to take an alternative, or continue using your inventory as is. Because I just don't think there is an easy way to share a single animation direction and have it copied to multiple objects of different types.
Re: Grabbing animation from active
The main thing is you are misunderstanding what an object (properly known as an extension) does. Extensions generally work with the runtime and have conditions, actions, and expressions. There isn't and probably won't ever been an object that lets actives share properties at edit time.
Agreed with the above, you have not created a nice inventory system, so you can either work with its inflexibility, or take some time to do it right. Personally I don't see why you'd work hard just to keep crap code working. Let this be a learning experience and follow advice to have a flexible inventory.
Also, you might want to plan ahead for your projects. I find myself in similar ruts when I just take an idea and have at it as fast as I can. When I think about the game, what it needs, what I CAN do, I can make a decent sytstem with room for change. Lots of times I even leave room for change when it will never need it. It's still good to have.
Also, we are all volunteers, mainly. No one's paying us to answer your questions. Take the help you can get.
Re: Grabbing animation from active
As much as I want to redo it I can't, it's using over 100 events the inventory (not just to hold items) but things like trade,buy,sell etc. I think it just be easier to stay as. What do you think now? Would you redo it even if you had 100+ events to remake?
Re: Grabbing animation from active
Yes. I, personally, would redo it. I have never found that my games are coded correctly the first time. In most cases, I end up recoding at least half of my game code once I get nearly done with it, because I see where I can optimize and simplify. I usually approach things like Eliyahu said and work in more complexity than I need, just in case. But I often find that the first "stab" is to get an idea of what I can do with MMF and how complex my ideas will be in the final product. Once I get a good understanding of things, then I rewrite what seems to be getting in the way of my other code.
I guess it is hard to explain it and everyone works differently. But that is usually my process. I have never found it a good practice to expect the first thing I code to be the best solution. Unless, of course, it is code that I have used across multiple projects and seems to work well for me.
Good Luck,
mobichan
PS. POST 1000!! Woot!!!
Re: Grabbing animation from active
Gratz, I suppose.. I have optimized like 200 events of the whole 324 events :D Which I am very happy with. Because I'm not usually the good person to optimize. I find that this isn't a case of just optimization, but clearly also whether I wanted to ease the work I put into it. I will see how this goes :D Thanks guys for your replies! XD