Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Created objects in MMF2 randomly "sync" unwantedly, Sorry to ask another question
United States
Someguy
Posted: May 25 2008, 05:07 PM
Quote Post


and oh my god it’s YOURS
[*][*][*][*]

Group Icon
Group: Members
Posts: 4749
Member No.: 48
Joined: 13-October 03

Status: (0d) [--]


I hope that it was okay to make another help topic, I don't want to be begging people for answers... it's just, I have an object with a hand made simple gravity thing applied to it, and have it set so when it's not overlapping an object that represents a small bit of ground for it to be in walk mode, it switches a flag on to go into jump mode, and when it touches that again, it goes back into walk mode. Works fine, for the most part...

But when I have the engine generate a bunch of these objects from the same source, one per frame(or even less), with different speeds and whatnot, they like to end up syncing up, and thus having a ton of these objects walking off a cliff until the last one of a group walks off and they all act like they've stopped overlapping.

Because what code I have is small, I'll type it out, in case anyone can recognize an issue. Note that the object's name has been changed to CHAR to hide what it's for, don't want to reveal what it's for yet. Also note that the CHAR object uses a ball movement for horizontal movement, just to make it a bit easier and have less code.
QUOTE
NOTE: CHAR is the object. Flag 0 if on is the gravity flag. Alterable Value B is the current Y velocity, A is used to lower the speed it goes up/down.
1 - Start of Frame: Set object CHAR speed to Random(10)+3
[Makes the CHAR objects already placed start walking at random speeds, to help separate them]
2 - Always + Character internal flag 0 is on: Add 1 to CHAR Alterable Value A, Set CHAR Y position to Character Y + CHAR Alterable Value B
[When gravity is on, add 1 to alterable value A, and set Y position to Y + alterable value B to move according to gravity]
3 - Alterable Value A of CHAR = 4, CHAR internal flag 0 is on: Set CHAR Alterable Value A to 0, Add 1 to CHAR Alterable Value B
[When Alterable Value A reaches 4 and gravity is on, add 1 to the gravity and reset A, so it's slower]
4 - Alterable Value B of CHAR <= 0, CHAR internal flag 0 is on: Change animation sequence to Jumping
5 - Alterable Value B of CHAR > 0, CHAR internal flag 0 is on: Change animation sequence to Falling
[For animations]
6 - CHAR is NOT overlapping GROUND OBJECT, CHAR internal flag 0 is off: Set Alterable Value B of CHAR to -3, Set internal flag 0 of char on
[When it's not on the ground, turn gravity on, start off with a jump as it just walked off a cliff]
7 - CHAR is overlapping GROUND OBJECT: Set internal flag 0 of CHAR off
[When it overlaps ground, make it stop falling]
8 - Alterable Value B of CHAR > 8: Set Alterable Value B of CHAR to 8
[Keeps it from falling too fast]
9 - CHAR is overlapping GROUND OBJECT, CHAR's ball movement isn't stopped: Change animation sequence to Walking
[If it's moving on the ground, make it walk]
10 - CHAR is overlapping TURN RIGHT OBJECT: Set CHAR direction to right
11 - CHAR is overlapping TURN LEFT OBJECT: Set CHAR direction to left
[Just for changing directions]
12 - Y position of CHAR >= 200: Set alterable value B of CHAR to Random(10)*-1
[For now, if it ends up falling off of the level, make it bounce back up, randomly(to help differentiate mass amounts)
13 - CHAR internal flag 0 is off, CHAR is overlapping a backdrop: Set CHAR Y position to CHAR Y position - 1
[If it's overlapping ground, push it up out of it]
14 - Repeat while Space Bar is pressed: Create CHAR at (1,43) on Layer 1
[Hold space bar to generate mass amounts, as it's for something requiring a ton of these simple objects to move independently]


I want to show a screenshot of the area I'm testing this in... but I have a feeling it'd pretty much reveal what it is.


--------------------
-would like to borrow 800 some dollars to buy a book-
Gunpei Yokoi in Credits - is being sadly neglected, sorry :(
Refrence (details)(Design by Jay) Also available in classic(Drawn by Press Start)
ignore this [Still an Operation Sam participant]
user posted image

PMEmail PosterUsers WebsiteAOLMSN
Top
Brazil
Drezus
Posted: May 25 2008, 08:57 PM
Quote Post


ASH STARES INTO YOUR CHEEKS
[*][*]

Group Icon
Group: Members
Posts: 2236
Member No.: 2670
Joined: 15-September 06

Status: (0d) [--]


I think that every object should have it's own source for the codes, just like if it was behaviors, instead of telling them all to take information from a single source.

At least I always did that way and my game always ended going wrong somehow. So I started using behaviors.

This post has been edited by Drezus on May 25 2008, 09:02 PM


--------------------
user posted image
--------------------
user posted image

user posted image
PMEmail PosterIntegrity Messenger IMMSN
Top
United States
Xgoff
Posted: May 27 2008, 12:14 AM
Quote Post


<):|
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03

Status: (0d) [--]


so i made this according to your events and all the objects do is bounce constantly (which i assume is not what you want)

you're probably just running into object selection issues and those are usually a ***** to debug period without having the problematic app

This post has been edited by Xgoff on May 27 2008, 12:14 AM


--------------------

This post may contain original research or unverified claims.
Please disregard the above information and contact an administrator.

DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth:
DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message
DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it
DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep
DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot
this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence
NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above

QUOTE
(5:25:58 PM) Mikau: xgoff
(5:26:00 PM) Mikau: guess what
(5:26:04 PM) Xgoff: chicken butt
(5:26:09 PM) Mikau: **** you
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Retriever II
Posted: May 27 2008, 12:35 AM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


MMF has fuzzy selection logic. I only glanced through your code but I think this applies:

Objects are NOT self-referential when you expect them to be. This means that for any event which has the chance of selecting more than one instance of an object, you will not get expected results when you use the object's own alterable values in the action expression. MMF will pick ONE of the selected instacnes (typically/always the last one created) and use those values for the rest of the selected instances. The result is things sync up and you go crazy.

If you haven't learned already, then you need to learn how to spread values, so that you can loop through and uniquely identify and operate on each individual selected instance.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0534 ]   [ 15 queries used ]   [ GZIP Enabled ]   [ Server Load: 2.01 ]