How do I take control of another character?

Just started using Construct 2? Post your questions here

Post » Sun Jul 05, 2015 10:47 am

Message: Moonakoppi can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Hey there, it's me again :)
After an uninteresting runner I thought I might try to do something more complex and started working on this http://gyazo.com/67699e12010e60bfa776543122ce6dcc .
Now what I would like to achieve is to be able to unpin an object from the character and take control of it. I tried this http://gyazo.com/06bf67884585ff080c98e1c08ccf017d but even when I press X nothing happens.. Do you have any hints?
Then again I'm not trying to get a complete answer, maybe just an explanation on what the global idea is..

Thank you! :)
B
8
S
1
Posts: 16
Reputation: 602

Post » Mon Jul 06, 2015 8:54 am

It is very difficult to tell.

1. I guess you should disable the 8directions for Otto, not stop it.
2. Check if there are 8directions actions for the etoile ("on touch" etc)

Personally I would not be disabling/enabling the behaviour. I would use a global.variable "switch" that would tell whom to move.

On Touch -->
if switch =1 --> move Otoo
if switch = 0 --> move etoile
B
7
S
2
Posts: 68
Reputation: 645

Post » Mon Jul 06, 2015 9:14 am

Oh i see :o
I still dont have the reflex of creating new global variables yet.. Thanks! I'll try it as soon as possible :)
B
8
S
1
Posts: 16
Reputation: 602

Post » Mon Jul 06, 2015 11:13 am

tavi wrote:It is very difficult to tell.

1. I guess you should disable the 8directions for Otto, not stop it.
2. Check if there are 8directions actions for the etoile ("on touch" etc)

Personally I would not be disabling/enabling the behaviour. I would use a global.variable "switch" that would tell whom to move.

On Touch -->
if switch =1 --> move Otoo
if switch = 0 --> move etoile


I would not use a global, because this relates directly to instances and soon you have thousands of them and they exist everywhere.
I would use a instance variable. Object.selectCtrl = 0|1
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Mon Jul 06, 2015 10:51 pm

I would use global because as I understood that is the main game mechanic. Basically two main characters.

Of course, if there are a dozen of characters with similar functions - instance variables are better.
B
7
S
2
Posts: 68
Reputation: 645

Post » Mon Jul 06, 2015 11:00 pm

Depending on project size.
My opinion.
I have a general aversion to globals. :D
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Tue Jul 07, 2015 1:43 pm

I never actually used instance variables but I will try both :)
Thank you so much for the hints!
B
8
S
1
Posts: 16
Reputation: 602


Post » Fri Jul 10, 2015 12:40 pm

Message: Moonakoppi can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
I used a global variable and IT WORKS! :D http://gyazo.com/d2d785e327f80b6830c04762eb5877bb
This is what I did: http://gyazo.com/e3282f99f6078d7a2cca0b700bef83b9

Thank you SO MUCH :mrgreen:
B
8
S
1
Posts: 16
Reputation: 602

Post » Fri Jul 10, 2015 2:33 pm

Moonakoppi most welcome
B
249
S
39
G
15
Posts: 1,952
Reputation: 40,579

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest