Thread Rating:
  • 3 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
G2O - Client Side Bots(0.0.4)
#1
Functions list 
Code:
createNpc(name, instance);
destroyNpc(instance);
setAdditionalVisualsNpc(npc_pointer, bodyModel, bodyTextureID, headModel, headTextureID);
setPositionNpc(npc_pointer, x, y, z);
getPositionNpc(npc_pointer);
setAngleNpc(npc_pointer, angle);
getAngleNpc(npc_pointer);

setLvlNpc(npc_instance, value);
getLvlNpc(npc_instance);
setMagicLvlNpc(npc_instance, value);
getMagicLvlNpc(npc_instance);
setWeaponSkillNpc(npc_instance, index, value);
getWeaponSkillNpc(npc_instance, index);
setStrengthNpc(npc_instance, value);
getStrengthNpc(npc_instance);
setDexterityNpc(npc_instance, value);
getDexterityNpc(HSQUIRRELVM vm)
setHealthNpc(npc_instance, value);
getHealthNpc(npc_instance);
setMaxHealthNpc(npc_instance, value);
getMaxHealthNpc(npc_instance);
setManaNpc(npc_instance, value);
getManaNpc(npc_instance);
setMaxManaNpc(npc_instance, value);
getMaxManaNpc(npc_instance);

equipArmorNpc(npc_pointer, instance);
unEquipArmorNpc(npc_pointer);
equipMeleeWeaponNpc(npc_pointer, instance);
unEquipMeleeWeaponNpc(npc_pointer);
equipRangedWeaponNpc(npc_pointer, instance);
unEquipRangedWeaponNpc(npc_pointer);
useItemNpc(npc_pointer, instance);

playAnimNpc(npc_pointer, anim);
stopAnimNpc(npc_pointer);
playFaceAnimNpc(npc_pointer, anim);
stopFaceAnimNpc(npc_pointer);

setWeaponModeNpc(npc_pointer, value);
attackRangeWeaponNpc(npc_pointer, enemy_pointer);
attackMeleeWeaponNpc(npc_pointer, enemy_pointer, combination);
attackMagicNpc(npc_pointer, enemy_pointer);

getFocusNpc(pointer);
getPointerNpc(name);
getAmountNpc();

onHitNpc(npc_instance, damage); - callback


Sync code - packetId
Code:
/*///////////////////
    Author: Kimior
    Date: 2016.05.31
    Last update: 2016.10.02
    
    For: Gothic Online - Kimior 2016
/*///////////////////

enum botPacketId {
    createBot,                 // 0
    destroyBot,             // 1
    respawnBot,             // 2
    visualBot,                 // 3
    positionBot,             // 4
    angleBot,                 // 5
    lvlBot,                 // 6
    magicLvlBot,             // 7
    weaponSkillBot,         // 8
    strengthBot,             // 9
    dexterityBot,             // 10
    healthBot,                 // 11
    maxHealthBot,             // 12
    manaBot,                 // 13
    maxManaBot,             // 14
    equipArmorBot,             // 15
    unEquipArmorBot,         // 16
    equipMeleeWeaponBot,     // 17
    unEquipMeleeWeaponBot,     // 18
    equipRangedWeaponBot,     // 19
    unEquipRangedWeaponBot, // 20
    useItemBot,             // 21
    playAnimBot,             // 22
    stopAnimBot,             // 23
    playFaceAnimBot,         // 24
    stopFaceAnimBot,         // 25
    setWeaponModeBot,         // 26
    attackRangedWeaponBot,     // 27
    attackMeleeWeaponBot,    // 28
    attackMagicBot,         // 29
    wallInFrontBot,         // 30
    focusBot,                 // 31
    syncFocus,                 // 32
    syncUpdater,             // 33
};


Sync code - clientSide 


Sync code - serverSide


Screens 
[Image: 3rsqFnQ.jpg]

[Image: 0avkhjl.jpg]

[Image: ES9P5XA.jpg]


Video


Download 
Reply
#2
Any ideas for new features?
Reply
#3
(01.10.2016, 22:13)KimiorV Wrote: Any ideas for new features?
Server side bots.
Reply
#4
- Its .dll format so should it work on linux?
- Will be released version for linux?
Reply
#5
@up This module is client side only.
Reply
#6
So if it is client side only, can i call client functions from server?
Reply
#7
Yes, using packets.
Reply
#8
If you write sync code.
Reply
#9
So I cant use CallClientFunc? I must use SendPacket only? Can u give me any tutorial how to send correct packets for example to create a bot?

Sorry but I am not on high level of programming here.
Reply
#10
Code:
    // Server
    enum packId {
        packetBot,
    };
    
    function createBot(pid, botName) {
        local packet = Packet();
        if(packet) {
            packet.writeChar(packId.packetBot);    
            packet.writeString(botName);    
            
            packet.send(pid, RELIABLE_ORDERED);
        }            
    };
    
    // Client
    enum packId {
        packetBot,
    };
    
    addEventHandler("onPacket", function(packet) {
        local id = packet.readChar();
        if(id == packId.packetBot) {
            local npc = createNpc(packet.readString(), "PC_HERO");
            setPositionNpc(npc, 0, 200, 0);
        }
    });
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [G2O] SpeedBlock Marbar 14 1,032 25.06.2020, 11:14
Last Post: Marbar
  [New G2O][Client-Side] LocalStorage Patrix 0 420 08.05.2020, 15:38
Last Post: Patrix
  [New G2O] Module example Patrix 4 3,877 17.05.2019, 00:30
Last Post: Patrix
  [New G2O][Client-Side] Clipboard Patrix 7 4,857 07.02.2019, 00:45
Last Post: Patrix
  [New G2O][Client-Side] Music Module Nubzior 3 2,744 24.05.2018, 07:07
Last Post: Nubzior
  [DEV] G2O Bot module Sative 64 29,127 25.11.2016, 19:13
Last Post: HammelGammel
  G2O Client side bots KimiorV 4 2,609 09.06.2016, 19:11
Last Post: KimiorV

Forum Jump:


Users browsing this thread: 1 Guest(s)