So if im not mistaken this will return the number of behaviors attached to the unit. So if I have 2 behaviors (speed, unitVeterency) this will return 2. Maybe this is not right though. Am i telling it to look in a behavior in the function parameter inBehavior? so the call would look like currSpeed = UnitBehaviorCount( myUnit, "speed"). If i just wanted to pull the current value of the speed attribute this is what i would use?
let me describe a bit more what i am trying to do. i have an attribute set on a unit called speed, as well as a veterency behavior. I am trying to retrieve the current speed value for a particular unit. so lets say i create two of this particular unit on the map, i want to make sure i am referring to the correct unit.
the function you mention with this prototype seems promising but im not really sure what is meant by entry?
string CatalogFieldValueGet ( preset catalog, string entry, string fieldPath, int player )
Also it seems like its pulling data from the data editor, but how useful would this be when i need to get the current value of speed of a particular unit?
i looked through the catalog values and im guessing that c_gameCatalogBehavior is what I want. Im not sure how this would identify a particular unit though.
the field path that I looking at using is CUnit_BehaviorArray[0]. so my function call kind of looks like this CatalogFieldValueGet ( c_gameCatalogBehavior, string entry, CUnit_BehaviorArray[0], 1 ). this obviously doesnt work, perhaps there is something I am missing about entry that lets me look at a specific unit?
Hi i failed to find any info on this. Lets say a unit has an attribute called speed. I am looking for a way to pull this information into a variable. any ideas?
i hear ya...it just seems like it should be so easy to get a one time coordinate for the mouse location. but instead its got to be this big event driven deal.. ..i just want to know where the mouse is....just one time. its 2 numbers
I actually fixed it...I found a line of code that was creating the region when it shouldn't have been created..oops! I also completely unregistered the events for all the triggers involved and only create them when they are needed. This seems to have fixed it, no more random units setting off the trigger.
@knifesmile When they enter the region they get moved to the center of the region. I have to use code since I only want the region to exist when the conditions I set are met. I create each region at point 0, 0 as you can see above. Thanks for your help though. : )
I am talking about the mouse position that is dependant on your computer. That would be perfect. It wouldn't necessarily have to concern the other players.
I have created the mouse move trigger during a special condition. I don't want it on all the time because it consumes so many resources. when its no longer needed I destroy the trigger. Now the mouse can move and the position will be different than the last known position. When the trigger is recreated the position will be totally different and anything that would rely on that position would be wrong. To get an updated position I have to not only create the trigger..but hope the mouse moves.
but isnt the mouse position already kept track of constantly? if i wanted to check on its current UI/world position during a trigger without the mouse moving it would be really nice. I imagine it like a function that you could call anywhere that would just get whatever info starcraft is using for the mouse position. I know this is probably wishful thinking..but it seems so easy I don't know why they wouldn't include it. Would this be subject to the same speed issues that an event is? It doesn't seem like it.
is there really no access to any cursor position info unless an event is triggered? Seems like there should just be mouse position available in some variable...
well the region does not always exist, The player causes the region to be created. I create it well out of the map bounds and then move it to where I need it to be. I was under the impression that this movement was instantaneous...and it doesn't seem to be the reason for error.
yes the region is moving..but I have reliably tracked its movement and it is where it is supposed to be. The event def fires when its supposed to. If all units on the map are stationary it works perfectly.
It seems that it happens everywhere..no matter how far they are. if they are moving they can fire the trigger. It happens one at a time..so I would expect that if for some reason the region was moving to this location(which im pretty sure its not) it would catch more than just one unit at a time. As I watch the debugger I can see the trigger fire for the moving units one at a time, and it moves them to the center of the region.
RegionGetCenter is the actual function name. I did run it with the debugger. What I do is I set up a group of units patrolling between two points far away from the region. Then I have another group that just stands there, they will be the group the region passes over. It works for the stationary units as I would expect..but it starts to fire the trigger for the patrolling units then as well...its really weird. If instead of patrolling the units are stationary then they do not fire the trigger.
Im using the unit enters region trigger but it seems to be getting triggered by units that are not entering the region. The weird part is that as long as the units are totally still everything works as expected. however if units are in motion they will set off the trigger even though they are not near the region. Any ideas why this would happen?
0
@Kueken531: Go
So if im not mistaken this will return the number of behaviors attached to the unit. So if I have 2 behaviors (speed, unitVeterency) this will return 2. Maybe this is not right though. Am i telling it to look in a behavior in the function parameter inBehavior? so the call would look like currSpeed = UnitBehaviorCount( myUnit, "speed"). If i just wanted to pull the current value of the speed attribute this is what i would use?
0
@Kueken531: Go
let me describe a bit more what i am trying to do. i have an attribute set on a unit called speed, as well as a veterency behavior. I am trying to retrieve the current speed value for a particular unit. so lets say i create two of this particular unit on the map, i want to make sure i am referring to the correct unit.
the function you mention with this prototype seems promising but im not really sure what is meant by entry? string CatalogFieldValueGet ( preset catalog, string entry, string fieldPath, int player )
Also it seems like its pulling data from the data editor, but how useful would this be when i need to get the current value of speed of a particular unit?
i looked through the catalog values and im guessing that c_gameCatalogBehavior is what I want. Im not sure how this would identify a particular unit though. the field path that I looking at using is CUnit_BehaviorArray[0]. so my function call kind of looks like this CatalogFieldValueGet ( c_gameCatalogBehavior, string entry, CUnit_BehaviorArray[0], 1 ). this obviously doesnt work, perhaps there is something I am missing about entry that lets me look at a specific unit?
0
Hi i failed to find any info on this. Lets say a unit has an attribute called speed. I am looking for a way to pull this information into a variable. any ideas?
0
i hear ya...it just seems like it should be so easy to get a one time coordinate for the mouse location. but instead its got to be this big event driven deal.. ..i just want to know where the mouse is....just one time. its 2 numbers
0
I actually fixed it...I found a line of code that was creating the region when it shouldn't have been created..oops! I also completely unregistered the events for all the triggers involved and only create them when they are needed. This seems to have fixed it, no more random units setting off the trigger.
@knifesmile When they enter the region they get moved to the center of the region. I have to use code since I only want the region to exist when the conditions I set are met. I create each region at point 0, 0 as you can see above. Thanks for your help though. : )
0
yes soul carver this is what I have done. the trigger that registers the mouse move event needs an up to date mouse position though...
0
I am talking about the mouse position that is dependant on your computer. That would be perfect. It wouldn't necessarily have to concern the other players.
I have created the mouse move trigger during a special condition. I don't want it on all the time because it consumes so many resources. when its no longer needed I destroy the trigger. Now the mouse can move and the position will be different than the last known position. When the trigger is recreated the position will be totally different and anything that would rely on that position would be wrong. To get an updated position I have to not only create the trigger..but hope the mouse moves.
0
but isnt the mouse position already kept track of constantly? if i wanted to check on its current UI/world position during a trigger without the mouse moving it would be really nice. I imagine it like a function that you could call anywhere that would just get whatever info starcraft is using for the mouse position. I know this is probably wishful thinking..but it seems so easy I don't know why they wouldn't include it. Would this be subject to the same speed issues that an event is? It doesn't seem like it.
0
is there really no access to any cursor position info unless an event is triggered? Seems like there should just be mouse position available in some variable...
0
well the region does not always exist, The player causes the region to be created. I create it well out of the map bounds and then move it to where I need it to be. I was under the impression that this movement was instantaneous...and it doesn't seem to be the reason for error.
the region is created with:
gv_Region = RegionCircle( Point(0,0), (gv_RegionSize));
when it is no longer needed i use:
gv_Region = null;
0
yes the region is moving..but I have reliably tracked its movement and it is where it is supposed to be. The event def fires when its supposed to. If all units on the map are stationary it works perfectly.
It seems that it happens everywhere..no matter how far they are. if they are moving they can fire the trigger. It happens one at a time..so I would expect that if for some reason the region was moving to this location(which im pretty sure its not) it would catch more than just one unit at a time. As I watch the debugger I can see the trigger fire for the moving units one at a time, and it moves them to the center of the region.
0
RegionGetCenter is the actual function name. I did run it with the debugger. What I do is I set up a group of units patrolling between two points far away from the region. Then I have another group that just stands there, they will be the group the region passes over. It works for the stationary units as I would expect..but it starts to fire the trigger for the patrolling units then as well...its really weird. If instead of patrolling the units are stationary then they do not fire the trigger.
0
no ideas?
0
Hi, here is my trigger
0
Im using the unit enters region trigger but it seems to be getting triggered by units that are not entering the region. The weird part is that as long as the units are totally still everything works as expected. however if units are in motion they will set off the trigger even though they are not near the region. Any ideas why this would happen?