| 10-11-2004, 02:52 PM | #1 |
*sigh* what am i doing wrong? i need to update the leaderboard and it' wont increase... so here's what i have -------------------------------------Wallet--------------------------------------------------------- Events Unit - A unit comes within 256.00 of Villager (Male 2) 0160 <gen> Conditions Wallet 0161 <gen> Equal to (Item carried by (Triggering unit) of type Wallet) Actions Hero - Drop Wallet 0161 <gen> from (Triggering unit) Item - Remove Wallet 0161 <gen> Game - Display to Quest1HelperGroup the text: (Villager: Thank you so much + (Proper name of (Triggering unit))) Leaderboard - Change the value for (Owner of QuestHelper1) in Rep to ((Integer A) + 1) Quest - Mark Wallet as Completed Quest - Change the description of Wallet to Complete ----------------------------Kill Count P1---------------------------------------------------------- Events Unit - A unit Dies Conditions (Owner of (Dying unit)) Equal to Neutral Hostile (Owner of (Killing unit)) Equal to Player 1 (Red) Actions Set KillCountP1 = (KillCountP1 + 1) ---------------------------------Kill Count Max P1------------------------------------------------ Unit - A unit Dies Conditions KillCountP1 Equal to (Min(50, 100)) Actions Leaderboard - Change the value for Player 1 (Red) in Rep to ((Integer A) + 1) Game - Display to (All players) the text: Player 1 has reciev... Set KillCountP1 = 0 problem is that the leaderboard get's to 1 and doesn't change to 2 or anything higher |
| 10-11-2004, 07:28 PM | #2 |
Leaderboard - Change the value for Player 1 (Red) in Rep to ((Integer A) + 1) This is your problem. Whenever you set the value in the leaderboard, you set it to ((Integer A) + 1). Integer A is always 0 (because no loop is happening), so the value in the board is set to 1. And you use player-specific triggers. Why don't you write generic triggers? It's kind of a lot of less work. |
| 10-11-2004, 07:30 PM | #3 |
I think, instead of (Integer A), you want to use KillCountP1. That's just from a glance... it looks like there are quite likely other problems with your triggers based on the arrangement. But since you don't have any "For A" loops, Integer A is never set to anything other than 0, so of course your kills never go higher than 0+1. What's up with the maximum? What are you trying to accomplish with that? |
| 10-11-2004, 07:45 PM | #4 | |
Quote:
well i think i've tried integer a and it didn't work but let me try ![]() |
| 10-11-2004, 07:46 PM | #5 | |
Quote:
ok let me try that to and what do you mean maximum? do you mean min 50 max 100? i did that b/c it won't work without that b/c say i use an ultimate and kill 20 units at the same time then the killcountP1 is screwed up |
| 10-11-2004, 07:57 PM | #6 |
Naw, it should work fine without. You'll only need one trigger to create and show the leaderboard and another to keep it updated. The update trigger, as Anitarf suggested, can handle all the players at once instead of just Player 1. You'll be using (Owner of (Killing Unit)) to figure out which player to assign the kill to. |
| 10-11-2004, 11:39 PM | #7 |
And yea, i think you want KillCountP1 instead of integer a. Integer a is undefined right now. |
| 10-12-2004, 12:39 AM | #8 |
then it's using kill count in two triggers... right? and then when it sets kill count to 0 then all rep in leaderboard is set to 0? i'm confuzed |
| 10-12-2004, 02:54 AM | #9 |
So, do both the reputation from returning the wallet and the kill count from killing units add to the same value in the leaderboard? |
| 10-12-2004, 02:14 PM | #10 |
He wants 1 rep for every 50 creatures killed and 1 rep for the wallet to be given. This means you first need a integer variable array (so it works for multiple players) for the rep. Let's call it RepVar[]. RepVar[1] will store the reputation for player 1, RepVar[2] for player 2 etc... Then you also set up the killcount variable as an array, so you have killcount[]. Then, you need this trigger, one trigger only that works for all players: Code:
Events
Unit - A unit Dies
Conditions
(Owner of (Dying unit)) Equal to Neutral Hostile
Actions
Set KillCount[(player number of (owner of (killing unit)))] = (KillCount[(player number of (owner of (killing unit)))] + 1)
If - then - else multiple functions
if - conditions:
KillCount[(player number of (owner of (killing unit)))] greater than or equal to 50
then - actions:
set RepVar[(player number of (owner of (killing unit)))] = RepVar[(player number of (owner of (killing unit)))] + 1
set KillCount[(player number of (owner of (killing unit)))] = 0
Leaderboard - Change the value for (owner of (killing unit)) in Rep to RepVar[(player number of (owner of (killing unit)))]
Game - Display to (All players) the text: "Player " + (string(player number of(owner of (killing unit)))) + " has reciev..."
else - actions:
do nothingAnd the trigger for the wallet: Code:
Events
Unit - A unit comes within 256.00 of Villager (Male 2) 0160 <gen>
Conditions
Wallet 0161 <gen> Equal to (Item carried by (Triggering unit) of type Wallet)
Actions
Hero - Drop Wallet 0161 <gen> from (Triggering unit)
Item - Remove Wallet 0161 <gen>
Game - Display to Quest1HelperGroup the text: (Villager: Thank you so much + (Proper name of (Triggering unit)))
Set RepVar[(player number of (owner of QuestHelper1))] = RepVar[(player number of (owner of QuestHelper1))] + 1
Leaderboard - Change the value for (Owner of QuestHelper1) in Rep to RepVar[(player number of (owner of QuestHelper1))]
Quest - Mark Wallet as Completed
Quest - Change the description of Wallet to Complete |
| 10-12-2004, 07:55 PM | #11 |
wow i'm an idiot lol none of that stuff was nesicary lol thanks though all i needed was to add one to repcount1 and then do change value of rep for player 1 to repcount 1 thanks anitarf |
| 10-12-2004, 08:17 PM | #12 |
Yea, you have to remember that integer a is only used for loops and has no value anywhere else. It's only if you need to know what number you are on in your loop. |
| 10-13-2004, 12:49 AM | #13 |
thank you all the rep system is now in progress ![]() |
