• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Check this out?

Status
Not open for further replies.
Level 5
Joined
Mar 17, 2005
Messages
135
Anyone tell me why this is not working? It add 100 hitpoints to the building when item is purchased. Farm_Life is set to 300 in initilization trigger. The speacial effect works but does not add 100 hit points. Sometimes I overlook something so please help me : ).

  • Hit Points
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Unit-type of (Selling unit)) Equal to The Farm
    • Actions
      • Set Farm_Life = (Farm_Life + 100)
      • Set Temp_Point = (Position of (Selling unit))
      • Unit - Set life of (Selling unit) to (Real(Farm_Life))
      • Item - Remove (Sold Item)
      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation (udg_Temp_Point)
 
Because you overwrote your old variable. You say you set variable "Farm_Life" to 300 in your init trigger. In this trigger you are trying to set a variable to match the variable you're trying to set. Which just turns it to shit... just make the actions like this.

When the item is purchased make an action that says.

  • Actions
    • Unit - Set life of (Selling unit) to (Farm_Life + 100.00)
Not sure if that is the right wording I didn't have editor up but hope you get the idea from it.
 
Level 5
Joined
Mar 17, 2005
Messages
135
Because you overwrote your old variable. You say you set variable "Farm_Life" to 300 in your init trigger. In this trigger you are trying to set a variable to match the variable you're trying to set. Which just turns it to shit... just make the actions like this.

When the item is purchased make an action that says.

  • Actions
    • Unit - Set life of (Selling unit) to (Farm_Life + 100.00)
Not sure if that is the right wording I didn't have editor up but hope you get the idea from it.

I alrdy set it to the way you did and it did not work. Yes it's supposed to reset the variable. Farm_life = 300 so what i'm doing is this. 300+100. now farm_life = 400. So the next time the item is bought it will do 400+100. Get it?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
Life and max life are not the same thing.

A unit can have a life of 1 but max life of 1000. A unit can not have a life greater than max life.

It will not work unless you eithor . . .
  • Have the units max life a large number to allow for the increase in life.
  • Add tomes of life to the building to incrase its max life.
  • Research a technology (permant and not advisable) to incrase max life of that building type.
  • Use an item ability bug to raise max life (can bug in certain conditions).
  • Use an item ability system to incrase max life in a controled way (capped but generally the most efficent for numbers supported)
 
Level 5
Joined
Mar 17, 2005
Messages
135
Life and max life are not the same thing.

A unit can have a life of 1 but max life of 1000. A unit can not have a life greater than max life.

It will not work unless you eithor . . .
  • Have the units max life a large number to allow for the increase in life.
  • Add tomes of life to the building to incrase its max life.
  • Research a technology (permant and not advisable) to incrase max life of that building type.
  • Use an item ability bug to raise max life (can bug in certain conditions).
  • Use an item ability system to incrase max life in a controled way (capped but generally the most efficent for numbers supported)



Yes thank you very much!! Thanks for getting my thoughts back on track. I see, I forgot that there was max life and life :). There should be a set max life. Thanks for help
 
Status
Not open for further replies.
Top