uid confusion

Get help using Construct 2

Post » Mon Sep 29, 2014 11:18 pm

This part works
[patol Logic] - basically - on collision set mirror = 0 when moving right - 1 if moving left <-- works perfectly

This part is borken...
Code: Select all
on creation -- enBox
- spawn object rdSlime
- set rdSlime.nestUid = enBox.UID
- set enBox.hostUid = rdSlime.UID

system - compare 2 variables (enBox.hostUid = rdSlime.nestUid
--- sub - enBox.mirror = 0
--rdSlime - set not mirrored

--- sub - enBox. mirror = 1
--rdSlime - ser mirrored


my question - how do i make a specific enBox object - choose it's specific rdSlime object - so the code I run only affects those two objects?
B
9
S
2
G
1
Posts: 36
Reputation: 1,381

Post » Tue Sep 30, 2014 12:55 am

Looks like you're not actually picking any objects. Just associating UID's is not enough. You're comparing enBox.hostUid = rdSlime.nestUid but at that moment, all enBox's and all rdSlime's are picked. Look into running a For each enBox loop around the system - compare, and inside the loop pick rdSlime by enBox.HostUid. If you had the full version, a Container would do the trick.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Tue Sep 30, 2014 3:22 am

I do own the full version - and from what I've seen of containers - they won't actually work for my purposes - unless I missed something - you can only have each object in one container, and I'm trying - failing - to make complex systems based off of a single object/family that affects a large amount of other objects...
in this case, I'm having the enBox as the only object that performs calculations, but has an assosciated enemy object pinned to it
this enemy spawned is chosen by type in an instance variable - given a roll for "elite" at run time, an left on its merry way - running w/e behavior groups the instance it spawned has set enabled

-- this means I'll only need one all-inclusive enemy sheet - witch means - I can progress...

however, it all starts with figuring how to make a specific object choose another specific object

Code: Select all
--for each enBox
-system pick by comparison -- pick rdSlime - where redSlime.nestUid = enBox.hostUid - - reversing it has no change
--- sub - enBox.mirror = 0
--rdSlime - set not mirrored

--- sub - enBox. mirror = 1
--rdSlime - ser mirrored


doesn't work =[
B
9
S
2
G
1
Posts: 36
Reputation: 1,381


Return to How do I....?

Who is online

Users browsing this forum: richcoz81 and 43 guests