Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Replicating the binoculars bug?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Ok, that wasnt "today". Here is script anyway:
    Code:
    preventbotspec()
    {
    	while(true)
    	{
    		if(isdefined(self.pers["team"]) && self.pers["team"] == "spectator")
    		{
    			cl = self getspectatorclient();
    			if(isdefined(cl) && cl != self)
    			{
    				if(cl.isbot)
    				{
    					players = getentarray("player", "classname");
    					found = false;
    					tospec = -1;
    					for(i = 0; i < players.size; i++)
    					{
    						if(players[i] == self)
    							continue;
    						if(tospec == -1 && !players[i].isbot)
    							tospec = players[i] getentitynumber();
    						if(!found)
    						{
    							if(players[i] == cl)
    								found = true;
    						}
    						else if(!players[i].isbot)
    						{
    							tospec = i;
    							break;
    						}
    					}
    					self.spectatorclient = tospec;
    				}
    			}
    		}
    		wait .05;
    	}
    }
    requires libcod, untested code
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

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

    filthy_freak_ (3rd May 2014),kung foo man (3rd May 2014)

  3. #2
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Quote Originally Posted by IzNoGoD View Post
    Ok, that wasnt "today". Here is script anyway:
    Thanks, it's working nicely, a few problems though;

    Stops working after the first time it skips to a real player, +attack no longer works. Can't change spectators at all because of this.
    Also not sure if this would work changing spectators backwards but that might be something I can fix.
    Last edited by filthy_freak_; 3rd May 2014 at 13:29.

  4. #3
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    28
    Thanked 14 Times in 13 Posts
    Quote Originally Posted by IzNoGoD View Post
    Ok, that wasnt "today". Here is script anyway:
    Code:
    preventbotspec()
    {
    	while(true)
    	{
    		if(isdefined(self.pers["team"]) && self.pers["team"] == "spectator")
    		{
    			cl = self getspectatorclient();
    			if(isdefined(cl) && cl != self)
    			{
    				if(cl.isbot)
    				{
    					players = getentarray("player", "classname");
    					found = false;
    					tospec = -1;
    					for(i = 0; i < players.size; i++)
    					{
    						if(players[i] == self)
    							continue;
    						if(tospec == -1 && !players[i].isbot)
    							tospec = players[i] getentitynumber();
    						if(!found)
    						{
    							if(players[i] == cl)
    								found = true;
    						}
    						else if(!players[i].isbot)
    						{
    							tospec = i;
    							break;
    						}
    					}
    					self.spectatorclient = tospec;
    				}
    			}
    		}
    		wait .05;
    	}
    }
    requires libcod, untested code
    Silly question but where do you need to put this function in order to get it working?

  5. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by agribilos View Post
    Silly question but where do you need to put this function in order to get it working?
    Better to just hijack the follownext/followprev stuff in-engine.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

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

    agribilos (16th January 2021)

  7. #5
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    28
    Thanked 14 Times in 13 Posts
    Quote Originally Posted by IzNoGoD View Post
    Better to just hijack the follownext/followprev stuff in-engine.
    And how is that done? Do i have to modify the libcod source and recompile? Please guide me in the right direction.

  8. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by agribilos View Post
    And how is that done? Do i have to modify the libcod source and recompile? Please guide me in the right direction.
    look if the follownext/followprev stuff shows up in the clientcommand callback, if so, hijack it properly.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

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

    agribilos (17th January 2021)

  10. #7
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Maybe set spectateclient to undefined or something in the next frame, i dunno, never really messed with spectating
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

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

    filthy_freak_ (3rd May 2014)

  12. #8
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Quote Originally Posted by IzNoGoD View Post
    Maybe set spectateclient to undefined
    Yup that seems to have fixed it, thanks! I should be able to work the rest out.

  13. #9
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    How do the bots dont have ping 999 in your ss?

  14. #10
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Quote Originally Posted by Ni3ls View Post
    How do the bots dont have ping 999 in your ss?
    They're randomly generated.

Posting Permissions

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