jump.tf Forums
Welcome B)

Zero Friction Floors Without Plugins

Intrets · 25 · 6085

Larry

  • Intermediate
  • ***
    • Posts: 116
    • Frags: +3/-0
    • View Profile
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
    • Frags: +0/-0
    • View Profile
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
    • Frags: +0/-0
    • View Profile
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

  • Administrator
  • Proficient
  • *****
    • Posts: 417
    • Frags: +0/-0
  • Plugins Developer
    • View Profile
    • Jump Academy
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
  • ***
    • Posts: 116
    • Frags: +3/-0
    • View Profile
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

  • Intermediate
  • ***
    • Posts: 123
    • Frags: +0/-0
  • hehe
    • View Profile
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
    • Frags: +0/-0
    • View Profile
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
  • ***
    • Posts: 116
    • Frags: +3/-0
    • View Profile
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

  • Intermediate
  • ***
    • Posts: 123
    • Frags: +0/-0
  • hehe
    • View Profile
Got it working on my latest map. Thanks!
_____________________________________________
wew lad


fake_acc_1264

  • Newbie
  • *
    • Posts: 1
    • Frags: +0/-0
    • View Profile
Aloha
Things you need to know before going further:
  • trigger_teleports set movement type to movetype_air when teleporting happens
  • using !activator for target/landmark  keyvalues works fine
  • teleports with landmark specified dont edit teleported entity angles
  • trigger_teleport + landmark teleport result_pos formula: current_pos - landmark_pos + target_pos
    In fact, current_pos == !activator_pos
    if landmark_pos == target_pos, then result_pos == current_pos
me = random css mapper (actually not, 0 maps released), who suddenly found this thread
I have been working on this icy thing much time ago, thats my results:
  • trigger_teleport "target !activator" (perfect local serv, cant move mouse on normal serv)
    Theory: while in trigger it teleports player every frame to his position and angles with air movement applied, "you need to know"1-2
  • trigger_teleport "target X" "landmark X" (perfect local serv, sometimes kills speed on normal serv
    Theory: "you need to know" 1, 3-4
  • trigger_teleport "target !activator" "landmark !activator" (WORKS FINE ON NORMAL SERV)
    Theory: "you need to know" 1-4
In fact this thing is not "0 friction", its just air movement applied independent on what is underneath
The only applications i see are making walkable surfaces act like ramps (weird but maybe fun concept: surf map with almost flat floor ramps) and ofc fixing ramp bugs.
    Bonus trigger:
       
    • "trigger_teleport_save_angles" - trigger_teleport "target X" "landmark !activator"
      Theory: "you need to know" 2-4


    Conclusion: be nice and kind
« Last Edit: February 03, 2019, 06:12:24 PM by fake_acc_1264 »