The Daily Click ::. Forums ::. Klik Coding Help ::. Linking one object with another
 

Post Reply  Post Oekaki 
 

Posted By Message

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
1st January, 2005 at 17:15:58 -

How do you make one object out of a group follow a different object of a group? What I mean is, if there are 100 A objects and 100 B objects, I want each A object with 1 individual B object. I've tried to spread a value in both objects and do something like
Value A("A") = Value B("B") --> Set position of A at B(0,0)
but it always goes to only one B object. Can anyone help me with this?

 
http://www.klik-me.com

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
1st January, 2005 at 18:21:34 -

+Always
: Set position of object A to 0,0 from object B

will assign one object A to each object B.

Regarding why your method didn't work: http://www.clickteam.info/kb/start/index.php?showtopic=43

 
- Tigerworks

Ben Berntsen



Registered
  06/08/2003
Points
  103
1st January, 2005 at 21:20:07 -

Getting the objects to link to each other reliably is very difficult... What do you need it for? Maybe there is another way you can accomplish it.

 
Last time I had lobster, it reminded me of biology class. Except in biology class the professor didn't make you eat the frog when you were finished.

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
1st January, 2005 at 22:38:02 -

Enemy AI (so I don't have to make multiple detectors) and a shadows (so I don't have to make multiple shadows and lights).
Edit: It sets the positions easily, but how do you calculations with it (i.e. if you wanted to calculate its size)?

Image Edited by the Author.

 
http://www.klik-me.com

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
2nd January, 2005 at 10:13:42 -

Calculations with what? Size of what?

 
- Tigerworks

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
2nd January, 2005 at 12:12:07 -

Here's a nice tip. I once gave each enemy a shadow as a separate object, and managed to get them to link together very reliably. Here's what I did:

Upon the creation of the enemy (or the start of the frame, if the enemy is already there), create a shadow at 0,0(or whichever co-ordinates you want) from the enemy. Then, if a shadow is overlapping an enemy, set the shadow's position to 0,0(or whichever co-ordinates you want, again) from the enemy. This worked absolutely flawlessly for me, providing the shadow will always overlap the enemy.

The only problems with this method are:

If you wish the enemy to jump, obviously it would have to no longer overlap it's shadow. There are ways around this, the best one being to create a jump animation which leaves a blank space below the enemy down to where the shadow would be and either draw a single pixel which would be hard to see(black is usuall best since it will mostly blend in with the shadow), or to have that blank space and give it box detection(switch fine detection off).

Sometimes things go a bit screwed up if the enemy is off screen, so the best thing to do is either to change it's memory settings or to literally make a little bit of code so it instantly stops moving once it's off the screen.

 
http://www.fzgames.com

jast



Registered
  03/01/2014 01:12:19
Points
  186
2nd January, 2005 at 12:29:32 -

I 100% solved that problem for EG2... Gimme a few hours and you'll find an article that explains how on KM. I'll post the link here then

 
n/a

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
2nd January, 2005 at 13:13:24 -

Tigerworks: Setting the size of each Alpha Channel Object, and calculating the angle between one shadow and one light source.

 
http://www.klik-me.com

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
2nd January, 2005 at 13:41:56 -

Well you can always fastloop through the objects. The article I linked to explains how to do that.

 
- Tigerworks

jast



Registered
  03/01/2014 01:12:19
Points
  186
2nd January, 2005 at 16:35:42 -

Now that I read your post again, I think it isn't really what you need :-/... I focused mainly on dummies that don't need to be visible. Nonetheless, here's the article:

http://www.klik-me.com/KMv2/article.asp?id=17

Hope that helps you a bit.

Image Edited by the Author.

 
n/a

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
2nd January, 2005 at 17:16:06 -

Tigerworks: I tried doing what the article said but the shadows just became enormous and oddly shaped, and I couldn't open the download that came with it (and I ahve the Direction Calculator).

 
http://www.klik-me.com
   

Post Reply



 



Advertisement

Worth A Click