Results 1 to 6 of 6

Thread: some questions about addtestclient() in COD1

  1. #1
    Private
    Join Date
    Mar 2016
    Posts
    18
    Thanks
    0
    Thanked 2 Times in 1 Post

    Question some questions about addtestclient() in COD1

    hello,

    i'm experimenting with COD1 1.4 / COD1:UO 1.51 and the Meatbot v0.2 sources. i've noticed that it's not possible to modify cvars on the test clients (i.e. references obtained via addtestclient()).

    for instance the following doesn't work:
    PHP Code:
    // called each time a player spawns
    spawnPlayer()
    {
        
    // snip
        // ... some code here
        
    self thread _TestCommands();
    }

    _TestCommands()
    {
        
    self endon("death");
        
    self endon("disconnect");
        
    self endon("spectate");

        
    self setClientCVar("name""RandomName" randomInt(99));

        
    wait 4;
        while (
    1) {
            
    wait 0.5;
            
    self setClientCVar("cl_run""0"); // ADS
        
    }

    the above example shows that when a client spawns in the game he is forced in "ADS" (aim down the sight) mode and is given a random name. it works for human players, but not for the bots.

    is there a way to set such things for the test clients?
    if you don't have the answer, do you know where i can ask the questions that i have?
    (the meabot author isn't responding).

    cheers

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    For cod2+libcod, theres a renamebot() function. Make something similar for cod1.

    I know filthyfreak is using some movement-modifying code for his bots, which sets certain movement bits every client frame
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by IzNoGoD View Post
    For cod2+libcod, theres a renamebot() function. Make something similar for cod1.
    Renamebot was renamed to renameclient, because it could be used on players too.
    See gsc_player_renameclient in:
    https://github.com/kungfooman/libcod...gsc_player.cpp

  4. #4
    Private
    Join Date
    Mar 2016
    Posts
    18
    Thanks
    0
    Thanked 2 Times in 1 Post
    thanks for the responses,

    changing the names is a nice-to-have. the ADS is the bigger issue here, since without it the bots are quite useless at aiming. the question is why can't we set cvars for the addtestclient()'s.

    i have checked libcod, but i'm on windows. i see that it targets linux binaries and quickly browsing the source reveals dlfcn.h, which is the POSIX way of doing address space mapping.

    i'm getting the notion that it's probably not possible to modify the ADS state of the test clients in COD1 via the bundled / exposed GSC API, so i may have to do something similar to what libcod is doing...or i should probably setup a linux server, but then most of the users would not be able to setup the bots locally - i.e. in the lines of "just download and unzip to play".
    Last edited by lobolmart; 29th March 2016 at 11:27.

  5. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    try codextended.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. #6
    Private
    Join Date
    Mar 2016
    Posts
    18
    Thanks
    0
    Thanked 2 Times in 1 Post
    alright, thanks.
    i was able to build the 1.5 version of coextended, which is a promising start.

    but i may give up due to the involvement of back-porting to 1.4.

Tags for this Thread

Posting Permissions

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