Gothic Online Forums
G2O - Client Side Bots(0.0.4) - Printable Version

+- Gothic Online Forums (https://archive.gothic-online.com)
+-- Forum: Scripting (English) (https://archive.gothic-online.com/forum-11.html)
+--- Forum: Resources (https://archive.gothic-online.com/forum-14.html)
+---- Forum: Modules (https://archive.gothic-online.com/forum-32.html)
+---- Thread: G2O - Client Side Bots(0.0.4) (/thread-1834.html)

Pages: 1 2


G2O - Client Side Bots(0.0.4) - KimiorV - 01.10.2016

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 



RE: G2O - Client Side Bots(0.0.4) - KimiorV - 01.10.2016

Any ideas for new features?


RE: G2O - Client Side Bots(0.0.4) - Bimbol - 01.10.2016

(01.10.2016, 23:13)KimiorV Wrote: Any ideas for new features?
Server side bots.


RE: G2O - Client Side Bots(0.0.4) - Mattwell - 16.11.2016

- Its .dll format so should it work on linux?
- Will be released version for linux?


RE: G2O - Client Side Bots(0.0.4) - Bimbol - 16.11.2016

@up This module is client side only.


RE: G2O - Client Side Bots(0.0.4) - Mattwell - 16.11.2016

So if it is client side only, can i call client functions from server?


RE: G2O - Client Side Bots(0.0.4) - Bimbol - 16.11.2016

Yes, using packets.


RE: G2O - Client Side Bots(0.0.4) - KimiorV - 16.11.2016

If you write sync code.


RE: G2O - Client Side Bots(0.0.4) - Mattwell - 16.11.2016

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.


RE: G2O - Client Side Bots(0.0.4) - KimiorV - 16.11.2016

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);
        }
    });