Page 5 of 6

Re: Pong Tournament

PostPosted: Tue Apr 17, 2012 5:12 am
by Hblade
Here's my entry! :D
viewtopic.php?f=4&t=11870

I worked really uber hard on it so please test it and rate it ^^

Re: Pong Tournament

PostPosted: Tue Apr 17, 2012 11:37 am
by NightOfHorror
okay, can't wait to play. ^^ Great job on working on that H.

But if RedScore is less than ten, RedPoint would still equal one, so RedPoint would equal one with one Red still having less than ten points and PongPoint should equal zero at the end.

Re: Pong Tournament

PostPosted: Tue Apr 17, 2012 1:32 pm
by Hblade
=D

Re: Pong Tournament

PostPosted: Tue Apr 17, 2012 1:49 pm
by skydereign
NightOfHorror wrote:But if RedScore is less than ten, RedPoint would still equal one, so RedPoint would equal one with one Red still having less than ten points and PongPoint should equal zero at the end.

So you can guarantee that your if statement is triggering? There are very easy ways to tell. One is to to have a text actor display those two variables.
text_actor -> Draw Actor -> Script Editor
Code: Select all
sprintf(text, "RedPoint: %d\nPongPoint: %d", RedPoint, PongPoint);


If the actor never displays 1 and a 0, then your if statement will never trigger. The other is to put some code that would prove that the if statement triggered within the if. Normally view movement would work, but try something like ExitGame, or changing the color of something on screen.

Re: Pong Tournament

PostPosted: Tue Apr 17, 2012 8:13 pm
by NightOfHorror
very good points. I thought of doing the first thing and forgot about it. Thank you for your help as always, and may I ask if you are still wanting to enter.

Re: Pong Tournament

PostPosted: Tue Apr 17, 2012 9:14 pm
by SuperSonic
Hey, who do I PM for my score? :)

Re: Pong Tournament

PostPosted: Tue Apr 17, 2012 9:56 pm
by NightOfHorror
so far, only you and master are judges. You must decide by the two of you who is master judge unless another judge comes in that would rather be master judge.

Re: Pong Tournament

PostPosted: Tue Apr 17, 2012 9:58 pm
by NightOfHorror
Found out my problem, PongPoint--;
For some reason it is only taking player into account. I checked with some tips Sky said, and it subtracts PongPoint only when whoever player is, loses, or otherwise, their point equals zero. So if I am red and yellow gets ten points therefore making YellowPoint=0, PongPoint won't subtract.

Re: Pong Tournament

PostPosted: Wed Apr 18, 2012 1:21 am
by Hblade
var--; never works good with cloned actors :) Unless it's set as a user variable, and even so, try doing something like this
Code: Select all
if(cloneindex==0) //assuming 0 is player or something
{
    PongPoint--;
}

Re: Pong Tournament

PostPosted: Wed Apr 18, 2012 2:14 am
by NightOfHorror
There are no cloned actors, and what does cloneindex do. Especially since I don't introduce Red, Yellow, Blue, or BrownPoint.

Re: Pong Tournament

PostPosted: Wed Apr 18, 2012 2:33 am
by skydereign
Every actor has an actor name, and all clones share the same name. But, there needs to be a way to tell the different clones apart. To do this each clone is given a unique cloneindex, which is just an integer value. The first clone is given a cloneindex of 0, the next is given 1, and so on. Every actor also has a clonename which takes the form name.cloneindex. So Hblade's code makes it so only the clone.0 or first clone would trigger that code. If you want to target a specific clone you have to use its clonename.
Code: Select all
DestroyActor("enemy.1"); // this destroys the second clone enemy.1

Re: Pong Tournament

PostPosted: Wed Apr 18, 2012 2:44 am
by NightOfHorror
Kind of useful thing to know for later on. :D

Re: Pong Tournament

PostPosted: Wed Apr 18, 2012 9:14 pm
by NightOfHorror
Anybody know how I can make it where not only the player gets a PongPoint gone if they lose?

Re: Pong Tournament

PostPosted: Wed Apr 18, 2012 9:18 pm
by skydereign
You make it sound like PongPoint is an actor variable. If so, why is it? If you want it to go down for every paddle when someone loses, then it should be global. Using a global variable means every actor accesses the same value, which sounds like that is what you want.

Re: Pong Tournament

PostPosted: Wed Apr 18, 2012 9:35 pm
by NightOfHorror
it is a global variable.