How do I Change Characters Instantly?

Get help using Construct 2

Post » Thu May 18, 2017 6:34 am

Alright, so basically what I'm trying to do is make it so that the player can swap between characters with the press of a button- each of these characters are intended to have their own unique skills for puzzle solving purposes. Problem is, I'm having trouble figuring out how to switch them out. I figured it'd be a matter of destroying the current instance of the character and all other possible instances of the characters, then spawning the intended character in the same spot, but either that's incorrect or I'm going about it wrongly. Here's the .capx for anyone to look at, but as it stands I'm kind of confused.

https://www.dropbox.com/s/vl110s7nrywl5 ... .capx?dl=0

Thanks for the help in advance!
B
20
S
3
G
1
Posts: 13
Reputation: 2,218

Post » Thu May 18, 2017 2:48 pm

I played with your capx (to no avail yet)

https://www.dropbox.com/s/7o3j3igp2rqy9 ... .capx?dl=0

But this needs rethinking. The problem is that you cant set (as far as i can see) the 'Directions' and the 'Set angle' properties on runtime for the 8Directions. So if those are properties that change with the characters, i dunno at this moment.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu May 18, 2017 5:20 pm

No, everyone has the same base movement speed, and they're basically intended to swap out just like that- whatever direction or angle the player is at in that moment stays consistent.
B
20
S
3
G
1
Posts: 13
Reputation: 2,218

Post » Thu May 18, 2017 5:39 pm

You are looking for System's "Create object" and not the Sprite's "Spawn object". "Spawn object" means that the sprites in the SOL will each spawn the selected object. "Create object" will create a single instance.

However, for hotswapping between characters like this... it might be better to use a single object with multiple animations.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Thu May 18, 2017 6:28 pm

Yes a single object with different animations. That takes care of the graphical 'face'. If the characters are also defined by different instance variable value's, bringing the variables into an array will solve that. If however the characters have different 8direction properties (the used behavior), then i still have no idea yet.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: guannstar, odiusfly, tankhedgehog and 23 guests