Set Position to a specific instance object

Get help using Construct 2

Post » Wed Oct 23, 2013 4:33 pm

Hello everyone,

I will try to be clear because I don' know how to explain my issue.^^

What I'm aiming to is, on Start of layout, to set the position of my Player on a specific instance object. They're several instances of that object on my layout but I can't figure out how to get the coordonnates of the one I want!

I tried to pick with a instance variable or the UID but nothing works. I read a lot of post about 'selecting a instance' but I think I don't get it....
And I would like to avoid creating a specific object for each position :(

If you have any advices in the way to do this, I would be very grateful!

CAPX example of my issue:
CapxKaMiZoTo2013-10-23 20:02:14
B
72
S
21
G
12
Posts: 314
Reputation: 12,111

Post » Wed Oct 23, 2013 4:57 pm

Picking on start of the layout is weird.
Example:
On start of layout:
-[some event that spawns a lot of sprites]
now in the same event, you can't pick those sprites you've created, no matter how you structure events/subevents.

workaround:

On start of layout:
-[some event that spawns a lot of sprites]
On start of layout:
- pick created stuff

workaround 2:
On start of layout:
-[some event that spawns a lot of sprites]
- : wait dt
call function "xyz"

and on function "xyz" called:
-pick created stuff: do stuff with it
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Wed Oct 23, 2013 6:05 pm

@mindfaQ Thank you for your answer.
But my objects are not created by code. They're already on my level design, on the layout in the editor.
They're just trigger boxes.
If I understand your proposals, it's only for created objects during the game.
Or peharps I misunderstand.
B
72
S
21
G
12
Posts: 314
Reputation: 12,111

Post » Wed Oct 23, 2013 6:11 pm

Could you post a .capx or a screenshot of how you were trying to pick?
B
11
S
2
Posts: 87
Reputation: 1,112

Post » Wed Oct 23, 2013 7:12 pm

If they are already there on your layout, you already know the coordinates and could use those directly.
Or pick by UID, I really don't know what can go wrong there except when you try to pick it in a subevent while in a parent event you've already picked other instances of these objects and the object you wanna pick is not among them.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Wed Oct 23, 2013 7:18 pm

How do you choose the specific instance where you want to put the Player? random? is there a specific condition?GamerGon2013-10-23 19:19:04
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,614

Post » Wed Oct 23, 2013 8:03 pm

I've just uploaded in my first post a link to a CAPX to show what I'm trying to do.
This is probably a simple thing to deal with but I don't get it on my own! ^^'
B
72
S
21
G
12
Posts: 314
Reputation: 12,111

Post » Wed Oct 23, 2013 8:22 pm

I know... is just that I am at work and using Linux, so I was trying to help in the meantime hahaha
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,614


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Kin, ratboy3, tinhofiel, totoe and 41 guests