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

FF2 Custom Ability Question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LordHotPocketHomicide
Member
Join Date: Aug 2016
Location: This Realm of Existence
Old 03-25-2018 , 23:19   Custom Ability Question
Reply With Quote #1

For a long time now, I've had an idea for a Hale that would progressively get stronger at certain points in his BGM (background music). For example, at, say, 1:47, he would get a new ability, and each time stamp and its new abilities could be specified within the plugin's args. And whenever the Hale gains a new ability, it would be announced via a custom message that would appear at the top of the screen (like sm_csay), which would also be specified in the args. Would such a thing be possible? If so, how could I make it, if it doesn't already exist?
__________________
Professional retard. I might borrow some code, but I always try to give credit when I do! If you've noticed I've borrowed some of your code, and you have a problem with that, please add me on Steam and let me know so I can correct the problem as soon as possible!

Last edited by LordHotPocketHomicide; 03-25-2018 at 23:20.
LordHotPocketHomicide is offline
Transit Of Venus
Senior Member
Join Date: May 2014
Location: Australia
Old 03-27-2018 , 05:19   Re: Custom Ability Question
Reply With Quote #2

Except some users have the music off, or turn it off then on so it would be out of line
__________________

Click on the banner to explore my servers and more
Transit Of Venus is offline
Send a message via ICQ to Transit Of Venus Send a message via Skype™ to Transit Of Venus
LordHotPocketHomicide
Member
Join Date: Aug 2016
Location: This Realm of Existence
Old 03-27-2018 , 13:29   Re: Custom Ability Question
Reply With Quote #3

Quote:
Originally Posted by Transit Of Venus View Post
Except some users have the music off, or turn it off then on so it would be out of line
That's a good point. Perhaps the entire song could be the intro track, so nobody could disable it? But then people who don't like the song would have to mute everything.
__________________
Professional retard. I might borrow some code, but I always try to give credit when I do! If you've noticed I've borrowed some of your code, and you have a problem with that, please add me on Steam and let me know so I can correct the problem as soon as possible!
LordHotPocketHomicide is offline
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 04-26-2018 , 03:31   Re: Custom Ability Question
Reply With Quote #4

Quote:
Originally Posted by LordHotPocketHomicide View Post
For a long time now, I've had an idea for a Hale that would progressively get stronger at certain points in his BGM (background music). For example, at, say, 1:47, he would get a new ability, and each time stamp and its new abilities could be specified within the plugin's args. And whenever the Hale gains a new ability, it would be announced via a custom message that would appear at the top of the screen (like sm_csay), which would also be specified in the args. Would such a thing be possible? If so, how could I make it, if it doesn't already exist?
It's possible. For a basic plugin, you can use simple timers, which is specified in seconds by the arg

something like
Code:
#define NEWABILITY "special_newability"
float abilitytime[3];

public void ArenaRoundStart(Event event, const char[] name, bool dontBroadcast)
{
    for(int client=MaxClients; client; client--)
    {
        if(!IsValidClient(client))
        {
            continue;
        }
        int boss=FF2_GetBossIndex(client);
        if(boss>=0 && FF2_HasAbility(boss, THIS_PLUGIN_NAME, NEWABILITY))
        {
            abilitytime[0]=FF2_GetAbilityArgumentFloat(boss, THIS_PLUGIN_NAME, NEWABILITY, 1);
            CreateTimer(abilitytime[0], Timer_NewAbility, boss, TIMER_FLAG_NO_MAPCHANGE);
        }
    }
}


public Action Timer_NewAbility(Handle timer, any boss)
{
    static int newabilities=0;

    switch(newabilities)
    {
        case 0: // new ability 1
        {
            PrintCenterTextAll("%t", "newability1");
        }
        case 1: // new ability 2
        {
           PrintCenterTextAll("%t", "newability2");
        }
        case 2: // new ability 3
        {
            PrintCenterTextAll("%t", "newability3");
        }
    }

    if(newabilities>=2)
    {
        newabilities=0;
        return Plugin_Stop;
    }
    
    abilitytime[1]=FF2_GetAbilityArgumentFloat(boss,THIS_PLUGIN_NAME, NEWABILITY, 2);
    abilitytime[2]=FF2_GetAbilityArgumentFloat(boss,THIS_PLUGIN_NAME, NEWABILITY, 3);
    CreateTimer(abilitytime[newabilities==0 ? 1:2], Timer_NewAbility, boss, TIMER_FLAG_NO_MAPCHANGE); 
    newabilities+=1;

    return Plugin_Continue;
}

stock bool IsValidClient(int clientIdx, bool aliveOnly=false)
{
	if (clientIdx<=0 || clientIdx>=MAX_PLAYERS || clientIdx>MaxClients) return false;
	if(aliveOnly) return IsClientInGame(clientIdx) && IsPlayerAlive(clientIdx);
	return IsClientInGame(clientIdx);
}
__________________

Last edited by 93SHADoW; 04-26-2018 at 03:36.
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
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 06:49.


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