Junior Member
|
08-12-2020
, 06:36
Re: Any updated ff2_1st_set_abilities for FF2 1.10.14?
|
#14
|
Code:
void Rage_Slowmo(int boss, const char[] ability_name)
{
FF2_SetFF2flags(boss, FF2_GetFF2flags(boss)|FF2FLAG_CHANGECVAR);
SetConVarFloat(cvarTimeScale, FF2_GetArgF(boss, this_plugin_name, ability_name, "timescale", 2, 0.1));
float duration=FF2_GetArgF(boss, this_plugin_name, ability_name, "duration", 1, 1.0)+1.0;
SlowMoTimer=CreateTimer(duration*FF2_GetArgF(boss, this_plugin_name, ability_name, "timescale", 2, 0.1), Timer_StopSlowMo, boss, TIMER_FLAG_NO_MAPCHANGE);
int boss_idx=GetClientOfUserId(FF2_GetBossUserId(boss));
FF2Flags[boss_idx]=FF2Flags[boss_idx]|FLAG_SLOWMOREADYCHANGE|FLAG_ONSLOWMO;
UpdateClientCheatValue(1);
int client=GetClientOfUserId(FF2_GetBossUserId(boss));
if(client)
{
CreateTimer(duration*FF2_GetArgF(boss, this_plugin_name, ability_name, "timescale", 2, 0.1), Timer_RemoveEntity, EntIndexToEntRef(AttachParticle(client, TF2_GetClientTeam(client)==TFTeam_Blue ? "scout_dodge_blue" : "scout_dodge_red", 75.0)), TIMER_FLAG_NO_MAPCHANGE);
}
EmitSoundToAll(SOUND_SLOW_MO_START, _, _, _, _, _, _, _, _, _, false);
EmitSoundToAll(SOUND_SLOW_MO_START, _, _, _, _, _, _, _, _, _, false);
}
It means that the real duration of slow is arg1*arg2. This is because if you set host_timescale the whole game has been slowed, that causes the duration should be multiplied by the value of host_timescale you set. It may work on linux, but on windows host_timescale changes without really changing the sv_cheats would cause prediction problem between clients and server. The subplugin uses SetConVarFloat to prevent clients use cheat command during the slowmo, it is some extra engine code that only exists on Windows for some reason that prevents the value from being applied if cheats are disabled. If you set sv_cheats 1 before you use slowmo ability, you would find the ability works very smooth. However you should do some stuff to block commands, and some cvars with cheat flag should be set again. If you don't want to care about those things, just use the plugin below.
Timescale Windows Fix
This plugins fix lagged slowmo ability on windows, and the duration would probably work properly. If the duration still been too short, change the source code to this.
Code:
void Rage_Slowmo(int boss, const char[] ability_name)
{
FF2_SetFF2flags(boss, FF2_GetFF2flags(boss)|FF2FLAG_CHANGECVAR);
SetConVarFloat(cvarTimeScale, FF2_GetArgF(boss, this_plugin_name, ability_name, "timescale", 2, 0.1));
float duration=FF2_GetArgF(boss, this_plugin_name, ability_name, "duration", 1, 1.0)+1.0;
SlowMoTimer=CreateTimer(duration, Timer_StopSlowMo, boss, TIMER_FLAG_NO_MAPCHANGE);
int boss_idx=GetClientOfUserId(FF2_GetBossUserId(boss));
FF2Flags[boss_idx]=FF2Flags[boss_idx]|FLAG_SLOWMOREADYCHANGE|FLAG_ONSLOWMO;
UpdateClientCheatValue(1);
int client=GetClientOfUserId(FF2_GetBossUserId(boss));
if(client)
{
CreateTimer(duration, Timer_RemoveEntity, EntIndexToEntRef(AttachParticle(client, TF2_GetClientTeam(client)==TFTeam_Blue ? "scout_dodge_blue" : "scout_dodge_red", 75.0)), TIMER_FLAG_NO_MAPCHANGE);
}
EmitSoundToAll(SOUND_SLOW_MO_START, _, _, _, _, _, _, _, _, _, false);
EmitSoundToAll(SOUND_SLOW_MO_START, _, _, _, _, _, _, _, _, _, false);
}
Last edited by XGAK; 08-12-2020 at 06:43.
Reason: typo
|
|