The Daily Click ::. Forums ::. Klik Coding Help ::. Weird problem with MMF2
 

Post Reply  Post Oekaki 
 

Posted By Message

]Alpha[



Registered
  19/09/2003
Points
  245
14th May, 2009 at 17:45:44 -

Hi guys,
I have a big problem and I don't understand how is it possible to happen!

I'm trying to code the AI for the enemies of my game and I noticed this problem.

writing the following code...
+ Collision between Player and Enemy
+ Enemy ID = 1
= Then sub 1 to Player's HP

isnt' the same thing as writing the following?
+ Enemy ID = 1
+ Collision between Player and Enemy
= Then sub 1 to Player's HP

I mean... I always tought tha switching the condition's order does not change a thing. Am I wrong?
Because in the first example, nothing happens... while with the second example the PLayer's HP are correctly decreased.

So what could be the problem? Maybe a bug?
Somebody did experienced the same problem?

Thank you in advance!





 
All that I see is the years...

OMC

What a goofball

Registered
  21/05/2007
Points
  3309

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
14th May, 2009 at 19:37:41 -

Order of events are very important. I'm sure many many bugs that have stumped people and caused projects to not be finished could have been solved by order of events and conditions. They are both important.

As the saying goes, if it fails, heads is tails. Switch around the events and conditions and see what happens.

Edited by OMC

 

  		
  		

Mkingy



Registered
  05/07/2003
Points
  4771

Box Blue
14th May, 2009 at 20:12:35 -

Odd, i'd have thought that the first would work and not the second. I don't thinkk i'm on the same logic lines as MMF.

 
n/a

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
14th May, 2009 at 23:15:42 -

MMF2 reads the events in the order you put them, so if they're in a different order, "things" could happen.

It also makes the game faster in some cases depending on the order.

 
n/a

]Alpha[



Registered
  19/09/2003
Points
  245
15th May, 2009 at 09:09:51 -

I Knew that "collisions" condition should be put first when you check for conditions.
I also know that the order of actions is very important, but how can the conditions order be so important?

I mean...
If I have 2 apples
If I have 2 strawberries
Then I have 4 fruits

If I begin to check my strawberries first, then it would be
If I have 2 strawberries
If I have 2 apples
It does not change the fact that I still have 4 fruits.

Conditions order could be important for other reasons, but it must not make difference if I put a condition before or after another.
Am I wrong?

Edited by ]Alpha[

 
All that I see is the years...

Nuklear41

Possibly Insane

Registered
  12/01/2008
Points
  2395

VIP MemberPS3 OwnerWii Owner
15th May, 2009 at 11:42:05 -

I think the first one would be right because that is the action that causes the entire event to happen. The other way around starts with one of the conditions of the total event.

 
Image
   

Post Reply



 



Advertisement

Worth A Click