My problem is that first part. I don't see any function that returns all units owned by player X. The best I can find is "Units in Region With Alliance to Player." Since the building units are not in a "region" then they are not returned by this function (at least that's my theory as to why I'm not seeing anything). Here's my code.
Variable-SetallUnitsGroup=(Unitsin(Entiremap)havingallianceAllywithplayerplayermatchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)UnitGroup-ForeachunitunitinallUnitsGroupdo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(unitisunderconstruction)==TrueThenBank-Storestring"found a unit under construction"as"key"ofsection"data"inbankplayerBankElse
If this route doesn't work, I suppose I could track the event "Unit - Any Unit construction progress is Started" and add that unit to an array (or data table - haven't played with either that much) and then check on the progress of the units in there every so often.
Thoughts?
EDIT: Took a stab at my alternate solution proposal and it seems units are not included in the Event "Any Unit construction progress is Started" and only buildings are:
EventsUnit-AnyUnitconstructionprogressisStartedLocalVariablesunitPickedName=""<String>unit=NoUnit<Unit>playerBank=NoBank<Bank>player=0<Integer>ConditionsActionsPlayerGroup-Foreachplayerplayerin(Allplayers)do(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Ownerof(Triggeringprogressunit))==playerThenVariable-SetplayerBank=productionBanksArray[player]
Variable - Set unit = (Triggering progress unit)
Variable - Set unitPickedName = (Value of Units (Unit type of unit) Name for player Any Player)
Bank - Store string unitPickedName as "key" of section "data" in bank playerBank
Bank - Save bank playerBank
Else
Looks like it's not possible to see how far along a unit is in production? Can this be true?
Hi all,
Is there any way to get the current production for a user? I'm talking about units/buildings/research as it is shown in the observer interface. This trigger would fire off every X seconds and just pull the data for the players in the player group that are currently playing. Data would be saved to a bank like:
I can imagine you might have to track buildings/units/research separately which is okay too. I've tried a few things including counting only units "Under Construction" but am unable to get any meaningful data out.
Has anyone built anything like this and can shed some light on the direction I should go in?
Ahh sorry - should've been clearer. This doesn't have to do with the Unit/Name stuff - that can easily be removed in the Editor or later on as I'm doing now.
I meant currently I write out SCV, SCV, SCV, SCV, Command Center to my bank file. Is there any way to make it so I can write out SCV 6, Command Center 1, Marines 17, etc. Right now I just write out a list of every unit.
I suppose I could do as I'm doing now, but for every unit type, get the total of that unit and write that, but then I'd still be writing N times if I have N units no?
And at the next layer in my stack (I'll share this project once it's complete), I'm able to condense this into the desired format of:
SCV : 7
CommandCenter : 1
Marine : 1
I didn't see anyway to iterate over each type of unit and write this out directly from SC2 to the bank files without doing if (Marine ) if (SCV), etc. Does anyone know if there are any optimizations between my code and the final desired product?
Cool! Thanks! Would appreciate that. I saw some code on this site for doing it for a specific unit, but doing it for every race and unit in that race seems a bit redundant, but if it's the only way I suppose it'll have to be done that way.
I am trying to get the player's army composition (e.g. 10 drones, 1 overlord, 3 larva, etc.) written out to a bank file when a new unit is created. What I have currently is pasted below. My current issue is I'm only able to get the total number of units, and I'm not able to get the unit name/identifier written out. Ideally, I'd be writing data out:
"drones" : 10
"overlord" : 1
"larva" : 3
Can anyone offer some direction on how to get this working properly? It's not critical I get the actual unit name. So long as it's some unique identifier, I can figure out what those identifiers are and then create a mapping between those and "human-readable" names farther down in my stack.
This trigger works great because I'm able to use the (Triggering player) in the Actions because the event that triggers this is a player's vespene count changes.
When I'm trying to record some attribute about the player every X seconds like APM:
I don't have a notion of (Triggering player) anymore so I'm forced to use Player 1 APM score to get the APM and then player 1 to get the bank. This will record data on Player 1's computer, but Player 2's data won't be saved unless I make another trigger or duplicate some code to also get their APM.
Is there any way around this Timer-triggered events/getting access to the player index? I don't particularly care about player indices in this case and I don't want to have 2 version of every trigger. Am I missing something obvious?
Thanks in advance for the help!
EDIT: Here's the most "concise" solution I can come up with:
I made a prototype of my design already, writing out changes to minerals, vespene, and supply to different banks. I wrote my own XML parser using Ruby. The glue from XML parsing to the audio code is all done via OSC. I went into it thinking it would be terrible, but the latency across the entire system is not terrible. That said, I'm not sure what'll happen when we have 3-4 times more bank files. :)
Gah! A bit out of my budget, but thank you for offering. I'm getting hung up most on going from triggers such as "minerals changed" to grabbing data for a particular player on a timer. Not to mention, the data isn't organized as one would expect and there is no documentation. I've tried the Galaxy Editor and recently just coding directly in the .galaxy file and using the Galaxy editor, but it's all too opaque for me to figure out right now. Hehe... oh wells! :)
And I do like your replay idea and agree that it would be technically more feasible given we can "render" performances ahead of time, but I was hoping to make this a "live" performance piece!
I've been lurking around the SC2Mapster website and forums for assistance in a project I'm working on and was wondering if someone could help me. I'm working on submitting a performance piece and the premise is that we would take a Starcraft 2 match and "sonify" it by adding sound to actions and attributes of the game. At a high-level I'd like a mod (or map with mod applied to it) that would write a bunch of data to different banks and then I'd have an XML parser parsing that data and passing it to the sound engine. Things I'm looking to capture:
every A milliseconds, write out standing army size
every B milliseconds, write out units in production
every C milliseconds, write out research production tab (could be grouped up with above production tab I suppose)
whenever a unit dies, write out to bank
every D milliseconds, write out APM
trigger - move/attack/etc - write out what units/the command/destination (e.g. 5 marines, move, 77, 233)
every E milliseconds, write out where the current player's camera is focused on (e.g. 77, 100 (main base) or 122, 100 (middle of map somewhere))
every F milliseconds, write out current economy data (minerals, gas, supply)
every G milliseconds, write out units lost for player
I was wondering if anyone would like to help. I do understand that time is valuable so if anyone is interested, we could discuss anything I might've missed and compensation. From what I gather, I'm not trying to do anything too complicated here - it just seems there is a very steep curve to getting all this stuff working! :)
Hope we can work on this together. Obviously, you would be credited in the paper/performance write-up for your contributions.
Hi all,
I'm working on a project that involves taking an existing map (2-player works) and mining data out of it into banks, which is then processed. I got a basic trigger in place that would write economy data to the bank every time minerals/vespene/supply changed, but have gotten stuck of late on getting more advanced triggers set up (mostly ones that I want to do in fixed intervals which I can't quite figure out how to do). I was wondering if anyone could help me set up the following:
- every x seconds, write out the current unit/unit count to a bank (marines:10, marauders:20, etc)
- every y seconds, write out units in production/their progress (marine:.50, marine:.25, marauder:.60)
- whenever a unit dies, add that unit to a bank that tracks the number of units killed (e.g. marines:6, marauders:2, etc)
- every z seconds, write out the APM (I suppose EPM now) to a bank
- every a seconds, write out research being upgrade and progress (this might just be done in the unit progress task above?)
- every b seconds, write out each unit and it's position on the map (e.g. marine1:201, 192, marine2:202,190, etc)
- every time a user moves a unit/group of units, write the destination to a bank
That's what I can think of off the top of my head - I might come up with more. I know this is asking a lot (or maybe, it's really easy and I'm just dumb), so I'd be willing to work out some sort of compensation for whoever can help me make this happen. If anyone is interested, please PM me and we can work out details over chat/Skype/preferred method of interwebs communication.
Hey! Thanks for the help. Very much appreciated! I have one issue though - I load your map and get these errors:
[10/1/2011 6:26:33 PM] Warning: Orphaned trigger parameter removed from Function Call 'Status Of Player' (Parameter Value, 27932CEF, Lib: 0)
[10/1/2011 6:26:33 PM] Warning: Orphaned trigger parameter removed from Function Call 'Remove Player From Player Group' (Parameter Value, E190D303, Lib: 0)
I didn't say both were playing on the same machine. I'm saying they are on the map, playing the same game against each other. I don't want to write Player B's APM to Player's A bank - I only want to write Player's A info.
Again - they are on 2 separate computers, playing against each other and I want to keep the data separate.
If I have two humans, Bob and Alice, playing on my custom map - is it now possible to identify Bob as the current player on computer A and Alyce as the player using computer B?
I'd like to get information about only Bob when Bob is playing on his computer, and the same for Alice. For example, only writing Bob's APM to an APM bankfile on Bob's computer and only writing Alice's APM to a file on her computer.
0
@BasharTeg: Go
My problem is that first part. I don't see any function that returns all units owned by player X. The best I can find is "Units in Region With Alliance to Player." Since the building units are not in a "region" then they are not returned by this function (at least that's my theory as to why I'm not seeing anything). Here's my code.
If this route doesn't work, I suppose I could track the event "Unit - Any Unit construction progress is Started" and add that unit to an array (or data table - haven't played with either that much) and then check on the progress of the units in there every so often.
Thoughts?
EDIT: Took a stab at my alternate solution proposal and it seems units are not included in the Event "Any Unit construction progress is Started" and only buildings are:
Looks like it's not possible to see how far along a unit is in production? Can this be true?
0
Hi all, Is there any way to get the current production for a user? I'm talking about units/buildings/research as it is shown in the observer interface. This trigger would fire off every X seconds and just pull the data for the players in the player group that are currently playing. Data would be saved to a bank like:
I can imagine you might have to track buildings/units/research separately which is okay too. I've tried a few things including counting only units "Under Construction" but am unable to get any meaningful data out.
Has anyone built anything like this and can shed some light on the direction I should go in?
Thanks for the help! :)
0
@willuwontu: Go
Ahh sorry - should've been clearer. This doesn't have to do with the Unit/Name stuff - that can easily be removed in the Editor or later on as I'm doing now.
I meant currently I write out SCV, SCV, SCV, SCV, Command Center to my bank file. Is there any way to make it so I can write out SCV 6, Command Center 1, Marines 17, etc. Right now I just write out a list of every unit.
I suppose I could do as I'm doing now, but for every unit type, get the total of that unit and write that, but then I'd still be writing N times if I have N units no?
0
@willuwontu: Go
Thank you thank you thank you! That worked great! For anyone who stumbles upon this later, here is my trigger to get this working:
This will write out data to the bank that looks like:
And at the next layer in my stack (I'll share this project once it's complete), I'm able to condense this into the desired format of: SCV : 7 CommandCenter : 1 Marine : 1
I didn't see anyway to iterate over each type of unit and write this out directly from SC2 to the bank files without doing if (Marine ) if (SCV), etc. Does anyone know if there are any optimizations between my code and the final desired product?
Thanks all!
0
@willuwontu: Go
Cool! Thanks! Would appreciate that. I saw some code on this site for doing it for a specific unit, but doing it for every race and unit in that race seems a bit redundant, but if it's the only way I suppose it'll have to be done that way.
0
I am trying to get the player's army composition (e.g. 10 drones, 1 overlord, 3 larva, etc.) written out to a bank file when a new unit is created. What I have currently is pasted below. My current issue is I'm only able to get the total number of units, and I'm not able to get the unit name/identifier written out. Ideally, I'd be writing data out:
"drones" : 10 "overlord" : 1 "larva" : 3
Can anyone offer some direction on how to get this working properly? It's not critical I get the actual unit name. So long as it's some unique identifier, I can figure out what those identifiers are and then create a mapping between those and "human-readable" names farther down in my stack.
Many thanks!
0
@Ahli634: Go
Thank you for the reply! I think I got the first part of your recommendation working!
What would the bank code you described look like generally? Is what I'm doing now not correct or just not recommended/standard?
Thank you!
0
Hi all! Having some problems with a 2 player map I'm working on. Here's where I'm getting stuck...
This trigger works great because I'm able to use the (Triggering player) in the Actions because the event that triggers this is a player's vespene count changes.
When I'm trying to record some attribute about the player every X seconds like APM:
I don't have a notion of (Triggering player) anymore so I'm forced to use Player 1 APM score to get the APM and then player 1 to get the bank. This will record data on Player 1's computer, but Player 2's data won't be saved unless I make another trigger or duplicate some code to also get their APM.
Is there any way around this Timer-triggered events/getting access to the player index? I don't particularly care about player indices in this case and I don't want to have 2 version of every trigger. Am I missing something obvious?
Thanks in advance for the help!
EDIT: Here's the most "concise" solution I can come up with:
Once I learn how to write share-able modules, this probably won't look to bad, but is there a better way?
0
@SouLCarveRR: Go
I made a prototype of my design already, writing out changes to minerals, vespene, and supply to different banks. I wrote my own XML parser using Ruby. The glue from XML parsing to the audio code is all done via OSC. I went into it thinking it would be terrible, but the latency across the entire system is not terrible. That said, I'm not sure what'll happen when we have 3-4 times more bank files. :)
Gah! A bit out of my budget, but thank you for offering. I'm getting hung up most on going from triggers such as "minerals changed" to grabbing data for a particular player on a timer. Not to mention, the data isn't organized as one would expect and there is no documentation. I've tried the Galaxy Editor and recently just coding directly in the .galaxy file and using the Galaxy editor, but it's all too opaque for me to figure out right now. Hehe... oh wells! :)
And I do like your replay idea and agree that it would be technically more feasible given we can "render" performances ahead of time, but I was hoping to make this a "live" performance piece!
GGs!
0
Hi all!
I've been lurking around the SC2Mapster website and forums for assistance in a project I'm working on and was wondering if someone could help me. I'm working on submitting a performance piece and the premise is that we would take a Starcraft 2 match and "sonify" it by adding sound to actions and attributes of the game. At a high-level I'd like a mod (or map with mod applied to it) that would write a bunch of data to different banks and then I'd have an XML parser parsing that data and passing it to the sound engine. Things I'm looking to capture:
I was wondering if anyone would like to help. I do understand that time is valuable so if anyone is interested, we could discuss anything I might've missed and compensation. From what I gather, I'm not trying to do anything too complicated here - it just seems there is a very steep curve to getting all this stuff working! :)
Hope we can work on this together. Obviously, you would be credited in the paper/performance write-up for your contributions.
Thanks!
0
Hi all, I'm working on a project that involves taking an existing map (2-player works) and mining data out of it into banks, which is then processed. I got a basic trigger in place that would write economy data to the bank every time minerals/vespene/supply changed, but have gotten stuck of late on getting more advanced triggers set up (mostly ones that I want to do in fixed intervals which I can't quite figure out how to do). I was wondering if anyone could help me set up the following:
- every x seconds, write out the current unit/unit count to a bank (marines:10, marauders:20, etc)
- every y seconds, write out units in production/their progress (marine:.50, marine:.25, marauder:.60)
- whenever a unit dies, add that unit to a bank that tracks the number of units killed (e.g. marines:6, marauders:2, etc)
- every z seconds, write out the APM (I suppose EPM now) to a bank
- every a seconds, write out research being upgrade and progress (this might just be done in the unit progress task above?)
- every b seconds, write out each unit and it's position on the map (e.g. marine1:201, 192, marine2:202,190, etc)
- every time a user moves a unit/group of units, write the destination to a bank
That's what I can think of off the top of my head - I might come up with more. I know this is asking a lot (or maybe, it's really easy and I'm just dumb), so I'd be willing to work out some sort of compensation for whoever can help me make this happen. If anyone is interested, please PM me and we can work out details over chat/Skype/preferred method of interwebs communication.
Thanks and have a great one! :)
0
@gerSlikey: Go
Hey! Thanks for the help. Very much appreciated! I have one issue though - I load your map and get these errors:
[10/1/2011 6:26:33 PM] Warning: Orphaned trigger parameter removed from Function Call 'Status Of Player' (Parameter Value, 27932CEF, Lib: 0) [10/1/2011 6:26:33 PM] Warning: Orphaned trigger parameter removed from Function Call 'Remove Player From Player Group' (Parameter Value, E190D303, Lib: 0)
Any idea what's going on?
Screenshot: http://cl.ly/3c0t3U1T382M0h3L1Z1d
Thanks!
0
@DogmaiSEA: Go
I didn't say both were playing on the same machine. I'm saying they are on the map, playing the same game against each other. I don't want to write Player B's APM to Player's A bank - I only want to write Player's A info.
Again - they are on 2 separate computers, playing against each other and I want to keep the data separate.
0
@DogmaiSEA: Go
Mind chiming in here then?
http://www.sc2mapster.com/forums/development/triggers/25773-retrieving-apm-for-triggering-player/#posts
Could really use some help to make this happen for a project of mine. :)
0
If I have two humans, Bob and Alice, playing on my custom map - is it now possible to identify Bob as the current player on computer A and Alyce as the player using computer B?
I'd like to get information about only Bob when Bob is playing on his computer, and the same for Alice. For example, only writing Bob's APM to an APM bankfile on Bob's computer and only writing Alice's APM to a file on her computer.