Jump to content

Aciz

Members
  • Posts

    38
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Aciz

  1. Been a while, but I was finally able to reproduce this bug: It was an issue in our custom vote LUA. Voting sniper, panzer or riflewar changed g_dropammo to "0", but voting back normal game didn't change it back to "2" (which is the value we use). So not a bug with the mod, just a error in our LUA :)

  2. Hmm. Do you have Lua scripts running that can change cvars? If it is that consistent, it really starts to sound like a cvar thing. When it happens next time, please use rcon to check the values of g_dropAmmo and g_tossDistance. Those are the only cvars that affect the ammo pack dropping.

    Will do that, thanks. Also got confirmation today that the ammo drop happens on real players as well, not just bots. Still unsure about the class change thing.

  3. Do they make class switching? That is the only thing that could make sense for this bug at the moment. Also, does this happen only on bots or also on humans?

     

    EDIT:

    Please re-check the g_dropAmmo setting. It happened twice in a row in the last clip and it seems very unlikely for that to be random condition.

     

    Don't know if it happens with human players as well, I'll ask about it. Also need to take a look at the class switching, can't really see it from the demo.

     

    With random condition I meant that we cant figure out when it happens, but when it does, it's persistent for the whole map, doesn't just happen on individual kills.

  4. http://www.youtube.com/watch?v=5HngfhRmRWw

     

    So here are few examples of this bug. If you want the demos, I can upload them as well.

     

     

    After seeing these, I thought it might have something to do with fun modes we have on server (botwar, double jump etc) but one player reported this happening on normal game as well (the one from where I posted the server log from at the OP), so I'm guessing that's not be the issue.

     

     

    Maybe the shooted-guy has made a "play dead" ?

     

     

    Cannot be since bots dont use playdead :P

  5. I have neer seen this happen. Are you sure they were not close to a wall or something and the packs went through it? Also, if the body is gibbed to pieces they don't drop ammo.

     

    As I said I haven't seen this happen myself, but I've asked about gibbed bodies, and I've been told that it happens when you shoot someone normally. Also I wouldn't think that you could play a whole map and always kill a filed ops so that the ammo drops inside a wall. I'm gonna ask people to record demo of it happening, to see it myself as well.

  6. Hi, recently I've been getting a strange bug on our server. Sometimes, field ops don't drop ammo when they die, even though server has g_dropAmmo "2". I haven't encountered this myself, but several players have reported this problem. At first I thought it might have something to do with server reaching max entities, but since this happened few days ago on 3v3 game, I highly doubt it's that. The players who have reported this haven't been able to replicate the issue, it appears to be completely random. Sometimes it's persistent for a map, sometimes few maps.  Any idea what might cause this?

     

    Here is a server log from a game on Transmitter, where one of our players reported that no ammo was dropped (censored some sensitive information).

     

    http://pastebin.com/tkFA5AaN

  7.  

    You could add the admin level to the passed arguments to the function:

    function CheckCommand(clientNum, level, arguments)
        if( arguments[0] == "!mycommand" ) then
    	et.trap_SendServerCommand(clientNum, "chat \"Your command "..arguments[0].." has been received\"")
    	return 1
        end
    
        return 0
    end
    
    function et_ClientCommand(clientNum, command)
        local level = et.G_shrubbot_level(clientNum)
        local flood = et.ClientIsFlooding(clientNum)
    
        -- we're not interested if the level is too low or if the client is flooding
        if (level < 1) or (flood == 1) then
            return 0
        end
    	
        local arg0 = string.lower(et.trap_Argv(0))
        local arguments
    
        -- check to see if the command was given through any of the chat methods or as sparse text from the console
        if arg0 == "say" or arg0 == "say_team" or arg0 == "say_buddy" or arg0 == "say_teamnl" then
    	arguments = SplitToArguments(et.trap_Argv(1))
        else
    	arguments = SplitToArguments(et.ConcatArgs(0))
        end
    
        -- actual command handling
        return CheckCommand(clientNum, level, arguments)
    end
    

     Or you can declare the variable as close to its intended use as possible. This style is generally preferred when programming:

    function CheckCommand(clientNum, arguments)
        local level = et.G_shrubbot_level(clientNum)
        if( (arguments[0] == "!mycommand") and (level >= 1) ) then
    	et.trap_SendServerCommand(clientNum, "chat \"Your command "..arguments[0].." has been received\"")
    	return 1
        end
    
        return 0
    end
    
    function et_ClientCommand(clientNum, command)
        local flood = et.ClientIsFlooding(clientNum)
    
        -- we're not interested if the client is flooding
        if flood == 1 then
            return 0
        end
    	
        local arg0 = string.lower(et.trap_Argv(0))
        local arguments
    
        -- check to see if the command was given through any of the chat methods or as sparse text from the console
        if arg0 == "say" or arg0 == "say_team" or arg0 == "say_buddy" or arg0 == "say_teamnl" then
    	arguments = SplitToArguments(et.trap_Argv(1))
        else
    	arguments = SplitToArguments(et.ConcatArgs(0))
        end
    
        -- actual command handling
        return CheckCommand(clientNum, arguments)
    end
    

    Thanks again for your help and patience with my very limited LUA skills  :P the 2nd option seems like the way to go for me  :)

  8. Can you tell me what is wrong with using the split function in the Wiki example?

     

    Nothing, it's actually working perfect for me :) just tried to get it to work with string.find because it would be less complex to edit the current LUA to work like that :) Thank you!

     

    Edit: actually looking more to it, how would I go on doing different commands for different levels in this LUA? Since the commands are defined in CheckCommand while admin level is in et_ClientCommand.

  9.  

    you have not, string.match() is returning substring instead of position thats the problem.

    if level >= 1 and flood == 0 then
    	if arg0 == "say" or arg0 == "say_team" or arg0 == "say_buddy" or arg0 == "say_teamnl" then
    		if string.find(arg1, "!example") == 1 then	-- if string is looking like that "!examplebabababala" then it will return anyway position, just in case it check for position '1' to avoid situation like that "bababa!examplehaha" because string.find will return position inside that string of a match
    			et.G_globalSound("path/to/example.wav")
    		end
    	end
    end

     

    Thank you, I got one step closer! Now it won't work anymore if I type blabla!example. However it still works with !exampleblabla, how could I work that out?

  10. I don't see how string.find helps me here... I get exactly same results as I would with string.match :S 

     

    Maybe I'm blind but I cant find edit button...

     

     

    Anyway Sol, could you give me a working example with string.find?

     

     

    Btw if it does matter, the way I originally made sounds 

    (arg1 == "!example") then
                                        et.G_globalSound("path/to/example.wav");
    

    if I type the command in console, it will work just they way I want it (e.g. I can type !example blabla and it plays sound, but cant do !exampleblabla or blabla!example).

  11. OK, no effect in the current game, but the next time the player will connect, he will have the forced 'com_hunkMegs' value. Am I right or no please ?

     

    If he shuts down ET & and has defined his own hunkMegs value in his own config, it won't work. But if he just reconnects, it will.

  12.  

    Just try to use string.find in your case that would work

    string.find(arg1, "!example") -- if there is a !example command inside then function will always return value different than nil
    -- string.match() is a kinda different function, it's designed for patterns especially, in your case it should be "(!example.*)" but this function will always return string
    

     

    I don't see how string.find helps me here... I get exactly same results as I would with string.match :S 

  13. No I meant that the client is sending the say text inside quotes. I.e. /say "text with spaces". That makes the server interpret the full string as one parameter. So you should split the parameter using space as a delimiter and so you get what you need.

     

    Hmm, still don't know if I fully understand what you mean (excuse my noobish skills with LUA ^^). Could you maybe give me example?

  14. I haven't checekd, but I think your issue in this case is that the text in the say command is coming as quoted. That makes it treated as one argument i.e. trap_Argv behaves similar to ConcatArgs. So you should probably split the arg1 and use the first word from it.

     

    Removing the quotes makes the whole LUA stop working.

  15. I'm trying to create funsounds with shrubbot-like commands for my server with LUA. Currently, I have this code and it's working:

        function et_ClientCommand(clientNum, command)
                local arg0 = string.lower(et.trap_Argv(0))
                local arg1 = string.lower(et.trap_Argv(1))
                local level = et.G_shrubbot_level(clientNum)
    			local flood = et.ClientIsFlooding(clientNum)
    
    if (level >= 1) and (flood == 0) then
                        if arg0 == "say" or arg0 == "say_team" or arg0 == "say_buddy" or arg0 == "say_teamnl" then
                                (arg1 == "!example") then
                                        et.G_globalSound("path/to/example.wav");
    

    However there is one issue: if you type in anything after you do !example, the command won't work. So I tried this:

        function et_ClientCommand(clientNum, command)
                local arg0 = string.lower(et.trap_Argv(0))
                local arg1 = string.lower(et.trap_Argv(1))
                local level = et.G_shrubbot_level(clientNum)
    			local flood = et.ClientIsFlooding(clientNum) 
    
               if (level >= 1) and (flood == 0) then
                        if arg0 == "say" or arg0 == "say_team" or arg0 == "say_buddy" or arg0 == "say_teamnl" then
                                if (string.match(arg1, "!example%s?")) then
                                        et.G_globalSound("path/to/example.wav");
    

     

    Now, if I didn't completely misunderstand string.match patterns, %s? should mean that there can be space after string, but it's optional. However, ET reads it so that there can be ANY character, but it's optional. So with this code, you can do !exampleblabla, and the command still works. Also, you don't have to type it as the first thing, it can be in the middle of typing aswell (e.g. blabla !example)

     

    So here's how I would like the script to work:

     

     

    1. !example has to be the first thing you write.

    2. You can type anything after it, as long as it's separated with space. So basically:

    !example - works

    !example<space> - works

    !example blabla - works

    !exampleblabla - doesn't work

    blabla !example - doesn't work

×
×
  • Create New...