How to make a general create object?
So there's a game coming out in fall called Scribblenauts where you write a noun and it appears for use and the different objects interact because every object has a set of properties/attributes. I'm trying to make something like that on MMF2. I've run into a bit of a pothole. I need some way to make it where it creates a certain object based on what you type in. Unfortunately, the Create Object can't use expressions or groups, only specific objects. Is there any way for this to work without making a separate event for every object?
A related problem is that it doesn't sense when the edit text in the combo box is the same as the object name. (I.e., I made an alterable string for each object that is its name, and I have it set to sense when the combo box text is the same as the alterable string text but it doesn't work.)
Thanks.
Re: How to make a general create object?
Quote:
Originally Posted by AdamK
Is there any way for this to work without making a separate event for every object?
No, unfortunately.
Re: How to make a general create object?
I'm not sure if I understood correctly, but you can have the same object with different directions.
Create active 1: Set direction to random (32) then every direction has a different graphic.
Re: How to make a general create object?
No, the directions thing won't work because there are tens of thousands (I think) nouns in the English dictionary. Or maybe just thousands. Anyways, each object has its own properties based on the groups it's in.
Okay, I guess I'll try to do it seperately...
Although it still can't sense what text is in the combo box for some reason.
Re: How to make a general create object?
How were you planning to import the tens of thousands of objects anyway? If you used MMF actives you would still need to import them all.
You could load images from filenames externally and use the filenames as words.
Re: How to make a general create object?
Use strings?
Or some sort of string (Static Text, Text Blitter, etc)?
That way you can create that and set the text at runtime.
Re: How to make a general create object?
I would make a sprite sheet and use the active object's "Load Frame" action. That would probably work better. Use an Alterable Value or Alterable String to note what object it is.
Re: How to make a general create object?
I don't quite understand these last 3 posts. I was trying to find some way to make it create a certain object based on something, like Create Object=name[AlterableStringA] or something, but there's no "Use a Calculation" button.
Also I'm making each object separately, not importing...
Re: How to make a general create object?
Its not possible.
But what I was saying is instead of Actives maybe you could have strings of some sort that you can change the text of at runtime. Then you would only need one I think.
What I would do is have one object to create, that makes it simple. Then give it 32 directions and use 26 of them. See what I'm getting at? Then make a "word loop" to change their direction based on what character is at the loopindex. That could be found using Right$() and Left$().
But sadly there is no way to create an object based on an expression (without the expression being a condition)