I was wondering if there was a way to create an object based on a variable, such as the text in a box or something. So basically what I'm trying to get at here is "Create object Alterable String A".
I was wondering if there was a way to create an object based on a variable, such as the text in a box or something. So basically what I'm trying to get at here is "Create object Alterable String A".
Sure. Just have a condition that says: If text = "blah", then create object A. Are you needing something more complex than that?
I really am surprised you said that.
You didn't answer my question. I already thought of that, and it will require me to create another event for every item I want created based on a string.
You want to create an object whose name is stored in an alterable string, so that the same event can create different objects depending on what is stored in the variable. I can't find a way to do it as the "create object" action cannot be used in an expression.
Sorry, I guess I wasn't understanding what you wanted to do exactly. You would indeed need to create a new event per object.




Depending on the complexity of what you need you could use only one object, but with animations who's names match your string!
as in:
Create the active object. (NOT visible at start)
Set its animation to match the string
Make visible.
You can also set it to diferent movements while creating it, also matching the string.
I've not tried it, but this should work.
Then you just program the one active to act diferently depending on which animation it's playing etc.
VAH: To just be clear about it, you can not pick which object to create from an expression - which indeed is a major problem. This is why people suggest workarounds.
I usually try to make complicated objects that can serve as many different purposes as possible. In Saira, every background object is an instance of the same animated picture object, that have different graphics a different set of parameters to control how it moves. However, again, workarounds is all I can suggest until MMF gets the feature to pick objects to create from expressions.
This is actually what I'm doing with my current game. I have a bunch of different yet similar objects that get generated and I just have it create the one object and then there's a variable that determines what animation/direction to set the object to. Works a charm.Originally Posted by HolyMonkey
![]()
I appreciate all of your comments, although I don't need any other answers or "work-arounds". The complexity of what I need to create will be impossible to use with a single active object, so I guess I will just have to make a compromise. Thanks to everyone for posting.
How complex are we talking here? Do you have hundreds of unique objects that need to be created?
I mean, because other than that, it would merely be adding 1 create event for each type of object... which isn't horrible. If you don't like the idea of seeing fifty create events, just group them and minimize the group. =P
But I really don't see even having 200 "if variable = this" events would cause any major problems. The program should fly through those events in a heartbeat since it's only going to match 1 or none of the values per loop.