1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Faction walk/run speed assistance [Fixed]

Discussion in 'Programming' started by Tomo742, Jun 11, 2014.

  1. Tomo742

    Tomo742 Guest

    I was wondering if it would be possible to change the maximum walk/run speed of factions instead of it being based on one configuration for all characters?
     
  2. ShadowOfDoubt

    ShadowOfDoubt In the grim dark future. There is only SCG.

    Re: Faction walk/run speed assistance

    If I remember rightly, I'm fairly sure you can. I'm not certain of it though, sadly.

    I think this would also be better in the support section, as you're basiclly asking for help.
     
  3. Tomo742

    Tomo742 Guest

    Re: Faction walk/run speed assistance

    Yeah but this section is about discussing programming and that's what I'm doing, it could kind of be in both areas to be honest from the forum descriptions.

    Also, while I'm here asking for help. I was wondering if it's also possible to make it so that a sound could be played locally (As in that it isn't played across the entire map, just on the player and anyone who is near said player) or within 3D space whatever it is. I'd like to know if it could be done when you typed a command such as /sound
     
  4. trurascalz

    trurascalz C16 Developer Legend

    Re: Faction walk/run speed assistance

    Code:
    function GM:PlayerSpawn( ply )
       if(ply:GetFaction() == "Metropolice Force") then
           ply:SetWalkSpeed( 10000 )
       end
    end
    
    Something like that but with clockwork hooks n that
     
  5. Tomo742

    Tomo742 Guest

    Re: Faction walk/run speed assistance

    This is what I had but, none of them are working. I think I'm doing something wrong with them.

    Code:
    function Schema:PlayerSpawn(ply)
            if(ply:GetFaction() == FACTION_VELOCIRAPTOR) then
                ply:ClockworkSetWalkSpeed(80)
            end
    end
    
    function Schema:PlayerCharacterLoaded(ply)
            if(ply:GetFaction() == FACTION_VELOCIRAPTOR) then
                ply:ClockworkSetWalkSpeed(80)
            end
    end
    
    function Schema:PlayerInitialSpawn(ply)
            if(ply:GetFaction()== FACTION_VELOCIRAPTOR) then
                ply:ClockworkSetWalkSpeed(80)
            end
    end
    Edit - Tried a load of different functions like
    Code:
    function Schema:PlayerCharacterLoaded(player)
            if(player:GetFaction() == FACTION_VELOCIRAPTOR) then
    			player.SetWalkSpeed(80);
    			player.SetRunSpeed(0);
            end
    end
    and even

    Code:
    function Schema:PlayerCharacterLoaded(player)
            if(player:GetFaction() == FACTION_VELOCIRAPTOR) then
    			player.ClockworkSetRunSpeed(80);
    			player.ClockworkSetRunSpeed(0);
            end
    end
    and

    Code:
    function Schema:PlayerCharacterLoaded(player)
            if(player:GetFaction() == FACTION_VELOCIRAPTOR) then
    			player.cwSetRunSpeed()=80
    			player.cwSetRunSpeed()=0
            end
    end
    from

    Code:
    player.cwJumpPower = self.config:Get("jump_power"):Get();
    player.cwWalkSpeed = self.config:Get("walk_speed"):Get();
    player.cwRunSpeed = self.config:Get("run_speed"):Get();
    No matter what I do it stays to the same speed as set in the config.
     
  6. trurascalz

    trurascalz C16 Developer Legend

    Re: Faction walk/run speed assistance

    Hmm maybe the configuration is set after, remember clockwork runs of attributes aswell. Th ey probably override alot
     
  7. Tomo742

    Tomo742 Guest

    Re: Faction walk/run speed assistance

    Yeah, that's what I was thinking. It seems to automatically be set by the clockwork framework upon character load but wouldn't the schema load after the framework? I just want to find out how to do this as it's kind of needed.

    edit - HELP PLZ, NEED THIS SO BAD!
     
  8. Valterain1

    Valterain1 Guest

    Re: Faction walk/run speed assistance

    Maybe you should upfront ask kurozael, that is, if you can get a hold of him.
     
  9. TheHipster

    TheHipster rhenz is a fairly decent fellow

    Re: Faction walk/run speed assistance

    Stop with the god damn comic sans. Jesus Christ.

    And yeah, you should ask kuro about it himself and such.
     
  10. Tomo742

    Tomo742 Guest

    Re: Faction walk/run speed assistance

    I already did in the team-speak a few times, but then I had hipster and a few others telling me to shut up and then I Had to go and had nothing else so... [member=1]kurozael[/member]

    I also suggested adding in new configs that allowed you to set custom walk/run speeds for different factions.
     
  11. TheHipster

    TheHipster rhenz is a fairly decent fellow

    Re: Faction walk/run speed assistance

    I only told you to shhh because I was tired. I am sorry babe.
    But I have no idea how to do this. Maybe duck knows again. He usually does.

    [member=5482]duck[/member]
     
  12. duck

    duck Phant0m Legend

    Re: Faction walk/run speed assistance

    Clockwork handles run speed and walk speed strangely. I don't know how to do this. Go into a server Clockwork by yourself and type this in the server's console.

    No difference in run speed.
     
  13. Tomo742

    Tomo742 Guest

    Re: Faction walk/run speed assistance

    Yeah, I've noticed it does handle speeds strangely. I'm not sure how but I think Clockwork stops the speeds from being changed on the run for some reason, infact when you change the config for speeds in clockwork it only changes when you respawn or change char. Might have to figure something out or perhaps some kind of work around...
     
  14. TheHipster

    TheHipster rhenz is a fairly decent fellow

    Re: Faction walk/run speed assistance

    So, I guess for now this is resolved until Tomo can talk to kurozael I suppose? Alright, best of luck on the chat with him, Tomo.
     
  15. Re: Faction walk/run speed assistance

    Setting run/walkspeed doesn't work because the run/walkspeed is being set every think by the stamina plugin (clockwork\plugins\stamina\plugin\sv_hooks.lua).

    This is straight from my console:

    Code:
    ] lua_run player.GetAll()[1].cwInfoTable.runSpeed = 9000
    > player.GetAll()[1].cwInfoTable.runSpeed = 9000...
    ] lua_run print(player.GetAll()[1].cwInfoTable.runSpeed)
    > print(player.GetAll()[1].cwInfoTable.runSpeed)...
    9000
    ] lua_run print(player.GetAll()[1].cwInfoTable.runSpeed)
    > print(player.GetAll()[1].cwInfoTable.runSpeed)...
    100
    
    Code:
    ] lua_run player.GetAll()[1].cwInfoTable.walkSpeed = 9000
    > player.GetAll()[1].cwInfoTable.walkSpeed = 9000...
    ] lua_run print(player.GetAll()[1].cwInfoTable.walkSpeed)
    > print(player.GetAll()[1].cwInfoTable.walkSpeed)...
    9000
    ] lua_run print(player.GetAll()[1].cwInfoTable.walkSpeed)
    > print(player.GetAll()[1].cwInfoTable.walkSpeed)...
    100
    
    The second print is run after exiting and reentering gmod's main menu/console.
     
  16. duck

    duck Phant0m Legend

    Re: Faction walk/run speed assistance

    I saw that code as well, but my run speed was not changed every think. I printed it multiple times.
     
  17. Re: Faction walk/run speed assistance

    But it's run on playerthink? Honestly, it doesn't matter as long as the speed is occasionally set by the plugin. Even if it had only set the speeds each 10th minute it'd still be a problem.
     
  18. duck

    duck Phant0m Legend

    Re: Faction walk/run speed assistance

    When the config's maximum run speed is changed, it calls SetRunSpeed on all players to the new value. When this happens, the speed change actually goes through. If you do SetRunSpeed in lua_run, it does nothing.

    This is the most strangest thing to me.
     
  19. Re: Faction walk/run speed assistance

    Maybe because the stamina plugin uses the config values when it sets the speeds?
     
  20. duck

    duck Phant0m Legend

    Re: Faction walk/run speed assistance

    I checked for that before, but searched for the wrong config value. I searched for 'maximum' instead of 'run_speed'.

    It does appear to use the config's run speed. This speed system needs to be redone.
     

Previous Readers (Total: 0)