Page 4 of 7 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 65

Thread: Changing map on MeatBot (CoD 2)

  1. #31
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Re-get the players-array after the wait 10 or your serv might still crash.
    Edit: also your bots might be in the players-array, you should filter them out because they cant execclientcmd

  2. The Following User Says Thank You to IzNoGoD For This Useful Post:

    guiismiti (17th December 2013)

  3. #32
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Will do it.
    Will also take care of the fact that the game cannot end while there are no players in the server, or the commands will never be executed and map will never rotate. I'm gonna use "thread function" that will contain an infinite loop to manage the values of scr_tdm_timelimit and scorelimit.
    Last edited by guiismiti; 17th December 2013 at 12:09.
    set logfile 2

  4. #33
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Ok, and here it is, the function to adjust TDM time limit and score limit:

    Call it from main:

    Code:
    	level thread antiStop();
    and here it is, very simple:

    Code:
    antiStop()
    {
    	for(;;)
    	{
    		players = getentarray("player", "classname");
    		if(players.size > 8)
    		{
    			setCvar("scr_tdm_timelimit", "20");
    			setCvar("scr_tdm_scorelimit", "200");
    		}
    		else
    		{
    			setCvar("scr_tdm_timelimit", "0");
    			setCvar("scr_tdm_scorelimit", "0");
    		}
    	wait 1;
    	}
    }
    Keep in mind that "8", from the first conditional test, is the number of bots in my server.
    set logfile 2

  5. #34
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Please make your code more universal. Add .isbot = true; for bots, then check all players for isdefined(player.isbot)&&player.isbot. If not true, count++. If !count, set limits.

  6. #35
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Code:
    players[i] thread execClientCommand("rcon login temprcon;rcon exec kill.cfg;wait 300;reconnect");
    I think IzNoGoD mentioned, but not sure, you need to add a failsafe in-case executing this line fails

    It will mess up the server if the player it selects to execute the command has disconnected/crashed or has a menu open that cannot be closed easily server-side (Main menu for example).

    I have been using this exact method to change map on my mbot server for the past 3-4 months and it works well.

    If you want to see it in action, visit; 46.38.48.39:28960

  7. The Following User Says Thank You to filthy_freak_ For This Useful Post:

    guiismiti (18th December 2013)

  8. #36
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Will check it, thanks
    set logfile 2

  9. #37
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    For anybody who is still interested, I'm finishing my mod (probably today). Took me so long because I had to do waypoints for 5 custom maps, it takes a lot of time.
    Anyway, I'm implementing new configurations improving the codes. I will post the complete working MeatBot mod for dedicated servers in the Modding section as soon as I have it.
    Will also post the waypoints for the custom maps I created - not perfect but will save a lot of work.
    set logfile 2

  10. The Following 3 Users Say Thank You to guiismiti For This Useful Post:

    Jeta1 (2nd February 2015),kung foo man (24th December 2013),Ni3ls (24th December 2013)

  11. #38
    ... connecting Jeta1's Avatar
    Join Date
    Feb 2015
    Location
    West Michigan
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thank you for this, I have your mod running on my server for days now with meatbots in rotation. One question, I was using your mbot file to integrate into the AWE 3.4.2, I have everything running and rotating just fine, but the bots have no weapons. I know the mbot folder could sit in the server, or the client file because it makes no difference, seems it's not being called from anywhere. Originally I placed it in the (client - maps/mp) folder, but same issue. I recently put the folder in the server side maps/mp folder, because that is the directory the tdm.gsc is in (server - maps/mp/gametypes) . Any quick thoughts? I thought about precache the mbot weapons in the main _weapons.gsc.
    Thanks for your work, I have added your name to the :updated by: scrolling in the server.
    TnT Jeta1

  12. #39
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I advise you to put the tdm.gsc file from meatbot side by side with the original tdm.gsc from CoD 1.3 and copy every single change to the tdm.gsc of AWE, so you can merge both mods.
    set logfile 2

  13. #40
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by guiismiti View Post
    I advise you to put the tdm.gsc file from meatbot side by side with the original tdm.gsc from CoD 1.3 and copy every single change to the tdm.gsc of AWE, so you can merge both mods.
    Having been a member of the AWE development team, I can tell you that there are only 4 lines of code in the gametype files for AWE. The mBots would get their weapons from _weapons.gsc. That's the right place to look. Remember to preache their weapons and give them the default animation weapon to begin with when they first spawn.

    EDIT - I just had a look at meatbot - it has its own version of each gametype. So, remember to look in there as well.

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
  •