Hello every1, my first post ;D
im getting crazy trying to make something here on mmf, I tryed many ways possibles but none worked...
what am trying to do is make a single creature have their own "object_location" that moves and then after the movement the creature moves smoothly to the location, it works with just one creature but when I add another creature all messes up and don't work how it should..
here is the code, whats im doing wrong?
I'll post an image to make it faster:
I had a similar problem awhile ago with active objects. I'm not sure if the problem is legit or just my imagination, but I am making an application originally based on counters and active objects. The counters would affect how the objects wouldd behave and display....and everything seemed to work just fine but after so many active objects were placed within the frame....the events assigned to them no longer worked. I ended up having to make the active objects but have each object load images from outside the application instead and this solved my problem (so far). It seemed to me that the way I had coded the application, the more active objects I had the slower the app would run (I have dozens of active objects....each animation had 8 directions, each direction had about 60 frames). After so many placed it stopped using the behaviors I placed in them.
While I do not know what type of objects you're using, nor how many of them you are using at one time....I treated the active object like the active picture object. This may indeed have nothing whatsoever to do with your snippet of code though
Originally Posted by Don Luciano I have looked shortly throught your code and it seems you do not select objects properly.
You should use a fastloop and spread value to loop through all the objects.
thanks for reply
how exacly should I do that?
in this code, with only 1 creature in the frame, it walks ok and everything works fine, but when I add another creature it starts the problems, the red squares walk at the same ways where in this case it should have his own 'AI' each one...
Like this:
on start of frame or whatever
unit Spread value 0 in value A
spread value and start loop must be separate events...
start loop "create"
on loop "create"
unit value A = loopindex "create"
unit flag 0 off?
-set unit flag 0 on
-create red block
-set red value A to fixed value of unit
With this you will attach both unit and red, so you can select them later when doing conditions and actions like shown below.
start loop "actions"
on loop "actions"
unit value A = loopindex "actions" - this selects unit
red value A = unit fixed value - this selects that unit's red
put any condition now you want
-and do actions
"
If you want always to check for creating new units then rename both loops into actions, otherwise you should put create loop into a group of events, cause it's not very good to have two loops running at the same time.
There is also a lot of articles about fastloops, you might read that to understand better what they do.
Originally Posted by Don Luciano Like this:
on start of frame or whatever
unit Spread value 0 in value A
spread value and start loop must be separate events...
start loop "create"
on loop "create"
unit value A = loopindex "create"
unit flag 0 off?
-set unit flag 0 on
-create red block
-set red value A to fixed value of unit
With this you will attach both unit and red, so you can select them later when doing conditions and actions like shown below.
start loop "actions"
on loop "actions"
unit value A = loopindex "actions" - this selects unit
red value A = unit fixed value - this selects that unit's red
put any condition now you want
-and do actions
"
If you want always to check for creating new units then rename both loops into actions, otherwise you should put create loop into a group of events, cause it's not very good to have two loops running at the same time.
There is also a lot of articles about fastloops, you might read that to understand better what they do.
thanks again and this really seems to work from what i saw.. but u said it isn't good many loops running in the same time, im planning im doing a mmo so there ill be like 200+ creatures around the frame... I think this is going to get crazy haha
should it still work "okay" with those many loops?
or should I try a diferent way without loops? if it's even possible?
Depends mostly on how you code it, but 200+ objects shouldn't be a problem.
Try to have only one loop going at a time.
like always start loop "main" 200 times.
but you shouldn't have more than one loop running at the same time... like start loop "a" start loop "b", start loop "c"... etc, and loops that you need to run only once or not often should be in group a of events that you disable after the loop is done.