The Daily Click ::. Forums ::. Klik Coding Help ::. MMF object selection -.-
 

Post Reply  Post Oekaki 
 

Posted By Message

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
15th May, 2010 at 20:21:46 -

I have these objects:

a sprite (id = 1)
another sprite (id = 2)
another another sprite (id = 3)
3 hitboxes with id's 1,2 and 3


I want to have the sprite be on the hitbox if their alterable values a are the same...
This doesnt work for some reason:

(Compare two values) if alterable value a (sprite) = alterable value a (hitbox):
- set sprite position (0,0) from hitbox

heres an example:
http://www.solgryn.org

 
www.Solgryn.org

Image

Xgoff



Registered
  22/02/2009
Points
  135
15th May, 2010 at 20:56:44 -

if by "compare two values" you mean "compare two general values" that would be the problem, since it screws up object selection

you want to be using the "compare to one of the alterable values" condition since that at least keeps part of the selection

so in standard fastloop use:
[start of frame or any condition involving creating new objects/masks]
--> MainObjects - Spread Value: Alterable Value A; 0
--> Masks - Spread Value: Alterable Value A; 0

Always
--> Start Loop: "masks"; NObjects("MainObjects")

On Loop "masks"
+ Alterable Value A of "MainObjects" == Loopindex("masks") [remember, not two general values]
+ Alterable Value A of "Masks" == Loopindex("masks")
--> Masks - Set X Position: X("MainObjects")
--> Masks - Set Y Position: Y("MainObjects")


 
Image

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
15th May, 2010 at 21:29:15 -

omg forgot to link the example properly, here it is http://www.solgryn.org/Wth.mfa

 
www.Solgryn.org

Image

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
15th May, 2010 at 22:07:50 -

I think I got it working, thanks

 
www.Solgryn.org

Image

nim



Registered
  17/05/2002
Points
  7234
16th May, 2010 at 04:14:02 -

If you have the same number of objects of each type, you can just write always : object1 : "set position to object2" and by some inexplicable MMF magic it works.

 
//

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
16th May, 2010 at 04:25:27 -

Inexpicable MMF magic is pretty awesome sometimes

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Xgoff



Registered
  22/02/2009
Points
  135
16th May, 2010 at 08:29:17 -

inexplicable mmf magic also enjoys biting you in the ass while masquerading as something else

 
Image

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
16th May, 2010 at 14:26:25 -

But once you understand how the tricks are performed, then you realise it's not magic

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
   

Post Reply



 



Advertisement

Worth A Click