Integer Madness

Ozzdog

Hopeless Toby Driver fan boy
Reaction score
65
I am making a soccer game. When the ball enters the net, the person who scored the goal gets a point as well as the team (both shown on the leaderboard). But when i test and score a goal, it gives the player who scored +2 points, as well as the team. Not cool. here are my triggers.

Scoring Trigger.

Code:
Events - Unit - A unit enters South Net <gen>

Conditions - (Entering unit) Equal to Ball 0002 <gen>
(Owner of Kicker) Equal to Player 1 (Red)

Actions - Unit - Move Ball 0002 <gen> instantly to (Center of Outta here <gen>)
Set Score[(Player number of (Owner of Kicker))] = (Score[(Player number of (Owner of Kicker))] + 1)
Set Score[1] = (Score[1] + 1)
Trigger - Run [b]Runnable[/b] <gen> (checking conditions)

here is that Runnable[b/] trigger, that refreshes the leaderboard.
Code:
Events - none

Conditions - none

Actions - Leaderboard - Change the value for Player 1 (Red) in Leader to Score[(Player number of Player 1 (Red))]
Leaderboard - Change the value for Player 2 (Blue) in Leader to Score[(Player number of Player 2 (Blue))]
Leaderboard - Change the value for Player 3 (Teal) in Leader to Score[(Player number of Player 3 (Teal))]
Leaderboard - Change the value for Player 4 (Purple) in Leader to Score[(Player number of Player 4 (Purple))]
Leaderboard - Change the value for Player 5 (Yellow) in Leader to Score[(Player number of Player 5 (Yellow))]
Leaderboard - Change the value for Player 6 (Orange) in Leader to Score[(Player number of Player 6 (Orange))]
Leaderboard - Change the value for Player 8 (Pink) in Leader to Score[1]
Leaderboard - Change the value for Player 9 (Gray) in Leader to Score[2]
Leaderboard - Change the color of the label for Player 8 (Pink) in Leader to (100.00%, 0.00%, 0.00%) with 0.00% transparency
Leaderboard - Change the color of the label for Player 9 (Gray) in Leader to (0.00%, 0.00%, 100.00%) with 0.00% transparency
Leaderboard - Change the color of the value for Player 8 (Pink) in Leader to (100.00%, 100.00%, 0.00%) with 0.00% transparency
Leaderboard - Change the color of the value for Player 9 (Gray) in Leader to (100.00%, 0.00%, 0.00%) with 100.00% transparency

looks fine to me, but wc3 disagrees (rhyme)
 
D

Demonspawn21

Guest
Leaderboard - Change the value for Player 8 (Pink) in Leader to Score[1]
Leaderboard - Change the value for Player 9 (Gray) in Leader to Score[2]


You changed the score of player red and blue twice.

And in your first trigger it only allows a score if the kicker is owned by player red which negates the purpose of having subnumbers that use the player number of a player.
 

Ozzdog

Hopeless Toby Driver fan boy
Reaction score
65
Im sorry that this "bump" is one hour sh of being 24 hours, but this is quite an important part of my map, and id really like to get the basic core functions finished. I do not understand what is wrong! I could psot my map if anyone would liek me to.
 

Sud

"[If life=Dota] I'd have quit long ago" -- Acehart
Reaction score
64
Appears to be a logic error to me. You will want to rethink how you set the scoring trigger up.

First off, the conditions. Owner of kicker can only ever be player 1. Is this correct? It looks to me that there should be more to it than that, especially if it's a multiplayer soccer game.

Especially since you further allude that the OWNER of kicker should receive the goal. In only one possibility could a point be awarded - when the OWNER is player 1 (red), so, at some level here, it looks like your condition and your actions have different intents.

Now, in the actions, it awards two points:
1 point to the scoring player (owner of kicker)
1 point to player 1 (score[1])

And of course, only player 1 can EVER score.

So there's definitely something amiss there. Maybe if you explain to me how you wish the intended functionality to work I can give you something a little more workable.
 

Ozzdog

Hopeless Toby Driver fan boy
Reaction score
65
sorry, the "owner of unit is equal to player one is a typo"

this is what it is and still doesnt work.

((Owner of Kicker) is an ally of Player 1 (Red)) Equal to True

  • Ill attach my map, it would be much easier.
 

Sud

"[If life=Dota] I'd have quit long ago" -- Acehart
Reaction score
64
Not for me, because I'm at work

You aren't by chance using Score[1] as the score for the team would you?

Because if you are Player 1 (Red) and you score a goal, not only will Score[1] receive a point, but Score[Player 1 - Red] will receive an additional point.

If Score[1] is the team score I suggest you move that to somewhere else.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top