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

FF2 [Abilities] Move Speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 06-05-2015 , 01:42   [Abilities] Move Speed
Reply With Quote #1

A simple subplugin to change a boss's move speed, or a victim's movespeed within a specific range, for a timed duration.

COMPATIBLE WITH ABILITY MANAGEMENT SYSTEM & DYNAMIC SPEED MANAGEMENT
Spoiler


PHP Code:
    "abilityX"
    
{
        
"name" "rage_movespeed"
        "arg1" "520"     
// Boss Move Speed
        
"arg2" "10"      // Boss Move Speed Duration (seconds)
        
"arg3" "500"    // Victim Range (to enable victim move speed)
        
"arg4" "150"    // Victim Move Speed
        
"arg5" "10"     //Victim Move Speed duration (seconds)
        
        // args reserved for the ability management system
        
"arg1001"    "0.0" // delay before first use
        
"arg1002"    "10.0" // cooldown
        
"arg1003"    "The Soviet Chase" // name
        
"arg1004"    "Run like no tomorrow." // description
        
"arg1005"    "75" // rage cost
        
"arg1006"    "2" // index for ability in the AMS menu
     
        
"plugin_name" "ff2_movespeed"    
    


Max move speed is 520, and minimum move speed is 1.

Sounds
Code:
	"sound_movespeed_start" // when rage activates via AMS
	{
		"1"	"saxton_hale/miku/miku_awesome.mp3"
		"2"	"saxton_hale/miku/miku_come_here.mp3"
	}

	"sound_tfcondition_finish" // when rage is over (AMS or normal RAGE)
	{
		"1"	"saxton_hale/miku/miku_awesome.mp3"
		"2"	"saxton_hale/miku/miku_come_here.mp3"
	}
Installation:
  • ff2_movespeed.smx: rename to ff2_movespeed.ff2, then place in plugins>freaks folder
  • ff2_movespeed.sp: place in scripting>freaks folder

Changelog:
  • v1.0:
    • Initial release
  • v1.1:
    • Now uses PreThink instead of OnGameFrame
    • Floats or whole integers can be specified for movespeed / duration
  • v1.2:
    • Added support for use in Ability Management System
  • v1.3:
    • No longer conflicts with 'dynamic_speed_management'
    • Now requires 'ff2_dynamic_defaults.inc' to compile
  • v1.3.1:
    • Hopefully fixed frogs errors related to initializing AMS_InitSubAbility()
  • v1.3.2
    • Fixed AMS errors (thanks sarysa)
  • v1.3.3
    • Hopefully fixed invalid client errors.
  • v1.3.4
    • Now autodetects if AMS is present on boss CFG, and now uses "sound_movespeed_start" and "sound_movespeed_finish" for sounds.
Attached Files
File Type: smx ff2_movespeed.smx (10.4 KB, 1437 views)
File Type: sp Get Plugin or Get Source (ff2_movespeed.sp - 1214 views - 6.8 KB)
__________________

Last edited by 93SHADoW; 06-24-2016 at 01:15.
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 07-28-2015 , 22:37   Re: [Subplugin] Move Speed
Reply With Quote #2

Changes for v1.1:
  • Now uses PreThink instead of OnGameFrame
  • Floats or whole integers can be specified for movespeed / duration
__________________

Last edited by 93SHADoW; 07-29-2015 at 09:29.
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 08-15-2015 , 15:16   Re: [Subplugin] Move Speed
Reply With Quote #3

Here's a big one for v1.2...
  • Added support for using "rage_movespeed" with Ability Management System!

    In use with an upcoming FemHeavy update:

  • Added a sound arg to play if this ability is activated from AMS
__________________
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 08-15-2015 , 20:34   Re: [Subplugin] Move Speed
Reply With Quote #4

I don't usually release more than 1 patch in the same day, but it was a critical patch for bosses that use dynamic_speed_management

v1.3:
  • No longer conflicts with 'dynamic_speed_management'
  • Now requires 'ff2_dynamic_defaults.inc' to compile
__________________
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 08-22-2015 , 13:14   Re: [Subplugin] Move Speed
Reply With Quote #5

v1.3.1:
  • Hopefully fixed frogs errors related to initializing AMS_InitSubAbility()

v1.3.2
  • Fixed AMS errors (thanks sarysa)

For some reason, some people would say it would fail to initialize if using with AMS, yet on my test environment, it was working fine.
__________________

Last edited by 93SHADoW; 08-22-2015 at 20:22.
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 08-22-2015 , 21:44   Re: [Subplugin] Move Speed
Reply With Quote #6

Quote:
Originally Posted by SHADoW NiNE TR3S View Post
v1.3.1:
  • Hopefully fixed frogs errors related to initializing AMS_InitSubAbility()

v1.3.2
  • Fixed AMS errors (thanks sarysa)

For some reason, some people would say it would fail to initialize if using with AMS, yet on my test environment, it was working fine.
Besides changing the version number, I don't see any change whatsoever
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 08-22-2015 , 22:08   Re: [Subplugin] Move Speed
Reply With Quote #7

Quote:
Originally Posted by xXDeathreusXx View Post
Besides changing the version number, I don't see any change whatsoever
v1.3.0:
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "freaks/%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (!StrContains(buffer, path, false))
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}
v1.3.1: Attempt 1
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (!StrContains(buffer, path, false))
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}
v1.3.2: Actually fixed (because i realized i was passing another .ff2 *cough* new Handle:plugin = FindPlugin("ff2_sarysapub3.ff2"); *cough*)
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (StrContains(buffer, path, false) >= 0)
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}

