Hey, I was wondering if there was anyway to create an object and setting its position using 'retreive from expression' command? i know the object's position can set manually by using set x and set y commands but im gonna have multiple copies of the same object. And that means if i use set x and y, every one of the objects will be set to the same position. and even the position will vary, depending on the user's preference.
so is there anyway to create an object and setting its position using 'retreive from expression' command? cause that will make everything so much simpler than having to use spread value. and im not very good at that.
ahhh, well, i thought i had thought up of a solution.
here's wt i did. i made two variables, x and y. now these variables determine where the newly created object should go. and they work just fine. also, since theres no way, apparently, to use a get expression command when creating an object, i had to make a 'Positioner' object and set its position to var x and y, always.
then whenever i create an object, i set its x and y relative to 'Positioner' object. Now, the problem is, that var x and y changes every 20th of a second and the bloody program only creates the new objects 2 times. i tried changing the timer to 50th of a second but to no avail. it only works the first two times.
i tried using fastloop but it crashed the app. help, anyone??
OMG, i figured it out. i deleted one object from the level to see if it was becasue mmf has some memory limitation and it worked 3 times! i deleted another object and it worked 4 times. wt the hell? is there anyway to increase the max no. of objects? or will i have to resort to deleting my objects? cause i need maximum 10 of these 'newly' created objects.
MMF runs by narrowing down the selection of objects via the events on the left hand side of the list, and then applying actions to them as specified inside the grid/array. HOWEVER, some actions, such as "Create Object", will specify its control again. So whenever a create object order is issued, every action after that action that references that kind of object will ONLY reference that object. Meanwhile, any action put on the event list BEFORE the create object action, will effect all objects specified by the left-hand events.
So if you have a generic "user hits space bar" event, that doesn't specify any of your active objects, you could have these two nearly identical pieces of code:
+Upon hitting space
-Create an Object
-Object: Set X to 1000
-Object: Set Y to 1000
OR
+Upon hitting space
-Object: Set X to 1000
-Object: Set Y to 1000
-Create an Object
The first piece of code will do what you want; create 1 object and set only that instance of it to (1000,1000)
The second code, will set ALL objects already in the field to (1000,1000), then create the new object wherever.
If you want to create more then 1 instance of an object in a single piece of code, and set them to different positions according to the X/Y expressions, that may not be altogether possible. I'm not sure, but you might be able to order events in MMF2 in the event list so that you could have 1 create object command, then 1 set position, then another create object, ect. Thats not possible in TGF, as all actions from a single grid location in the queue are given the same precedence, albeit with their own mini-queue.
The best workaround, otherwise, would be to either copy/paste your piece of code several times, changing the position in each one (and making it so they all trigger in the same read/eval/print loop), OR simply putting it into a fastloop, and having the different positions be according to a mathematical equation, based upon the loop index.