How do I set up a simple job assignment interface?

Get help using Construct 2

Post » Tue May 27, 2014 10:34 pm

Hello all, I am trying to create a touch game in which touching/clicking on various open job location sprites will assign a worker to that location. The job sprite instances have a boolean instance variable called Occupied. When the player clicks on an Un-Occupied job, it will become Occupied and change animation frames to show that the empty space is now occupied. The player only has 4 workers to use to assign to any of the 6 jobs, so I have a Global variable called JobsAssigned which keeps track of the number of workers assigned and that updates the WorkerCounter sprite to show the player how many workers he still has available.

I have this part working but I also want the player to be able to unassign a worker from a job and have the WorkerCounter and JobsAssigned update as expected.

I have tried this a bunch of ways and I think I may not fully understand how the touch object works or how sub-events resolve themselves. And yes, I have read the manual entries. ;) Please help!

The .capx is attached but you can also download it here: https://dl.dropboxusercontent.com/u/636 ... eeded.capx

Thanks for any guidance or corrected .capx you can provide.
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
1
Posts: 23
Reputation: 1,615

Post » Tue May 27, 2014 11:05 pm

Here is your file edited. This is what I did to make it work:

1 - removed the "not occupied" condition and set it to an else event. This means anytime the previous event fails, the else triggers.
2 - As a bonus, I combined all 4 of your set worker animation events into a single event.

Hope that gets you what you need and good luck with your project.

p.s. I didn't really look too hard into why the "not occupied" event failed.
You do not have the required permissions to view the files attached to this post.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712

Post » Tue May 27, 2014 11:40 pm

THANK YOU FRAGFATHER!!!!!! I have been stuck on this for days and I'm trying to make something for the Newgrounds Future 2030 game jam. Thanks for the extra event saving tips too! This C2 community has the best people in it!
B
11
S
3
G
1
Posts: 23
Reputation: 1,615


Return to How do I....?

Who is online

Users browsing this forum: apalm1341, blissfulwizard and 17 guests