[Trigger] wont sell!

Status
Not open for further replies.
Level 3
Joined
Sep 15, 2008
Messages
31
ok,
i've made a sell trigger
  • SellTower
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Sell Tower
      • ((Casting unit) is A structure) Equal to True
    • Actions
      • Player - Add ((Point-value of (Casting unit)) x (3 / 4)) to (Owner of (Casting unit)) Current gold
      • Unit - Remove (Casting unit) from the game
When i cast Sell Tower
it doesnt give any gold back
but it removes the tower though.
can anyone help?
 
Thy this instead of GUI arifmetic :P
Put it incustom script instead of the GUI line in yopur trigger that adds gold.

JASS:
call AdjustPlayerStateBJ( (3*GetUnitPointValue(GetTriggerUnit()))/4, GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD )
 
Its with PCs in general. All computers store is an array of bits which can be looked as as booleans. These make up numbers. With whole numbers (integers), it will always round down. In that case to 0. That is for use with the modul function or what ever it is called which returns the remainer of an integer division opperation. With reals (floating points) computers are able to represent numbers more accuratly (to so many significant figures). Thus can preform a more accurate division closer to an actual fraction. Thus by preforming a floating point calculation, the results would be more like you were after. However as they are more complex it uses more system recources to preform a floating point opperation but still computers can do millions of them per second.
 
Status
Not open for further replies.
Back
Top