metroidvadian teleportation

Get help using Construct 2

Post » Sun May 11, 2014 7:10 pm

Hey all, I'm making a metroidvadian here and I figured, in order to teleport to a specific layout, I would use a sprite with a text instance variable "location". On contact, I planned to make the sprite teleport the player to wherever the instance variable is set to go to (e.g. "location" is set to "cave", therefore it will teleport the player to the layout named "cave"). However, it appears that the ampersand operator cannot be used for instance variables.

Is there some way I can use instance variables like so? If not, is there a workaround? Thanks!
B
10
S
4
Posts: 24
Reputation: 804

Post » Sun May 11, 2014 8:08 pm

What does ampersand have to do with setting the value to cave?
Unless perhaps the first part of the existing value is ca, and you are adding ve to that.
Image ImageImage
B
171
S
50
G
180
Posts: 8,395
Reputation: 113,984

Post » Mon May 12, 2014 2:22 am

@newt

Hmm, I have no idea what you're talking about, so I think I may be misunderstanding what the ampersand command is actually used for. So to clarify, is there anyway that I can use an object's instance variable IN expressions?

EDIT: I'm new to this, so the jargon escapes me. How about a picture?

Image

See, I want to use the instance variable's value (whatever it may be for the current object) there (or wherever).
B
10
S
4
Posts: 24
Reputation: 804

Post » Mon May 12, 2014 3:39 am

Sure just just reference the variable yourobject.variablename

You should do some more starter tuts if yours unsure about that part.
Its pretty basic, and will be used quite a lot.
Image ImageImage
B
171
S
50
G
180
Posts: 8,395
Reputation: 113,984

Post » Mon May 12, 2014 4:11 am

Cool, thank you.
B
10
S
4
Posts: 24
Reputation: 804


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 24 guests