The Daily Click ::. Forums ::. Klik Coding Help ::. Trying to get a simple game to work...but can't. Please help!
 

Post Reply  Post Oekaki 
 

Posted By Message

CBSection31



Registered
  25/05/2005
Points
  7
25th May, 2005 at 20:39:13 -

Hi everyone. I posted this at the Clickteam forums, but no one there was able to help me.

I am developing this mini-game for a much larger game (www.upforums.com/shadybrook), but I have been trying to code this for over a week, and with no success.

The concept sounds quite simple. On the screen is a grid full of different shaped pipes. There are a total of 4 different pipe Active Objects, and multiple instances of each. The player can click on a pipe to rotate it 45 degrees.

A special pipe on the left is blue. When a pipe that you rotate overlaps with this special pipe, the pipe you rotated then turns blue (by changing to a User Animation).

What I want to happen is, simply, whenever a pipe "connects" to a blue pipe, that pipe turns blue. Otherwise, the pipe stays normal (using the Stopped animation).

I have tried everything from qualifiers to loops, but I cannot get this to work properly. The problem comes in when I have to have a pipe return to the stopped animation when it is no longer overlapping a pipe that has the user animation running.

I don't think you can attach files here, so I uploaded my application as it is now.

File: www.upforums.com/carpuzzle.cca

Any help would be GREATLY appreciated! Thank you in advance for your time. If you have any questions, of course, please don't hesitate to ask me!

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
25th May, 2005 at 21:20:46 -

I think you should swap the animation switches to directional switches. It migh be easier to code. (I.e. set direction to value A * 4 - 8 directions)

 
n/a

CBSection31



Registered
  25/05/2005
Points
  7
26th May, 2005 at 05:48:22 -

Thank you very much for your fast reply! I am unsure how to do what you are describing. I define the direction for each object after the user clicks on the object. How can I use this as a condition to check whether two objects are connected (and if so, start the animation). I am already using an image for all directions used, so I can't add any with extra images. (Sorry if I sound confused, but I'm new at using Fusion.) Thanks again!

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
26th May, 2005 at 12:17:39 -

"The problem comes in when I have to have a pipe return to the stopped animation when it is no longer overlapping a pipe that has the user animation running. "

Try putting the user animation on "loop"

 
n/a

CBSection31



Registered
  25/05/2005
Points
  7
26th May, 2005 at 15:59:21 -

It is on loop already. I'm simply not sure how to tell Fusion the following statement:

If Pipe A is no longer overlapping any pipe (A, B, C, or D) that has the animation "Power" playing, then set Pipe A to Stopped.

When I put it in as the following statement, it does not work properly:

+ Pipe A overlapping Pipe B
X + Pipe B "Power" Animation is Playing
:: Set Pipe A to "Stopped"

I think it's randomly checking ANY Pipe B, not necessarily the one overlapping with Pipe A.

The other problem is that incorrect pipes are running the Power animation, due to the same issue. Fusion is randomly choosing pipes, not necessarily the ones that are overlapping.

I need to somehow create a loop that checks one pipe at a time, comparing it to every other pipe in the frame. Would that be possible? I see it as having to create two loops that act as one. One loop would be needed to check every pipe for the condition, and a second loop would be needed to compare it to every other pipe in the frame. I'm just not sure how to accomplish that.

Thanks again everyone for your replies!

 
n/a

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
26th May, 2005 at 17:48:52 -

I think that using Spread a Value and Fastloop should solve your problems here. Once again I have to admit that I'm not sure exactly how it should be done, but I think it goes something like this:

+Start of level
Spread value 1 in Value A of Pipe A
Spread value 1 in Value A of Pipe B
.
.
.

(This assigns unique values in Value A of each pipe)

+ Always
Fastloop: Start loop "Loop" for (Number of Pipe A object) cycles

+ On loop "Loop"
+ Compare two general values: Alterable Value A("Pipe A") == Alterable Value A("Pipe B")
+ Pipe A is overlapping Pipe B
Set Pipe A animation to Stopped

