• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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,206
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