stock AMS_InitSubability(bossIdx, clientIdx, const String: pluginName[], const String: abilityName[], const String: prefix[])
{
	new Handle:plugin = FindPlugin("ff2_sarysapub3");
	if (plugin != INVALID_HANDLE)
	{
		new Function:func = GetFunctionByName(plugin, "AMS_InitSubability");
		if (func != INVALID_FUNCTION)
		{
			Call_StartFunction(plugin, func);
			Call_PushCell(bossIdx);
			Call_PushCell(clientIdx);
			Call_PushString(pluginName);
			Call_PushString(abilityName);
			Call_PushString(prefix);
			Call_Finish();
		}
		else
			LogError("ERROR: Unable to initialize ff2_sarysapub3:AMS_InitSubability()");
	}
	else
		LogError("ERROR: Unable to initialize ff2_sarysapub3:AMS_InitSubability(). Make sure this plugin exists!");
}
__________________

Last edited by 93SHADoW; 08-22-2015 at 22:12.
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 08-22-2015 , 22:12   Re: [Subplugin] Move Speed
Reply With Quote #8

Quote:
Originally Posted by SHADoW NiNE TR3S View Post
v1.3.0:
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "freaks/%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (!StrContains(buffer, path, false))
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}
v1.3.1: Attempt 1
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (!StrContains(buffer, path, false))
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}
v1.3.2: Actually fixed (because i realized i was passing another .ff2)
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (StrContains(buffer, path, false) >= 0)
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}

stock AMS_InitSubability(bossIdx, clientIdx, const String: pluginName[], const String: abilityName[], const String: prefix[])
{
	new Handle:plugin = FindPlugin("ff2_sarysapub3");
	if (plugin != INVALID_HANDLE)
	{
		new Function:func = GetFunctionByName(plugin, "AMS_InitSubability");
		if (func != INVALID_FUNCTION)
		{
			Call_StartFunction(plugin, func);
			Call_PushCell(bossIdx);
			Call_PushCell(clientIdx);
			Call_PushString(pluginName);
			Call_PushString(abilityName);
			Call_PushString(prefix);
			Call_Finish();
		}
		else
			LogError("ERROR: Unable to initialize ff2_sarysapub3:AMS_InitSubability()");
	}
	else
		LogError("ERROR: Unable to initialize ff2_sarysapub3:AMS_InitSubability(). Make sure this plugin exists!");
}
Oh, >= 0
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
Dalix
Member
Join Date: Apr 2014
Location: Hungary
Old 09-25-2015 , 08:33   Re: [Subplugin] Move Speed
Reply With Quote #9

L 09/24/2015 - 20:09:28: [SM] Native "GetEntPropVector" reported: Entity 8 ( is invalid
L 09/24/2015 - 20:09:28: [SM] Displaying call stack trace for plugin "freaks/ff2_movespeed.ff2":
L 09/24/2015 - 20:09:28: [SM] [0] Line 169, L:\scripting\ff2_movespeed.sp::MVS_Invoke()
L 09/24/2015 - 20:09:28: [SM] [1] Line 103, L:\scripting\ff2_movespeed.sp::Rage_MoveSpeed ()
L 09/24/2015 - 20:09:28: [SM] [2] Line 189, L:\scripting\ff2_movespeed.sp::FF2_OnAbility2 ()
L 09/24/2015 - 20:09:28: [SM] [3] Line 50, L:\scripting\include\freak_fortress_2_subplug in.inc::FF2_OnAbility()
Dalix is offline
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 09-26-2015 , 01:18   Re: [Subplugin] Move Speed
Reply With Quote #10

Quote:
Originally Posted by Dalix View Post
L 09/24/2015 - 20:09:28: [SM] Native "GetEntPropVector" reported: Entity 8 ( is invalid
L 09/24/2015 - 20:09:28: [SM] Displaying call stack trace for plugin "freaks/ff2_movespeed.ff2":
L 09/24/2015 - 20:09:28: [SM] [0] Line 169, L:\scripting\ff2_movespeed.sp::MVS_Invoke()
L 09/24/2015 - 20:09:28: [SM] [1] Line 103, L:\scripting\ff2_movespeed.sp::Rage_MoveSpeed ()
L 09/24/2015 - 20:09:28: [SM] [2] Line 189, L:\scripting\ff2_movespeed.sp::FF2_OnAbility2 ()
L 09/24/2015 - 20:09:28: [SM] [3] Line 50, L:\scripting\include\freak_fortress_2_subplug in.inc::FF2_OnAbility()
Thanks. Fixed
__________________

Last edited by 93SHADoW; 09-26-2015 at 19:30.
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
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 18:42.


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