JASS Natives / Delphi. CreateGroup(). Disconnect.

This is a discussion on JASS Natives / Delphi. CreateGroup(). Disconnect. within the Warcraft 3 Hacks, bots and tools board part of the Warcraft 3 forum category; First of all, sorry for my bad english. I am writing a Warcraft3/ DotA hack using Jass Natives and Delphi, ...

Results 1 to 3 of 3
  1. #1
    neversleep is offline Newbie
    Array
    Join Date
    Aug 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0

    JASS Natives / Delphi. CreateGroup(). Disconnect.

    First of all, sorry for my bad english.

    I am writing a Warcraft3/DotA hack using Jass Natives and Delphi, and i want to get some info about an every hero on a map.

    Here is a code:
    Code:
    procedure GetInfo;
    var
        I, Id: Integer;
        Un1t: HUnit;
        LocalPlayer, Player: HPlayer;
        Group: HGroup;
    begin
        LocalPlayer := Game_GetLocalPlayer();
    
        for I := 0 to 11 do
        begin
            Player := Game_Player(I);
            if (Player = 0) then
                Continue;
    
            Group := Game_CreateGroup();
            Game_GroupEnumUnitsOfPlayer(Group, Player, 0);
    
            while (True) do
            begin
                Un1t := Game_FirstOfGroup(Group);
                if (Un1t = 0) then
                    Break;
    
                Id := Game_GetUnitTypeId(Un1t);
                if (Game_IsHeroUnitId(Id)) then
                begin
                    Log(Format('Player: %d; Hero: %s; Life: %.2f/%.2f; Level: %d; Ally: %d', [
                        I,
                        UnitIdToStr(Id), // UnitIdToStr my own func
                        Game_GetUnitState(Un1t, UNIT_STATE_LIFE).float,
                        Game_GetUnitState(Un1t, UNIT_STATE_MAX_LIFE).float,
                        Game_GetUnitLevel(Un1t),
                        Ord(Game_GetPlayerAlliance(LocalPlayer, Player, Game_ConvertAllianceType(ALLIANCE_SHARED_VISION)))
                    ]));
                end;
                Game_GroupRemoveUnit(Group, Un1t);
            end;
            Game_DestroyGroup(Group);
        end;
    end;
    The function working fine in a single player game, but in multiplayer(LAN, PVPGN) it is causes disconnect. I found that the problem lies when calling Jass-function Game_CreateGroup. Can someone explain to me why this is happening and there is a other way?


  2. #2
    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
    You can't create synchronized handles locally in Multiplayer. This includes about every handle (unit, group, trigger etc.) but texttags.
    Providing you with foolish stuff since 2007.

  3. #3
    neversleep is offline Newbie
    Array
    Join Date
    Aug 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    Sad... Thanks for the reply.

Similar Threads

  1. [How To] Use Jass Natives In C++
    By Sosha in forum Warcraft 3 Hacks, bots and tools
    Replies: 41
    Last Post: 07-07-2017, 08:48 PM
  2. [Release] [1.26(a)] JASS Natives List by n00b32
    By Jan Ra in forum Warcraft 3 Hacks, bots and tools
    Replies: 8
    Last Post: 07-10-2015, 05:35 PM
  3. [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
  4. Need JASS Natives List of war3 1.24e
    By theboy909 in forum Warcraft 3 Hacks, bots and tools
    Replies: 0
    Last Post: 07-15-2012, 09:45 AM
  5. Calling Jass Natives
    By BullJam in forum Warcraft 3 Hacks, bots and tools
    Replies: 7
    Last Post: 02-14-2012, 09:18 AM

Posting Permissions

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