objects interacting with object

For questions about using Classic.

Post » Thu Sep 18, 2008 12:23 am

that would probably work. but how do i get it to move onto the next?
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Thu Sep 18, 2008 12:57 am

in that cap, in the "on function" events, the second condition says:
"Sprite value 'Follow' = Function.Param(1)-1"
that -1 at the end is what you'd be changing in the loop, it corresponds to how many in front it wants to follow, this is the condition which picks the object it's meant to be following, so you'd check the one with follow=Function.Param(1)-1, if that's not in the group go onto Function.Param(1)-2 etc
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Thu Sep 18, 2008 1:07 am

so i,d make a variable to represent the -1,-2,-3 ext. such as if Function.Param(1)-variable(dog) = 0 add 1 to variable (dog).
or is there an expressions that dose that?
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Thu Sep 18, 2008 1:28 am

In fact, I don't think you need a loop at all
give the sprites another value called something like 'Team'

Add another parameter (after the other one) to each of the functions, and set it to 'Team'

Then make the functions:

On function
+sprite value 'Team'=Function.Param(2)
+sprite value 'Follow'<Function.Param(1)
+pick with highest value 'Follow'

That should work, then only the ones in their own team will follow eachother, and they'll follow the next highest value
so if red team 3,6,8,9 and blue team 1,2,4,5,7,.

9 follows 8 follows 6 follows 3 which doesn't follow anything (so you'd set it to)
7 follows 5 etc
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Thu Sep 18, 2008 1:42 am

Yay faggatron ! your a genius!

wow.... that sounds pretty messed up....




I'm not being sarcastic. seriously thanks. was really racking my brain on that one. :)
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Thu Sep 18, 2008 9:42 am

If you need to select two objects that are of the same family type in such a manner that you can apply an action to one object and a different action to the other, one work around is to use families because they have separate Selected Object Lists.

This example you click an object, it turns white, and all the objects overlapping the object you clicked turn green, and all the objects that are overlapping green become blue..and its all done with one action :P
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Thu Sep 18, 2008 1:59 pm

thats cool.
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests