but since OwnerName and OwnerID didn't return anything (unless it's a conversion problem), my way of going by it was to log a GameID + BuildingPart.Location in DataStore like so:
Python:
def On_BuildingUpdate(self, be):
builder = be.Builder.Name
if be.BuildingPart.Health == 0: #the first hit with hammer, the BP has 0 health
bpLoc = be.BuildingPart.Location
DataStore.Add("bPart_Data", builder.GameID, bpLoc)
Server.Broadcast("On_BuildingUpdate ADDED" + str(be.BuildingPart.Health) + " by " + builder)
Then later:
Python:
def On_BuildingPartAttacked(self, bhe):
if DataStore.ContainsValue("nPart_Data", bhe.Victim.Location)
You get your build GameID and can compare it to the person hitting it.
Problem is till the frame reaches lvl1, it can decay and we would still have the entry in the DataStore, so finding a way to detect level 1, THEN saving the BP in the DataStore would be better.
but since OwnerName and OwnerID didn't return anything (unless it's a conversion problem), my way of going by it was to log a GameID + BuildingPart.Location in DataStore like so:
but since OwnerName and OwnerID didn't return anything (unless it's a conversion problem), my way of going by it was to log a GameID + BuildingPart.Location in DataStore like so:
Python:
def On_BuildingUpdate(self, be):
builder = be.Builder.Name
if be.BuildingPart.Health == 0: #the first hit with hammer, the BP has 0 health
bpLoc = be.BuildingPart.Location
DataStore.Add("bPart_Data", builder.GameID, bpLoc)
Server.Broadcast("On_BuildingUpdate ADDED" + str(be.BuildingPart.Health) + " by " + builder)
Then later:
Python:
def On_BuildingPartAttacked(self, bhe):
if DataStore.ContainsValue("nPart_Data", bhe.Victim.Location)
You get your build GameID and can compare it to the person hitting it.
Problem is till the frame reaches lvl1, it can decay and we would still have the entry in the DataStore, so finding a way to detect level 1, THEN saving the BP in the DataStore would be better.
ah yeah at the time, I didn't want to have to check with every hammer hit, but check Hp is the same lol.. it was LATE last night...
As far as location, it seems 2 pieces can not be at the same space from my tests (I believe it gives us the origin of the block, so it's unique and can be gotten when destroying it to find who built it)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.