How do I

Get help using Construct 2

Post » Wed Mar 15, 2017 3:47 pm

Hi. I need some help with my character selection.
what happens is that i have a main charater in display on level 1 layout (destroyed on layout start). that character (and all of them) are moving with touch, so when i touch its position is where i touch and if a drag the finger, the main character follow my finger.
the problem comes when i have several characters (1,2,3...) to choose. i made a global variable with so many values, each value is a character, but now, how do i spawn once the character i selected where i touch? because meanwhile the global variable is 2 for example, (because i selected that character), it's a non stop character selected spawning, every where i touch it creates a character and when finger moves it leaves a path full of the character i selected.
how can i make it work like the main character?
i thought of putting every single characetr on level one and then destoy them on layout start, but wouldnt it take ages to load that level? there are like 50 characters to choose..
how can i fix this. help-
B
5
Posts: 31
Reputation: 291

Post » Wed Mar 15, 2017 4:42 pm

i do not understand very much
but what i understand is
you want to spawn single character from multiple and each one has a number
and you have problem, when you want spawn single character only once, Character is spawning multiple time
so if i am right
Then it seems like you are doing a mistake like
when global variable =2 then spawn character 2
this is the problem because character will be spawn every time until you change global variable
so to fix this you have to do is
> When global variable =2
Trigger once while true | Spawn Character 2

I hope it helped
Image
B
72
S
42
G
48
Posts: 688
Reputation: 34,392

Post » Wed Mar 15, 2017 4:54 pm

luckyrawatlucky wrote:i do not understand very much
but what i understand is
you want to spawn single character from multiple and each one has a number
and you have problem, when you want spawn single character only once, Character is spawning multiple time
so if i am right
Then it seems like you are doing a mistake like
when global variable =2 then spawn character 2
this is the problem because character will be spawn every time until you change global variable
so to fix this you have to do is
> When global variable =2
Trigger once while true | Spawn Character 2

I hope it helped

do i attach trigger once while true with the global variable in the same box (under ir, but in the same Y point) or do i make it a subevent?
what about the touch movement? shoul i put a new event with its proper movement or all goes inside global variable box?
B
5
Posts: 31
Reputation: 291

Post » Wed Mar 15, 2017 5:03 pm

I am also not quite sure what exactly you mean, but If you are using Touch I would Place the Characters only with "On Tap" Action and following with "On Hold". In that case you would only spawn when you tap the display, and not while holding....?
When you just begin learning this Stuff, don't make big things. Start Small.
B
9
S
2
G
1
Posts: 29
Reputation: 1,077

Post » Wed Mar 15, 2017 5:30 pm

luckyrawatlucky wrote:i do not understand very much
but what i understand is
you want to spawn single character from multiple and each one has a number
and you have problem, when you want spawn single character only once, Character is spawning multiple time
so if i am right
Then it seems like you are doing a mistake like
when global variable =2 then spawn character 2
this is the problem because character will be spawn every time until you change global variable
so to fix this you have to do is
> When global variable =2
Trigger once while true | Spawn Character 2

I hope it helped

@luckyrawatlucky also i want once i remove my finger, to leave the character on my last touch point until i touch again, so when i touch it destroys last character.
B
5
Posts: 31
Reputation: 291

Post » Wed Mar 15, 2017 7:06 pm

please explain clearly
do you want to keep character at your last touch point or you want to delete it
Image
B
72
S
42
G
48
Posts: 688
Reputation: 34,392

Post » Wed Mar 15, 2017 7:13 pm

luckyrawatlucky wrote:please explain clearly
do you want to keep character at your last touch point or you want to delete it

i want to keep it on my last touch point until i touch again, so when i touch again the one that was on my last touch position gets deleted and a new one appears on my new touch point.
B
5
Posts: 31
Reputation: 291

Post » Wed Mar 15, 2017 7:22 pm

Can you give us a capx ? it would help !
B
4
Posts: 10
Reputation: 220

Post » Wed Mar 15, 2017 7:53 pm

Message: JohnnyBeGood can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
AkiraBoy wrote:Can you give us a capx ? it would help !

@luckyrawatlucky
@Divivor
@AkiraBoy
www.mediafire.com/file/uxv96s6sfff1jr4/example.capx
example here, enjoy and help
http://www.mediafire.com/file/uxv96 s6sfff1jr4/example.capx
B
5
Posts: 31
Reputation: 291

Post » Wed Mar 15, 2017 8:20 pm

You just need to add :
On "Touch" :
Player.Destroy
System create object(Player) on layer 0 at (touch.X,touch.Y)

And keep :
On "Is in touch": Player set player position

I think that is what you want, but i'm not sure, tell me ;)
B
4
Posts: 10
Reputation: 220

Next

Return to How do I....?

Who is online

Users browsing this forum: VValt and 23 guests