Author Topic: Zero Friction Floors Without Plugins  (Read 664 times)

Larry

  • Intermediate Jumper
  • **
  • Posts: 59
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #15 on: January 05, 2018, 01:56:53 PM »
Yea I am fairly confident in saying it is a map-side fix for rampbugs and it may even lead on to a plugin fix for rampbugs too.
I played around with sourcemod but I have no idea how this black magic works.
Forcing players FL_ONGROUND flag to false doesn't seem to do anything, same with teleporting a player every tick with no change to their position. You can change sv_friction values for specific players to make them slide around but they are still capped to their max walk speed.  ???

Intrets

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #16 on: January 05, 2018, 02:31:08 PM »
Cool and froody

As for making it an optional mechanic i think having a simple trigger to rename a player is fine, you shouldn't need unique names for each player unless I understand this incorrectly.

Also, also. You can do 0 friction with a specific surfaceprop, however like ice you are speedcapped at your classes walk speed, so this method is way more interesting.

Yea I think you are right about not having to use the unique naming thing, I think I thought names had to be unique.

Intrets

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #17 on: January 05, 2018, 04:08:57 PM »
Yea I am fairly confident in saying it is a map-side fix for rampbugs and it may even lead on to a plugin fix for rampbugs too.
I played around with sourcemod but I have no idea how this black magic works.
Forcing players FL_ONGROUND flag to false doesn't seem to do anything, same with teleporting a player every tick with no change to their position. You can change sv_friction values for specific players to make them slide around but they are still capped to their max walk speed.  ???

I tried the FL_ONGROUND too but without success. It doesn't even prevent the player from jumping so it seems to do nothing. Does the source engine not care about the flag when it does the physics step? Or it recalculates if the player is on the ground anyway.

Edit: It is however possible to spawn trigger_teleports with the same functionality as the ones made in hammer.

The essentials:
Code: [Select]
new String:dummyModel[PLATFORM_MAX_PATH] = "models/props_manor/chair_01.mdl";

public OnPluginStart()           
{
    PrecacheModel(dummyModel);
    RegConsoleCmd("spawntele", Command_SpawnTele);
}

public Action Command_SpawnTele(int client, int args){
    new Float:pos[3];
    GetEntPropVector(client, Prop_Send, "m_vecOrigin", pos);

    new trigger = CreateEntityByName("trigger_teleport");
    new destination = CreateEntityByName("info_teleport_destination");
   
    if (trigger > 0 && destination > 0){

        DispatchKeyValueVector(trigger, "origin", pos);
        DispatchKeyValue(trigger, "classname", "trigger_teleport");
        DispatchKeyValue(trigger, "spawnflags", "15");
        DispatchKeyValue(trigger, "StartDisabled", "0");
        DispatchKeyValue(trigger, "target", "ski_destination");
        DispatchKeyValue(trigger, "landmark", "ski_destination");
        DispatchSpawn(trigger);
        ActivateEntity(trigger);
        SetEntityModel(trigger, dummyModel);       
       
        new Float:minbounds[3] = {-200.0, -200.0, -200.0};
        new Float:maxbounds[3] = {200.0, 200.0, 200.0};

        SetEntPropVector(trigger, Prop_Send, "m_vecMins", minbounds);
        SetEntPropVector(trigger, Prop_Send, "m_vecMaxs", maxbounds);

        SetEntProp(trigger, Prop_Send, "m_nSolidType", 2);
   
        new enteffects = GetEntProp(trigger, Prop_Send, "m_fEffects");
        enteffects |= 32;
        SetEntProp(trigger, Prop_Send, "m_fEffects", enteffects);
       
        new Float:destinationPosition[3] = {0.0, 0.0, 0.0};
       
        DispatchKeyValueVector(destination, "origin", destinationPosition);
        DispatchKeyValue(destination, "angles", "0 0 0");
        DispatchKeyValue(destination, "spawnflags", "15");
        DispatchKeyValue(destination, "targetname", "ski_destination");
        DispatchKeyValue(destination, "classname", "info_teleport_destination");
        DispatchSpawn(destination); 
    }
}
« Last Edit: January 05, 2018, 09:17:09 PM by Intrets »

AI

  • Server Admin
  • Professional Jumper
  • *
  • Posts: 351
  • Plugins Developer
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #18 on: January 07, 2018, 05:00:54 PM »
You can emulate no friction without a speed cap with m_hGroundEntity but client-side prediction can still mess with it a bit:

Code: [Select]
public Action OnPlayerRunCmd(int iClient, int &iButtons, int &iImpulse, float fVel[3], float fAng[3], int &iWeapon) {
if (!g_bFriction[iClient]) {
SetEntPropEnt(iClient, Prop_Data, "m_hGroundEntity", -1);
}

return Plugin_Continue;
}

But you can still have some fun with this plugin.

Larry

  • Intermediate Jumper
  • **
  • Posts: 59
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #19 on: January 09, 2018, 03:01:31 PM »
Modified my ramp bug plugin to set ground entity to -1 rather than changing player speed in any way.
The same issue still persists where if you ramp bug and shoot a rocket at the same time you get massive speed boost. I guess this has something to do with client prediction where the client thinks you should get much more velocity from the rocket since you stop on the ramp and you're closer to the rocket than if you were sliding. Not sure if there's any way to make this work for online play. :'(

donuttt

  • Newbie
  • *
  • Posts: 33
  • hehe
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #20 on: January 12, 2018, 02:36:49 AM »
Hey Intrets could you please make a quick little prefab for dumb dumb mappers like me?
I would love screwing around with this
_____________________________________________
wew lad

Intrets

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #21 on: January 13, 2018, 01:04:51 PM »
Hey Intrets could you please make a quick little prefab for dumb dumb mappers like me?
I would love screwing around with this

What would you need? It is just a regular trigger_teleport like you would make for teleporting a player back to the start of a jump except besides setting Remote Destination you also set Local Destination Landmark to the same. Might even be able to use 1 destination for every trigger_teleport like this in your map but I use a new destination for every pad.

If you want you can take a look at the download at the bottom of my first post https://jump.tf/forum/index.php/topic,2517.0.html
In that example map I only put it on flat surfaces, but putting it on ramps works exactly the same way.

I used a thickness of 64 units because that's the grid I always work on and also I figured if you're going at terminal velocity there's no way you could somehow miss the trigger_teleport if you're going fast but I doubt this even matters.

Larry

  • Intermediate Jumper
  • **
  • Posts: 59
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #22 on: January 13, 2018, 04:47:07 PM »
Modified my ramp bug plugin to set ground entity to -1 rather than changing player speed in any way.
The same issue still persists where if you ramp bug and shoot a rocket at the same time you get massive speed boost. I guess this has something to do with client prediction where the client thinks you should get much more velocity from the rocket since you stop on the ramp and you're closer to the rocket than if you were sliding. Not sure if there's any way to make this work for online play. :'(
Idk if this is true anymore, maybe I'm just crazy...
I'll attach the plugin here if anyone wants to test

donuttt

  • Newbie
  • *
  • Posts: 33
  • hehe
    • View Profile
Re: Zero Friction Floors Without Plugins
« Reply #23 on: January 14, 2018, 01:07:57 PM »
Got it working on my latest map. Thanks!
_____________________________________________
wew lad