Integer Madness

Ozzdog

Hopeless Toby Driver fan boy
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
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
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
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
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.
  • Jesus4Lyf Jesus4Lyf:
    Hmm, how to summarize... Moved to the USA and got married. Became a professional software engineer and solution lead. Learning Godot for game dev. :)
  • jonas jonas:
    So you are pursuing game dev as a hobby? What industry is your dayjob in?
  • jonas jonas:
    FAANG?
  • Jesus4Lyf Jesus4Lyf:
    Not quite FAANG, less pay for a less hours/stress. Yeah, game dev as a hobby.
  • jonas jonas:
    makes sense. Do we have a hobby game dev subforum to showcase some work?
  • Blackveiled Blackveiled:
    Happy Thursday
    +1
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    TGIF!
  • The Helper The Helper:
    hey tom_mai please do not archive anymore news
  • Ghan Ghan:
    AMD Ryzen 7000 next week :D
    +1
  • The Helper The Helper:
    noice!
  • tom_mai78101 tom_mai78101:
    "hey tom_mai please do not archive anymore news" ----> Got it. What should we do with the "News Archive" subforum?
  • The Helper The Helper:
    I think leave it for real old news that cannot be sorted the reason we had it in the first place was a server issue that we do not have anymore. I don't want to get rid of the archive just not put anything in it for now until we figure it out more
  • The Helper The Helper:
    The side chat has nothing on the discord. it is not possible but the biggest thing on my wish list right now is a sidechat channel on the disord that hooks up to this...
  • Ghan Ghan:
    I've been selected for the Diablo IV beta.
    +1
  • Ghan Ghan:
    Woo!
    +1
  • The Helper The Helper:
    that is so cool
  • V-SNES V-SNES:
    Eh just noticed the new discord section on the side. Looks great!
    +1
  • Blackveiled Blackveiled:
    :( feels bad I can't ever get selected for any beta I sign up for. It's annoying as heck.
    +1
  • The Helper The Helper:
    Hello mgarcia! Happy Monday everyone!
  • The Helper The Helper:
    Happy Tuesday! :)

    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