The Daily Click ::. Forums ::. Klik Coding Help ::. Differentiating between 2 of the same object
 

Post Reply  Post Oekaki 
 

Posted By Message

Ryan▫S



Registered
  25/10/2003
Points
  161
11th September, 2004 at 08:54:22 -

Ok here is the deal, I have an active object that, to differentiate between teams uses an alt.value.
BUT when the events conditions involve the object as both teams it doesnt know which one is which

eg. The Object 1 is the Red Team member, Object 2 is the Blue team member and Sensor Field is Object 1's "radar", if the enemy enters into it he notices and takes the appropriate action.
--------------------------------------------------------------
On loop "1"
+ Alterable Value of "OBJECT1" = loop index "1"
+ Alterable Value of "SENSOR FIELD" = loop index "1"
+ "OBJECT2" is overlapping "SENSOR FIELD"

= Rotate "OBJECT1" to "OBJECT2" position
--------------------------------------------------------------
But I want Object 1 and 2 to be the same active object just with a dif. value.

In other words, can I differentiate between objects, that are the same active object, by its value?
I hope you can understand this ^ Please I need to know if and how I can do this, A GAMES LIFE HANGS IN THE BALANCE!!!

Thanks in advance

 
Gah!

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
11th September, 2004 at 09:02:57 -

I don't think it's possible. Not completely sure, but I've tried and failed to find a way more than once. It's a pain in the ass.

 
n/a

Crystal Clear (H.E.S)

Possibly Insane

Registered
  06/10/2002
Points
  2548
11th September, 2004 at 09:18:29 -

Im not too sure what you mean but i once had a problem with that MMF wouldnt know which object too move i tried using flags or something but still no luck, mine was a chess style game where you click on the object too move to its designated area. but the problem was MMF didnt know which object too move so i had it when you click on the object a "Detector" would bet set to the object you clicked on and added this to my event:
Player is being overlapped by detector:
*your actions here
dont know if itll work in what you want but might give you an idea of what you can do to work around it.

 
HES homepage:
http://www.distinctiv-efair.com/heretic/studios
Crystal Clear Productions: http://www.distinctiv-efair.com/heretic/crystalclear

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
11th September, 2004 at 09:20:25 -

you could use a fastloop, for example, pick an object at random and if it's value is equal to 0, give it a value out of an array then delete that value from the array. It might work, proberbly not though.

 
My signature is never too big!!!

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
11th September, 2004 at 11:53:14 -

didn't jannis make a tutorial about this? you could have a look at that

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
11th September, 2004 at 16:30:34 -

this link will save your game:

http://www.create-games.com/article.asp?id=1082

 
www.thenatflap.co.uk

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
11th September, 2004 at 16:36:44 -

oddly enough, I almost never have this problem, only with smileycide, and that was more of a mess around projet than anything.

 
Craps, I'm an old man!

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
11th September, 2004 at 18:49:50 -

Using the "Spread Value" method might make this possible. What "Spread Value" does is that it picks the (last?) created object and gives it the value you said to spread, and then it finds the next object and it gives that value + 1, and so on and so on until all your objects have a new value. For more explanation, go here: http://jove.prohosting.com/~bumcgi/cgi-bin/BumUHSD/aoMoB4display.cgi?game=faq&id=62

 
http://www.klik-me.com

Ryan▫S



Registered
  25/10/2003
Points
  161
11th September, 2004 at 19:02:07 -

Thanks for all your help, although I dont think many of you understand what I meant to say. My game does include the fastloop "object focus" spread-value thing, but if I have 2 of the same object in the conditions section there is no way to tell the difference if the only difference is there value. I guess I will just have to take a different approach - seperate objects for team 1 and team 2. Bah!

 
Gah!

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
11th September, 2004 at 20:03:42 -

--------------------------------------------------------------
On loop "1"
+ Alterable Value of "OBJECT1" = loop index "1"
+ Alterable Value of "SENSOR FIELD" = loop index "1"
+ "OBJECT2" is overlapping "SENSOR FIELD"

= Rotate "OBJECT1" to "OBJECT2" position
--------------------------------------------------------------


It LOOKS like it should work. I'm assuming you are Always spreading a value in some alterable value for the first condition, and the same for the second condition.

However for the third condition there may be a quirk of MMF's object selection at work. Try changing it to "Sensor field" is overlapping "Object 2".

Although it seems trivial, it might actually fix it. The second condition has already told MMF which Sensor Field object to use. You haven't told it which Object 2 to use. So when you say "Is object 2 overlapping sensor field?" MMF doesn't know which object 2 to use, so it picks the first one created or something. If you change it to "Is Sensor Field overlapping Object 2?" then MMF knows which sensor field to use, and checks if that one sensor field is overlapping any of the Object 2 instances. So hopefully it all works, that way round.

Notice MMF does an internal loop there - by saying "Is Sensor Field overlapping Object 2?" MMF actually does a loop to check if it overlaps any of the Object 2 instances. Knowing how to use this properly can save a lot of work with fastloops.

By the way, the RTS object might come in handy if you're using MMF 1.5. It basically does a standard range-detection loop, but it's written in C++ so it's way faster than fastloops and collision detection.

 
- Tigerworks

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
11th September, 2004 at 20:07:20 -

Sorry, just read your last post, and to clarify: My method will only work if Object 1 and Object 2 are SEPERATE active objects. It's a limitation in MMF that you basically can't compare differant instances of the same object in an event.

 
- Tigerworks
   

Post Reply



 



Advertisement

Worth A Click