And so forth... I think that's just about it.

 
http://www.davidn.co.nr - Games, music, living in America

CBSection31



Registered
  25/05/2005
Points
  7
26th May, 2005 at 18:34:56 -

That's the exact programming I'm using (smart minds think alike hehe), and they change to the user animation perfectly. The problem is getting them to return to the stopped animation when they no longer connect. I have all pipes automatically set themselves back to stopped every time the player clicks on one particular pipe (thus changing the pipe directions), so theoretically it should work. But for some reason it still isn't. I was hoping someone could look at the code I have and see if I'm doing something wrong. Thanks for your reply!!!

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
26th May, 2005 at 18:50:23 -

You could try shifting the events around, like in and out of groups, shifting event order around. Whenever MMF ignores my code, thats what I do. It works most of the time, for some reason.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

CBSection31



Registered
  25/05/2005
Points
  7
26th May, 2005 at 20:22:16 -

Hmm, I'll try that. Thanks!

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
26th May, 2005 at 22:48:37 -

Hmmm, If that doesn't work I hope I make more sence this time.

Rather then using animation frames to set the direction of the pipe. Use different animation in different direction within the same animation group( in your case- Stopped).

This means that to change the animation, all you need to do is change the direction of the object.(It also means you get 32 animation frames)

The advantage of this is that you can set the individual pipes direction using an expression with it's own value of A.
(It might help to rid yourself of those horrible fastloops depending on what your doing.)

Seeing as you have the pipes with 8 directions, I suggested
using the 8 default directions within the animation to make it easier to work with. The 8 directions are: right, up-right, up, left-up, left, down-left and so on.

The direction can be changed by simply setting the value of the direcion to a number(which can be done by clicking on the '1+1' when doing a 'set direction' event.

Those 8 directions of the numbers above are 0,4,8,12,16 and 20 in that order.

Thus, by setting the value to 8, you'll set the direction of the object to up.

Hense the "set (the pipe's) direction to value A(of the pipe) x 4. -which is 8 directions.(Sorry, I didn't mean "4A-8" )

...

That was a lot longer then I intended...

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
26th May, 2005 at 22:48:43 -

Hmmm... Double post again.

Image Edited by the Author.

 
n/a

CBSection31



Registered
  25/05/2005
Points
  7
26th May, 2005 at 23:10:50 -

Thank you again! I am going to try this as soon as I finish typing here.

In the meantime, this just occurred to me:

The pipes are situated in a grid-like structure. Could I use an array, easy grid, or some other method to do the following? Because this might be easier:

Give each grid a value (0 or 1). For each grid, check if a surrounding grid's value = 1. If so, set that grid to 1. Otherwise, set to 0.

I don't know if this would be easier or not, but it might be another way of going about this.

I'll go and try your suggestion now!

 
n/a

CBSection31



Registered
  25/05/2005
Points
  7
27th May, 2005 at 00:31:18 -

Just wanted to update for everyone: I got it to work! I made each pipe object part of the good qualifier AND bad qualifier. I then added a conditional statement at the end saying:

+Always
+If qualifier.good overlapping qualifier.bad
+Qualifier.bad is Stopped
:Set qualifier.good to Stopped.

It works quite well now. Thanks again everyone for your help and suggestions!!!

 
n/a

Brian Haase (FSP)



Registered
  22/01/2005
Points
  691
27th May, 2005 at 01:31:22 -

You know what this means? It's time for somebody to make a Pipe Dreams / Pipe Works clone.

 
Current Projects:
Bomb Squad (Total Progress - 3%)
:: Current Task Progress: 40%
:: Current Task - Level Editor Shell

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
27th May, 2005 at 07:37:50 -

There are a few made already.

 
a/n

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
27th May, 2005 at 08:06:04 -

Are you gaing to add something new and exiting? (seriously)

 
n/a
   

Post Reply



 



Advertisement

Worth A Click