I'm trying to create a map that writes a bunch of data for the current player to a bank file. I'm having some trouble retrieving stuff like APM and score-related things for players other than 1. When I get the APM, it defaults to giving me the APM of Player 1. I'm trying to set that to be the APM of the current player (however many players there are). Changing 1 to "Player property" which should return an integer for the current player, adds a bunch of stuff I don't need.
See the attached screenshot.
Running this map, I get this error:
Thanks!
EDIT: Images aren't loading properly for me. Check it out here:
It's because you're trying to retrieve "Triggering Player" from a non-matching event. Your event is every 1.0 second of the game, thus it has nothing to pull a "Triggering Player" from.
the easiest way to do that is then make 2 seperate triggers. Change them to have one saying Player 1, and another Player 2 instead of your "Triggering Player"
better way is to add those players who are playing in a group then use pick each player from that group and use picked player instead of triggering player
In your initialization, add all active players to a player group (or use active players but thats fickly with computers)
Event:
Every 1 second of game time
Actions:
Pick each player in player group (the player group you designated) and do actions
Do your 4 bank actions
Done!
If your doing apm though i suggest something better. BC that is just overwriting the APM before.
Create a new variable elapsed time in the bank, increment it by 1 for each player every second. Then do some beast arithmetic.
Import the previous APM as a variable (or directly but its sloppy) (i call this pAPM)
Import the seconds elapsed (i call this Elapsed)
Multiply pAPM by Elapsed (before incrementing seconds)
Add current APM... Divide by (Elapsed+1)
Now add it to the bank.
This takes the old average, recreates the sum that formed the average before division by terms, add a term, then finds a new average by dividing by terms + 1 (the new amount of terms).
One more question though - instead of writing all player's APMs to the bank, is it possible to only pick the player at the computer and not all players playing? I'd like to keep player's data separate in the bank.
Wow! Thanks a bunch! I especially enjoyed your interpretation of "at the computer."
That made things much easier to see an example. I'm still having some trouble though that your map doesn't address. If I have two players in your game, and both are in the "Computer" area, it prints out saying Player 1 and Player 2 are at the "Computer." I'd like to only print information for my current user. So if I am 2v2ing on this map and both of us are in the computer area, I only see "Player 1 is at the computer" assuming I am Player 1.
Is this possible?
Thanks again! :D
EDIT: I'd also like to avoid having separate banks for each player. I'm running some scripts in the background to parse any bank files that are updated, so IDEALLY, Player 1 would only ever write out Player 1 data, and so on.
EDIT 2: Essentially, I want it to do something like this. Excuse my use of what looks like a real programming language. :)
// every 1 secondfor(PlayerinAll-Players){if(Player==currentPlayerSittingAtComputer)// this is the part I need to figure out{// retrieve data for only that user, write it to the bank}}
I believe I want your first option. This is mostly an issue of data separation. Right now, I can get both players' APMs using something based off the map you wrote for me. I just want to always to ensure the data I am getting is for the current logged in user.
But I was want your second option as well. Essentially, I want both players to be writing data to the banks on their respective computers, but not each other's data.
Player A is playing Player B. Player A writes only his APM to the apmBank bank on his computer and Player B writes only his APM to the apmBank file on his computer.
Your loop will get me the data for all the users. If what you are saying is true about not being able to see which user is currently logged in, then I will be unable to do this no? :(
But even with a BattlenetID for each Player, if I can't get the BattlenetID for the logged in user, it won't be very helpful.
p.s. gg icon! I just started playing FF6. Once I play that one, I'll have played all the major non-MMORPG FFs!
Okay, maybe i understand now. You want to write only the APM of a certain to player to the players bank
Lets say (You used a PHP syntax so i will write it like this here ;) )
// $i = Count Variable// $playersPlaying = Players that are Playing + 1// $i++ = Selfexplaining// SetBankValue = Setting a value to the actual players bank// $player = Array with different player data// $player["bank"][] = Active bank of the player// $player["apm"][] = APM of the player at this momentfor ($i=1;$i<$playersPlaying;$i++) { SetBankValue( $player["bank"][$i], $player["apm"][$i]);}
And before excecuting this function you set the apm of the player ;)
Correct me if i am wrong - if this is like your idea i can do the triggers again for you :)
Getting closer. ;) I want to ONLY write the APM of the current player to the bank - no others.
Your code separates out different player's APMs into different banks, but what if I only want to do one bank-write for the current player.
Again, if Player 1 and Player 2 are playing on my map, on Player 1's computer I want to find a bank file that has only Player 1's APM, and on Player 2's computer I want to find a bank file that only has Player 2's APM.
The remaining issue for this right now is figuring out how to tell which player is the current player - how do I tell Player 1 is the "current user" playing the game on his machine as opposed to Player 2?
Once again - thanks so much. I feel like we're almost there. :)
I'm trying to create a map that writes a bunch of data for the current player to a bank file. I'm having some trouble retrieving stuff like APM and score-related things for players other than 1. When I get the APM, it defaults to giving me the APM of Player 1. I'm trying to set that to be the APM of the current player (however many players there are). Changing 1 to "Player property" which should return an integer for the current player, adds a bunch of stuff I don't need.
See the attached screenshot.
Running this map, I get this error:
Thanks!
EDIT: Images aren't loading properly for me. Check it out here:
http://cl.ly/2H2a24190K2h230E4032
http://cl.ly/283w2w1j103P0g1C221y
@marktronic: Go
It's because you're trying to retrieve "Triggering Player" from a non-matching event. Your event is every 1.0 second of the game, thus it has nothing to pull a "Triggering Player" from.
@Enexy: Go
Is there a way to say the current player in this case? That is, every 1 second write the APM of the current player to the bank file?
@marktronic: Go
What do you mean current player? Player 1 (red)? or all players?
@Enexy: Go
If 2 people are playing this custom map, I'd like for each player to only write their APM to the bank file. Is that possible?
So if you are player 1, it writes your APM out. If you are player 2 it writes your APM out.
@marktronic: Go
the easiest way to do that is then make 2 seperate triggers. Change them to have one saying Player 1, and another Player 2 instead of your "Triggering Player"
@Enexy: Go
better way is to add those players who are playing in a group then use pick each player from that group and use picked player instead of triggering player
@gamfvr: Go
That sounds like a good solution that would scale. Any help on what that would look like in the editor?
I'm going to give it a try now, but will probably fail in a bit. :)
Thanks for the help Enexy and gamfvr!
@gamfvr: Go
BUMP.
Couldn't get this working. Anyone know how I can make this work?
@marktronic: Go
In your initialization, add all active players to a player group (or use active players but thats fickly with computers)
Event: Every 1 second of game time Actions: Pick each player in player group (the player group you designated) and do actions Do your 4 bank actions Done!
If your doing apm though i suggest something better. BC that is just overwriting the APM before. Create a new variable elapsed time in the bank, increment it by 1 for each player every second. Then do some beast arithmetic.
Import the previous APM as a variable (or directly but its sloppy) (i call this pAPM) Import the seconds elapsed (i call this Elapsed) Multiply pAPM by Elapsed (before incrementing seconds) Add current APM... Divide by (Elapsed+1) Now add it to the bank.
This takes the old average, recreates the sum that formed the average before division by terms, add a term, then finds a new average by dividing by terms + 1 (the new amount of terms).
@lzravanger: Go
Thanks for the step by step! I'm excited to try!
One more question though - instead of writing all player's APMs to the bank, is it possible to only pick the player at the computer and not all players playing? I'd like to keep player's data separate in the bank.
Thanks for the help!
Here i made a little triggerwork for you ;)
@gerSlikey: Go
Wow! Thanks a bunch! I especially enjoyed your interpretation of "at the computer."
That made things much easier to see an example. I'm still having some trouble though that your map doesn't address. If I have two players in your game, and both are in the "Computer" area, it prints out saying Player 1 and Player 2 are at the "Computer." I'd like to only print information for my current user. So if I am 2v2ing on this map and both of us are in the computer area, I only see "Player 1 is at the computer" assuming I am Player 1.
Is this possible?
Thanks again! :D
EDIT: I'd also like to avoid having separate banks for each player. I'm running some scripts in the background to parse any bank files that are updated, so IDEALLY, Player 1 would only ever write out Player 1 data, and so on.
EDIT 2: Essentially, I want it to do something like this. Excuse my use of what looks like a real programming language. :)
Hey, I understand your idea two ways:
First: You just want to show the message: "Player X is at the Computer!" to Player X?
Second: You want to seperate the actions done for each player, which is at the PC.
greets
currently ... you cant tell the player that is currently logged in. It will use the bank of the Current windows user....
next patch we will be able to retrieve the players Bnet ID but not yet
@gerSlikey: Go
I believe I want your first option. This is mostly an issue of data separation. Right now, I can get both players' APMs using something based off the map you wrote for me. I just want to always to ensure the data I am getting is for the current logged in user.
But I was want your second option as well. Essentially, I want both players to be writing data to the banks on their respective computers, but not each other's data.
Player A is playing Player B. Player A writes only his APM to the apmBank bank on his computer and Player B writes only his APM to the apmBank file on his computer.
@SouLCarveRR: Go
Your loop will get me the data for all the users. If what you are saying is true about not being able to see which user is currently logged in, then I will be unable to do this no? :(
But even with a BattlenetID for each Player, if I can't get the BattlenetID for the logged in user, it won't be very helpful.
p.s. gg icon! I just started playing FF6. Once I play that one, I'll have played all the major non-MMORPG FFs!
Okay, maybe i understand now. You want to write only the APM of a certain to player to the players bank
Lets say (You used a PHP syntax so i will write it like this here ;) )
And before excecuting this function you set the apm of the player ;)
Correct me if i am wrong - if this is like your idea i can do the triggers again for you :)
greeting
@gerSlikey: Go
Getting closer. ;) I want to ONLY write the APM of the current player to the bank - no others.
Your code separates out different player's APMs into different banks, but what if I only want to do one bank-write for the current player.
Again, if Player 1 and Player 2 are playing on my map, on Player 1's computer I want to find a bank file that has only Player 1's APM, and on Player 2's computer I want to find a bank file that only has Player 2's APM.
The remaining issue for this right now is figuring out how to tell which player is the current player - how do I tell Player 1 is the "current user" playing the game on his machine as opposed to Player 2?
Once again - thanks so much. I feel like we're almost there. :)
AHH You mean his computer!!! I understood that you have a computer ingame.. -.-
This is possible with the new functions of the Patch - Look ata the 101 Sticky Post in the Triggerforum - maybe you find something usefull there ;)