• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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?
 
Level 9
Joined
Apr 3, 2008
Messages
700
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 )
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
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.
Top