• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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