character following drawn path

Get help using Construct 2

Post » Tue Feb 17, 2015 2:25 am

I have included a snapshot of what I have so far. This is just one of the many examples of what I have tried so far. I believe that the character, sprite two, is trying to find a path to multiple "line" 's. I know that the character has to find a path to the earliest "line" I know the "line" should have an instance variable. It does have one starting at zero. I had the line add "1" to the instance variable everytime a new "line" was created every tick. This did not work unfortunately. I can include the most recent capx file if necessary. This is the only part I am struggling with. After this I know how to do everything else that I am looking for. I really appreciate everyone's help. I have coded a couple games before, I just am not sure why I cannot wrap my head around this concept.
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 19
Reputation: 1,389

Post » Tue Feb 17, 2015 12:34 pm

Add second instance variable, indicating which click/touch cycle it is in.

Have a global or dedicated object var increment upon releasing mouse button or on touch end, combine with the add 1 to age, and you will have have sets of ages.

on touch/click end add 1 to global var clickcycle.

on line create, add 1 to line.age, plus set line.clickcycle to clickcycle.
Who dares wins
B
50
S
10
G
10
Posts: 1,728
Reputation: 12,875

Post » Tue Mar 03, 2015 10:03 pm

I am still having trouble. I have it where my drawn line has an instance variable. Every tick the system adds 1 to the "Age" of the instance variable. The character is still unable to find the path to the first line. I have included my capx file. I think the character needs to find a path to line.age"number". which would be the first number, on found that line would be destroyed, and he would look for the next one automatically, which would simulate following the path I have created. I just know I am missing something.
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 19
Reputation: 1,389

Post » Wed Mar 04, 2015 2:44 am

HebeinPeter wrote:I.......I just know I am missing something.


MoveTo Behavior :D
behavior-moveto_t63156?&hilit=MoveTo
Image
B
58
S
23
G
7
Posts: 1,436
Reputation: 10,551

Post » Sun Mar 08, 2015 4:51 pm

Hello again,

This is close to what I am looking for. I have installed the move to behavior, and it works, but... it is not moving to where I want. It is not following the drawn path. I believe, like everyone has been saying, it needs to involve instance variables, and I have one for the object I want the character to move to, I just don't believe it is set up right, and I am having difficulty doing that. I know it I can have it to where the character finds a path or moves to the line with the first instance variable, destroys that then looks for the next one in consecutive order, I am just having difficulty.

Thanks agian for all the help!
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 19
Reputation: 1,389

Post » Sun Mar 08, 2015 8:05 pm

Hmmm... I do a line creator, so if this character is making this line then it is attached to him (i.e. local instance PCCreator=1) then when you look for the line make sure he's only looking for his line
B
9
S
2
Posts: 54
Reputation: 638

Post » Sun Mar 08, 2015 8:06 pm

If you are then making points along that line then transfer that variable over to them and have PC search for that.
B
9
S
2
Posts: 54
Reputation: 638

Post » Sun Mar 08, 2015 9:56 pm

..........
You do not have the required permissions to view the files attached to this post.
Image
B
58
S
23
G
7
Posts: 1,436
Reputation: 10,551

Post » Mon Mar 16, 2015 3:06 pm

wow... that's great! Exactly what I needed. Sorry, the move to plug-in was new to me. I greatly appreciate it!
B
6
S
2
Posts: 19
Reputation: 1,389

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests