Results 1 to 10 of 65

Thread: Changing map on MeatBot (CoD 2)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Well, here it is again:

    self iprintlnbold("test 01");
    only worked in Spawnplayer, like I tested earlier. It did not work in CheckTimeLimit.


    iprintlnbold("test 02");
    this one worked in CheckTimeLimit.


    So, this raises two questions:

    1) Why are the self commands not working in functions like CheckTimeLimit and EndMap?
    I have also tested another mod, the one I have in my server right now, and got the same results. There is the Renaming function, that renames "Unknown Soldier"s and "UnnamedPlayer"s, it uses self setClientCvar.
    And I'm sure all functions are being executed, because I changed the time duration of the score table in EndMap and it worked.


    2) @People who are using the change map algorithm - where exactly are you placing the algorithm, since the self commands are working?
    I tried to create a new function and tested self commands there, they didn't work.
    Does it need to be a different kind of function or what?
    Last edited by guiismiti; 16th December 2013 at 04:41.
    set logfile 2

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by guiismiti View Post
    Well, here it is again:

    self iprintlnbold("test 01");
    only worked in Spawnplayer, like I tested earlier. It did not work in CheckTimeLimit.


    iprintlnbold("test 02");
    this one worked in CheckTimeLimit.


    So, this raises two questions:

    1) Why are the self commands not working in functions like CheckTimeLimit and EndMap?
    I have also tested another mod, the one I have in my server right now, and got the same results. There is the Renaming function, that renames "Unknown Soldier"s and "UnnamedPlayer"s, it uses self setClientCvar.
    And I'm sure all functions are being executed, because I changed the time duration of the score table in EndMap and it worked.


    2) @People who are using the change map algorithm - where exactly are you placing the algorithm, since the self commands are working?
    I tried to create a new function and tested self commands there, they didn't work.
    Does it need to be a different kind of function or what?
    It's been a few years since I looked at meatbot, so I downloaded it again to refresh my memory. Here is what I found:

    The main meatbot code is controlled by callbacks situated in edited versions of the main gametype files. You can find them in [name of meatbot].iwd\maps\mp\gametypes. There are callbacks for most of the main functions, such as spawnplayer, killedplayer, endmap, etc, etc, threaded to the main meatbot file mbot\_meatbot.gsc. Both checktimlimit and checkscorelimit thread to endMap(), which in turn threads to mbot\_meatbot::endMap(). Checktimelimit is a level function. Therefore, any use of "self" as representing a player would be invalid. If you looked in your console log file, you would undoubtedly have seen an "undefined is not an entity", indicating that you were attempting to use "self" for a player, where no player was represented. You need to learn this essential difference, if you are ever going to be successful at COD scripting: level is never "self".

    As for where to place the change map algorithm (which actually it isn't - it's a kickplayers/reconnect function), add it in the meatbot endMap() function, after the check for supported maps.
    Last edited by Tally; 16th December 2013 at 08:11.

  3. The Following 2 Users Say Thank You to Tally For This Useful Post:

    guiismiti (16th December 2013),kung foo man (16th December 2013)

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
  •