[Source] Get value of jass variable on set

This is a discussion on [Source] Get value of jass variable on set within the Warcraft 3 Hacks, bots and tools board part of the Warcraft 3 forum category; Originally Posted by DarkSupremo it works... just need use that way: declare the states: enum UNIT_STATE { UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE, UNIT_STATE_MANA ...

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
  1. #11
    NosFTW is offline Wannabe Member
    Array
    Join Date
    Dec 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    11
    Quote Originally Posted by DarkSupremo View Post
    it works... just need use that way:

    declare the states:

    enum UNIT_STATE
    {
    UNIT_STATE_LIFE,
    UNIT_STATE_MAX_LIFE,
    UNIT_STATE_MANA ,
    UNIT_STATE_MAX_MANA
    };

    to get current life:
    CJass::GetUnitState(unitId, CJass::ConvertUnitState(UNIT_STATE_LIFE));

    to get max life:
    CJass::GetUnitState(unitId, CJass::ConvertUnitState(UNIT_STATE_MAX_LIFE));

    to get
    current mana:
    CJass::GetUnitState(unitId, CJass::ConvertUnitState(UNIT_STATE_MANA ));

    to get max mana:
    CJass::GetUnitState(unitId, CJass::ConvertUnitState(UNIT_STATE_MAX_MANA));


    the unit states is just that:
    UNIT_STATE_LIFE = 0
    UNIT_STATE_MAX_LIFE = 1
    UNIT_STATE_MANA = 2
    UNIT_STATE_MAX_MANA = 3
    creating handles wouldnt cause a desync?:p because thats what ConvertUnitState does


  2. #12
    DarkSupremo is offline Premium Member
    Array
    Join Date
    Feb 2008
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    13
    Reputation
    606
    already tested it on multi player and worked fine...

  3. #13
    NosFTW is offline Wannabe Member
    Array
    Join Date
    Dec 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    11
    Quote Originally Posted by DarkSupremo View Post
    already tested it on multi player and worked fine...
    probably the handle is not send to others then :p

  4. #14
    YourName's Avatar
    YourName is offline THE ONE AND ONLY DARK KNIGHTY


    Array
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    1,553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    16
    Reputation
    1088
    Quote Originally Posted by NosFTW View Post
    probably the handle is not send to others then :p
    Some handles are handled locally, like texttags for example.
    Providing you with foolish stuff since 2007.

  5. #15
    nemo0305 is offline Addict
    Array
    Join Date
    Sep 2011
    Location
    VietNam
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    7
    Reputation
    3
    ok i've test it. It so good NosFTW do you know what trigger command local unit to attack another unit ???

  6. #16
    NosFTW is offline Wannabe Member
    Array
    Join Date
    Dec 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    11
    Quote Originally Posted by nemo0305 View Post
    ok i've test it. It so good NosFTW do you know what trigger command local unit to attack another unit ???
    make a CJassString with value "attack" (without quotes ofc) and pass it as order
    IssueTargetOrder(HUNIT whichUnit, CJassString *order, HWIDGET targetWidget);

    there is a way with order id also but i dont have the ids around
    IssueTargetOrderById(HUNIT whichUnit, int order, HWIDGET targetWidget);

    as targetWidget a unit handle can be passed normaly
    Last edited by NosFTW; 05-06-2012 at 12:43 PM.

  7. #17
    DarkSupremo is offline Premium Member
    Array
    Join Date
    Feb 2008
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    13
    Reputation
    606
    widget is everything that have hp

  8. #18
    nemo0305 is offline Addict
    Array
    Join Date
    Sep 2011
    Location
    VietNam
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    7
    Reputation
    3
    @-) I still don't know where is CJassString ??? It's JassStringData (in your old thread) or what

  9. #19
    NosFTW is offline Wannabe Member
    Array
    Join Date
    Dec 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    11
    Quote Originally Posted by nemo0305 View Post
    @-) I still don't know where is CJassString ??? It's JassStringData (in your old thread) or what
    its JassString from this thread
    http://www.d3scene.com/forum/warcraf...t-buttons.html
    i just rename it to CJassString

  10. #20
    nemo0305 is offline Addict
    Array
    Join Date
    Sep 2011
    Location
    VietNam
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    7
    Reputation
    3
    just need some jass will help us to control local unit attack other unit has HP under 20% (done - Thanks DS)

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [Source] Jass natives class
    By NosFTW in forum Warcraft 3 Hacks, bots and tools
    Replies: 10
    Last Post: 03-12-2014, 05:43 AM
  2. [Tut] Calling JASS Natives - RCString (how to pass JASS Strings to functions)
    By Jan Ra in forum Warcraft 3 Hacks, bots and tools
    Replies: 10
    Last Post: 06-14-2013, 11:04 AM
  3. [Release+Source=C++] Generate FULL JASS Natives List (Work to all war3 versions)
    By DarkSupremo in forum Warcraft 3 Hacks, bots and tools
    Replies: 37
    Last Post: 05-31-2012, 08:30 PM
  4. [Tut] JASS
    By risker in forum Warcraft 3 Custom Maps
    Replies: 1
    Last Post: 11-29-2008, 05:51 PM
  5. Jass???
    By Megmaconqueror in forum Warcraft 3 forum
    Replies: 2
    Last Post: 03-10-2008, 05:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •