• 🏆 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!

jass native SetUnitTrainProgress

Status
Not open for further replies.
Level 4
Joined
Dec 26, 2021
Messages
45
Hello,


can i get a hand on how to use the jass native SetUnitTrainProgress?


I read about this in various places but I cannot get it going.

call BlzSetUnitTrainProgress(GetEnumUnit(), 1.0)
call SetUnitTrainProgress(GetEnumUnit(), 1.0)

but neither of these work.

I tried adding declaration to my map header but also without success (Although there is room for error in this step as I have never done it before).
Appreciate the help.
 
Level 18
Joined
Mar 16, 2008
Messages
721
I don't think you need to add to map declaration. The input 1.0 means 100% training so that would need to be reduced unless you intend to make it instantly trained.

JASS:
function SetUnitTrainProgress takes unit factory, real fraction returns nothing              //Modifies the fraction completion of a unit that is currently being trained. A fraction of 1.0 causes the unit to be instantly trained. Does nothing to a factory that is not training anything.

maybe something more like this?
  • Custom Script: call SetUnitTrainProgress(GetEnumUnit(udg_barracks_variable), 0.5)
not 100% sure just trying to help since no one else responded to your post. . .
 
Status
Not open for further replies.
Top