AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   VSH / Freak Fortress (https://forums.alliedmods.net/forumdisplay.php?f=154)
-   -   FF2 [Subplugin] Gravity (Updated 12.02.2023) (https://forums.alliedmods.net/showthread.php?t=330413)

J0BL3SS 02-02-2021 12:43

[Subplugin] Gravity (Updated 12.02.2023)
 
I have been creating FF2 bosses and sharing them publicly on AlliedModders. However, lately, I feel like my potential is being wasted, and as a result, I have made the decision to keep my creations private. I believe that people doesn't truly appreciate these quality creations. Whoever has the files before, can keep them, i don't mind. But i believe soon enough none of them will be exist to be found

WhiteFalcon 02-02-2021 13:02

Re: [Subplugin] Gravity
 
You shouldn't pass raw index to timer since a client may leave/rejoin mid-rage and his index become invalid, use GetClientSerial/GetClientFromSerial or GetClientUserId/GetClientOfUserId

J0BL3SS 02-02-2021 13:45

Re: [Subplugin] Gravity
 
Quote:

Originally Posted by WhiteFalcon (Post 2735466)
You shouldn't pass raw index to timer since a client may leave/rejoin mid-rage and his index become invalid, use GetClientSerial/GetClientFromSerial or GetClientUserId/GetClientOfUserId

I still don't understannd how timers work. Should have i use like that? Or should i check player is valid or not in the timer void?

Code:

CreateTimer(GRV_Duration[Num][bossClientIdx], SetGravity, GetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE);

public Action SetGravity(Handle timer, int iClient)
{
        SetEntityGravity(iClient, 1.0);
}


WhiteFalcon 02-02-2021 14:03

Re: [Subplugin] Gravity
 
Check out the wiki for Timers
And also you might find this useful aswell
Code:

CreateTimer(GRV_Duration[Num][bossClientIdx], SomeCallback, GetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE /* Invalidate the timer during level change */);

public Action SomeCallback(Handle timer, int userid)
{
        int client = GetClientOfUserId(userid);
        if (!client)
        {
                // GetClientFromSerial and GetClientOfUserId returns 0 if serial was invalid aka that client left, only checking if it's not 0 should be enough
                return Plugin_Continue;
        }
       
        SetEntityGravity(client, 1.0);
        return Plugin_Continue;
}


J0BL3SS 02-03-2021 05:51

Re: [Subplugin] Gravity (Updated 03.02.2021)
 
  • Ver 1.1.0
  • Added rage_shockwave
  • Now its compatible with ff2_summonaboss.ff2 (At least without AMS)

MAGNAT2645 02-03-2021 11:55

Re: [Subplugin] Gravity
 
Quote:

Originally Posted by WhiteFalcon (Post 2735475)
Check out the wiki for Timers
And also you might find this useful aswell
Code:

CreateTimer(GRV_Duration[Num][bossClientIdx], SomeCallback, GetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE /* Invalidate the timer during level change */);

public Action SomeCallback(Handle timer, int userid)
{
        int client = GetClientOfUserId(userid);
        if (!client)
        {
                // GetClientFromSerial and GetClientOfUserId returns 0 if serial was invalid aka that client left, only checking if it's not 0 should be enough
                return Plugin_Continue;
        }
       
        SetEntityGravity(client, 1.0);
        return Plugin_Continue;
}


That's not enough. GetClientOfUserId can return non-zero index of client that's not in game.
Check this thread, especially this post.

J0BL3SS 02-10-2021 11:19

Re: [Subplugin] Gravity (Updated 10.02.2021)
 
  • Ver 1.2.0
  • Added New Rage "rage_sigma"
  • Fixed issue with "rage_shockwave" dealts damage to friendly buildings

Maple Syrup 03-09-2021 15:30

Re: [Subplugin] Gravity (Updated 10.02.2021)
 
Sorry for asking but, I have an issue as I keep getting this error in the console when the plugin is on my test server.
Spoiler

It happens whenever the round starts no matter what boss it is.

The ability works great but this error keeps showing and, I don't know if it's a problem with the server or if it's the plugin. (I don't really have much experience when it comes to plugins .-.)

The ability I am using is rage_sigma. I would love to use this ability for my boss but, I can't seem to work around this issue.

J0BL3SS 03-10-2021 00:26

Re: [Subplugin] Gravity (Updated 10.02.2021)
 
Quote:

Originally Posted by Maple Syrup (Post 2739917)
Sorry for asking but, I have an issue as I keep getting this error in the console when the plugin is on my test server.
Spoiler

It happens whenever the round starts no matter what boss it is.

The ability works great but this error keeps showing and, I don't know if it's a problem with the server or if it's the plugin. (I don't really have much experience when it comes to plugins .-.)

The ability I am using is rage_sigma. I would love to use this ability for my boss but, I can't seem to work around this issue.

Its not an error, its telling you the respawned player has no boss index, which is a way to make compatible ff2_summonaboss. Im hooking abilities when a player respawns, not when round starts, the normal players will cause this message so that means youre testing plugins with 6-12 bot :D. You can ignore that message. I gotta remove that message soon i update the plugin

J0BL3SS 03-10-2021 07:14

Re: [Subplugin] Gravity (Updated 10.03.2021)
 
  • Ver 1.2.1
  • Now PrintToServer() Functions only writes the name of the player who has the ability ex:
    https://i.imgur.com/rFFDZ8X.png
  • Sound section name in "rage_sigma" changed "rage_sigma" to "sound_sigma"
  • Damage to player can be defined now in "rage_sigma" on arg8
  • Now Particle Applied to enemy can be selected in "rage_sigma" on arg9 and arg10


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

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