Raised This Month: $208 Target: $400
 52% 

FF2 [Abilities] Move Speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHADoW NiNE TR3S
AlliedModders Donor
Join Date: Jul 2014
Location: Nepu Nepu?
Old 06-05-2015 , 02: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, 762 views)
File Type: sp Get Plugin or Get Source (ff2_movespeed.sp - 668 views - 6.8 KB)
__________________

Last edited by SHADoW NiNE TR3S; 06-24-2016 at 02:15.
SHADoW NiNE TR3S is offline
Send a message via AIM to SHADoW NiNE TR3S Send a message via Skype™ to SHADoW NiNE TR3S
SHADoW NiNE TR3S
AlliedModders Donor
Join Date: Jul 2014
Location: Nepu Nepu?
Old 07-28-2015 , 23: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 SHADoW NiNE TR3S; 07-29-2015 at 10:29.
SHADoW NiNE TR3S is offline
Send a message via AIM to SHADoW NiNE TR3S Send a message via Skype™ to SHADoW NiNE TR3S
SHADoW NiNE TR3S
AlliedModders Donor
Join Date: Jul 2014
Location: Nepu Nepu?
Old 08-15-2015 , 16: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
__________________
SHADoW NiNE TR3S is offline
Send a message via AIM to SHADoW NiNE TR3S Send a message via Skype™ to SHADoW NiNE TR3S
SHADoW NiNE TR3S
AlliedModders Donor
Join Date: Jul 2014
Location: Nepu Nepu?
Old 08-15-2015 , 21: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
__________________
SHADoW NiNE TR3S is offline
Send a message via AIM to SHADoW NiNE TR3S Send a message via Skype™ to SHADoW NiNE TR3S
SHADoW NiNE TR3S
AlliedModders Donor
Join Date: Jul 2014
Location: Nepu Nepu?
Old 08-22-2015 , 14: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 SHADoW NiNE TR3S; 08-22-2015 at 21:22.
SHADoW NiNE TR3S is offline
Send a message via AIM to SHADoW NiNE TR3S Send a message via Skype™ to SHADoW NiNE TR3S
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: *pPlayer->GetOrigin()
Old 08-22-2015 , 22: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|Steam Group|Profile
I can do coding and even take requests, but I don't do a bit of modeling

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
Send a message via Skype™ to xXDeathreusXx
SHADoW NiNE TR3S
AlliedModders Donor
Join Date: Jul 2014
Location: Nepu Nepu?
Old 08-22-2015 , 23: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 SHADoW NiNE TR3S; 08-22-2015 at 23:12.
SHADoW NiNE TR3S is offline
Send a message via AIM to SHADoW NiNE TR3S Send a message via Skype™ to SHADoW NiNE TR3S
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: *pPlayer->GetOrigin()
Old 08-22-2015 , 23: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|Steam Group|Profile
I can do coding and even take requests, but I don't do a bit of modeling

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
Send a message via Skype™ to xXDeathreusXx
Dalix
Member
Join Date: Apr 2014
Location: Hungary
Old 09-25-2015 , 09: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
SHADoW NiNE TR3S
AlliedModders Donor
Join Date: Jul 2014
Location: Nepu Nepu?
Old 09-26-2015 , 02: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 SHADoW NiNE TR3S; 09-26-2015 at 20:30.
SHADoW NiNE TR3S is offline
Send a message via AIM to SHADoW NiNE TR3S Send a message via Skype™ to SHADoW NiNE TR3S
Reply


Thread Tools
Display Modes

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 08:22.


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