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

FF2 My Boss Picks Up Ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShowTeKPT
Member
Join Date: Apr 2013
Old 09-05-2013 , 14:50   My Boss Picks Up Ammo
Reply With Quote #1

Hello,

I created a boss and it has "258 ; 1" attribute but it stills picks up ammo, but only my boss, other ones can't pickup.

PHP Code:
"character"
{
    
"name"              "Obi-Man"
    "class"             "8"
    "model"             "models\freak_fortress_2\obiman\obiman.mdl"
    "ragedist"          "600.0"
    "sound_block_vo"    "1"

    "description_en" "Obi-Man:\nPoderes\n - Super Salto, olha para cima and levanta-te.\n - Peso: No ar, olha para baixo e carrega ctrl.\n - Rage: Usa o Taunt quando o teu RageMeter estiver a 100."
    
    "weapon1"
    
{    
        
"name"            "tf_weapon_katana"
        "index"            "357"
        "show"          "1"
        "attributes"    "258 ; 1"
    
}
    
"ability1"
    
{
        
"name" "charge_weightdown"
        "arg0" "3"
        "plugin_name" "default_abilities"
    
}
    
"ability2"
    
{
        
"name"         "charge_bravejump"
        "arg0"        "1"
        "arg1"        "1.5"
        "arg2"        "5"
        "plugin_name"    "default_abilities"
    
}
    
"ability3"
    
{
        
"name" "rage_stun"
        "arg1" "5.0"
        "plugin_name" "default_abilities"
    
}
    
"ability4"
    
{
        
"name" "rage_preventtaunt"
        "plugin_name" "default_abilities"
    
}
    
"ability5"
    
{
        
"name" "rage_stunsg"
        "arg1" "7.0"
        "plugin_name" "default_abilities"
    
}
    
"ability6"
    
{
        
"name" "rage_new_weapon"
        "arg1"    "tf_weapon_grenadelauncher"
        "arg2"    "19"
        "arg3"    "2 ; 9 ; 5 ; 10 ; 25 ; 0 ; 258 ; 1 ; 77 ; 0 ; 37 ; 0"
        "arg4"    "1"
        "arg5"    "1"
        "arg6"    "1"
        "plugin_name"    "special_noanims"
    

Anyone could know what is the problem?

Last edited by ShowTeKPT; 09-08-2013 at 15:42.
ShowTeKPT is offline
BBG_Theory
Veteran Member
Join Date: Oct 2010
Location: NC USA
Old 09-05-2013 , 20:03   Re: My Boss Picks Up Ammo
Reply With Quote #2

I have several bosses that do that and have never figured out why. wish I knew. Post enough of the config to show the class and all.. don't care about the download section
BBG_Theory is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-05-2013 , 20:10   Re: My Boss Picks Up Ammo
Reply With Quote #3

Incidentally, this is why the rewrite of FF2 is going to use SDKHooks to prevent bosses from grabbing ammo boxes and health kits unless the bosses have a boss flag that says they can grab them.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-05-2013 at 20:16.
Powerlord is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 09-06-2013 , 14:29   Re: My Boss Picks Up Ammo
Reply With Quote #4

I wrote a plugin to prevent ammo pickups, i can post it for you guys i guess.
It checks if ff2 is enabled, then just aborts pickups of health and ammo for bossteam on touch and starttouch.

I tried setting the tamnum of the packs on spawn, but appearantly that does not work 100% of the time, and you still need to hook tf_ammo_pack.

Ah, had it on my mobile:
Pickups.ff2

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin>
#include <tf2_stocks>
#include <sdkhooks>

new g_BossTeam=_:TFTeam_Blue;

////////////////////////////////////////////////////////////////////////////////////////////////////////////

public Plugin:myinfo 
{
        
name "Freak Fortress 2: Boss Item Pickup",
        
author "Friagram",
        
description "Prevents bosses from interacting with items.",
        
version "1.0",
        
url "http://steamcommunity.com/groups/poniponiponi"
};

public 
OnPluginStart2()
{
        
HookEvent("teamplay_round_start"event_round_startEventHookMode_PostNoCopy);
}

public 
event_round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
        
CreateTimer(5.0Timer_GetBossInfoINVALID_HANDLETIMER_FLAG_NO_MAPCHANGE);
}

public 
Action:Timer_GetBossInfo(Handle:hTimer)
{
        if(
FF2_IsFF2Enabled())
        {
                
g_BossTeam FF2_GetBossTeam();
        }
        else

        {
                
g_BossTeam 0;
        }

        return 
Plugin_Continue;
}

public 
OnEntityCreated(entity, const String:classname[])
{
        if(
StrContains(classname"item_healthkit") != -|| StrContains(classname"item_ammopack") != -|| StrEqual(classname"tf_ammo_pack"))
        {
                
SDKHook(entitySDKHook_SpawnOnItemSpawned);
        }
}

public 
OnItemSpawned(entity)
{
        
SDKHook(entitySDKHook_StartTouchOnItemTouch);
        
SDKHook(entitySDKHook_TouchOnItemTouch);
}

public 
Action:OnItemTouch(itementity)
{

        if (
entity && entity <= MaxClients && GetClientTeam(entity) == g_BossTeam)
        {
                return 
Plugin_Handled;
        }

        return 
Plugin_Continue;
}

public 
Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)

{
        return 
Plugin_Continue;

Guess if you want could check in the timer by getting ff2 boss id, checking if boss has like special_allowpickup, and then setting the to zero.. Then only bosses with the ability would be able to pickup ammo.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 09-06-2013 at 14:39.
friagram is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 09-06-2013 , 14:32   Re: My Boss Picks Up Ammo
Reply With Quote #5

Code:
"77 ; 0 ; 258 ; 1 ; 37 ; 0"
works for me.
//77: Clip size is 0
//258: All ammo becomes health
//37: No ammo
__________________
~Wliu

Last edited by Wliu; 09-06-2013 at 14:33.
Wliu is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 09-06-2013 , 14:44   Re: My Boss Picks Up Ammo
Reply With Quote #6

Quote:
Originally Posted by Wliu View Post
Code:
"77 ; 0 ; 258 ; 1 ; 37 ; 0"
works for me.
//77: Clip size is 0
//258: All ammo becomes health
//37: No ammo
Might work, except for when the boss health < normal health, or the hale check health pulse hits, it will consume the pickup.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
ShowTeKPT
Member
Join Date: Apr 2013
Old 09-08-2013 , 15:44   Re: My Boss Picks Up Ammo
Reply With Quote #7

Edited the first post with more of the config.

Will try these attributes:
"77 ; 0 ; 37 ; 0"
ShowTeKPT is offline
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 06:47.


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