Raised This Month: $51 Target: $400
 12% 

[FOF] TeleportEntity does not work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 02-05-2023 , 17:41   [FOF] TeleportEntity does not work
Reply With Quote #1

Hi,

I've used both raw TeleportEntity code and War3Source Teleport code that works in CS:GO and TF2. However Teleport does not work in FOF (Fist Full of Frags).

you can change the distance if your admin by putting this into console. Example:

sm_rcon sm_settdistance 300.0

Can anyone else confirm?

Here's a custom plugin code you can TEST with:

The code below teleports you up... so LOOK UP to the SKY and use this command. This will make sure there is nothing that will stop you from teleporting (walls, objects, etc).

Code:
#include <sdktools>
#include <sourcemod>

#pragma semicolon 1

public Plugin:myinfo =
{
	name = "War3Source - FOF Test Teleport",
	author = "test",
	description = "test",
	version = "1.0",
	url = "war3evo.info"
};

float ftest = 600.0;


public OnPluginStart()
{
	RegAdminCmd("sm_settdistance", Command_SetDistance, ADMFLAG_ROOT, "sm_settdistance <float>");

	RegConsoleCmd("+ttest",A_TestCommand);
} 

public Action:A_TestCommand(client,args)
{
	char command[32];
	GetCmdArg(0,command,sizeof(command));

	if(StrContains(command,"+")>-1)
	{
		float ClientPos[3];
		GetClientAbsOrigin( client, ClientPos );
	  	ClientPos[2] += ftest;
		TeleportEntity(client,ClientPos,NULL_VECTOR,NULL_VECTOR);
		PrintToChatAll("+ttest command works");
	}

	return Plugin_Handled;
}

public Action:Command_SetDistance(client, args)
{
	if (args < 1)
	{
		ReplyToCommand(client, "[SM] Usage: sm_settdistance <float>");
		return Plugin_Handled;
	}

	decl String:cmdArg[32];
	GetCmdArg(1, cmdArg, sizeof(cmdArg));

	ftest = StringToFloat(cmdArg);
	PrintToChatAll("distance set to %.2f",ftest);

	return Plugin_Handled;
}
__________________
El Diablo War3Evo is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 02-06-2023 , 05:48   Re: [FOF] TeleportEntity does not work
Reply With Quote #2

You can try this function for teleport (but works correctly only with standing players):
PHP Code:
SetEntPropVector(clientProp_Send"m_vecOrigin"fPos); 
__________________

Last edited by Grey83; 02-06-2023 at 05:48.
Grey83 is offline
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 02-06-2023 , 13:47   Re: [FOF] TeleportEntity does not work
Reply With Quote #3

Quote:
Originally Posted by Grey83 View Post
You can try this function for teleport (but works correctly only with standing players):
PHP Code:
SetEntPropVector(clientProp_Send"m_vecOrigin"fPos); 
Thank you for the workaround, I will give it a try!

I'll probably implement a force stop on a player before use.

I'll update this post on how it goes.

Here's the GitHub issue posted: https://github.com/alliedmodders/sou...ent-1419560476
__________________

Last edited by El Diablo War3Evo; 02-06-2023 at 13:48.
El Diablo War3Evo is offline
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 02-06-2023 , 16:35   Re: [FOF] TeleportEntity does not work
Reply With Quote #4

Quote:
Originally Posted by Grey83 View Post
You can try this function for teleport (but works correctly only with standing players):
PHP Code:
SetEntPropVector(clientProp_Send"m_vecOrigin"fPos); 
That works for FOF!

Now, I need to figure out how to fake the game into allowing the player to keep moving.
__________________
El Diablo War3Evo is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-06-2023 , 16:55   Re: [FOF] TeleportEntity does not work
Reply With Quote #5

*wait, fake moving ?


https://sm.alliedmods.net/new-api/en...EntityMoveType


https://sm.alliedmods.net/new-api/en...tocks/MoveType
__________________
Do not Private Message @me

Last edited by Bacardi; 02-06-2023 at 16:56.
Bacardi is offline
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 02-06-2023 , 17:11   Re: [FOF] TeleportEntity does not work
Reply With Quote #6


Based on Bacardi and Grey83's work around... I'm able to recreate Teleport and keep moving

Thank ya'll for helping me get this working around working!

*** Current work around ***

OnGameFrame you should SetEntityMoveType(client,MOVETYPE_NONE); then after 0.05 seconds timer stop setting that moveType.

As soon as you give the OnGameFrame switch to set that movement type, you need to SetEntPropVector(client, Prop_Send, "m_vecOrigin", fPos); so that it can teleport.


code:

SETUP in function:

Code:
		
War3_SetBuff( client, bNoMoveMode, 0, true, _ );

CreateTimer( 0.05, StopFreeze, client );
			
// Requires stop movement to work for FOF
SetEntPropVector(client, Prop_Send, "m_vecOrigin", emptypos);
War3_ChatMessage(client,"** 0.05 Teleported!");
Code:
public Action:StopFreeze( Handle:timer, any:client )
{
	if( ValidPlayer( client ) )
	{
		War3_SetBuff( client, bNoMoveMode, 0, false );
	}
}

I'd give the code, but I'm using War3source code to do this. There's a War3_SetBuff( client, bNoMoveMode, 0, true, _ ); that works on gameframe. I just set that buff, give it a timer CreateTimer( 0.05, StopFreeze, client ); and then remove buff War3_SetBuff( client, bNoMoveMode, 0, false );
__________________

Last edited by El Diablo War3Evo; 02-06-2023 at 17:47.
El Diablo War3Evo is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 02-06-2023 , 23:06   Re: [FOF] TeleportEntity does not work
Reply With Quote #7

Quote:
Originally Posted by El Diablo War3Evo View Post
That works for FOF!
I used this method 7 years ago in the game Codename C.U.R.E., in which teleportation also did not work.
__________________
Grey83 is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 07-31-2023 , 20:34   Re: [FOF] TeleportEntity does not work
Reply With Quote #8

Wait... so, is there a plugin that adds functional trigger_teleport and info_teleport_destination entities back into FoF (hopefully with filername support in the trigger_teleport)?
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter
Weasel is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode