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

[TF2] Target Practice v1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Author
JLHack7
Junior Member
Join Date: Dec 2009
Plugin ID:
2010
Plugin Version:
1.1
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Spawns the targets from Training mode.
    Old 10-16-2010 , 15:10   [TF2] Target Practice v1.1
    Reply With Quote #1

    Spawn the targets from TF2's training mode.


    -- Commands
    sm_addtarget <1-9>

    The number determines what class the spawned target is.

    If a number is not specified or an invalid number is specified, it'll pick a random one for you.

    To find the numbers for each class, just hit your changeclass bind.

    -- Changelog:

    2010-09-25 (v0.1a - 0.5a)
    • Private initial versions, simply spawned a random target.
    2010-10-16 (v1.0)
    • Initial public release version.
    • Allowed user to specify which class to spawn through arguments.
    2010-11-11 (v1.1)
    • Changed prop_dynamic back to prop physics.
    This should fix problems with hitboxes
    Attached Files
    File Type: sp Get Plugin or Get Source (sm_addtarget.sp - 2012 views - 4.2 KB)

    Last edited by JLHack7; 11-11-2010 at 20:41. Reason: Updated to 1.1
    JLHack7 is offline
    MrSaturn
    SourceMod Donor
    Join Date: Jan 2009
    Old 10-17-2010 , 20:03   Re: [TF2] Target Practice
    Reply With Quote #2

    Are the targets suppose to be destroyable? as it is right now all it does is create a little prop that you can even walk through and cant destroy.

    You can add me to your steam friends if you want, I have a seperate 12slot server just for testing out plugins.

    http://steamcommunity.com/profiles/76561197990042881
    __________________
    MrSaturn is offline
    noodleboy347
    AlliedModders Donor
    Join Date: Mar 2009
    Old 10-18-2010 , 03:55   Re: [TF2] Target Practice
    Reply With Quote #3

    Quote:
    Originally Posted by MrSaturn View Post
    Are the targets suppose to be destroyable? as it is right now all it does is create a little prop that you can even walk through and cant destroy.

    You can add me to your steam friends if you want, I have a seperate 12slot server just for testing out plugins.

    http://steamcommunity.com/profiles/76561197990042881
    Soldier rockets can destroy them
    noodleboy347 is offline
    MrSaturn
    SourceMod Donor
    Join Date: Jan 2009
    Old 10-21-2010 , 04:37   Re: [TF2] Target Practice
    Reply With Quote #4

    Any chance you can make em destroyable by anything? Even if you hit it with a rocket it just goes straight through. You have to aim at it's feet. Seems kinda dinky, atm.
    __________________
    MrSaturn is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 10-21-2010 , 06:04   Re: [TF2] Target Practice
    Reply With Quote #5

    The plugin is spawning it as a prop_dynamic, correct? Try spawning it as a prop_physics_override. It might fall over, but I think its hitbox will be the same as the model.
    The "new String:targetclass[128] = "prop_dynamic";" would be where to change, I think. prop_physics might work too.
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 10-21-2010 at 06:13.
    FlaminSarge is offline
    Thrawn2
    Veteran Member
    Join Date: Apr 2009
    Old 10-21-2010 , 07:11   Re: [TF2] Target Practice
    Reply With Quote #6

    this is how i do it: (only a snippet, missing some functions)
    PHP Code:
    public SpawnABall(iCreator) {
        
    SetTeleportEndPoint(iCreator);

        
    g_iBall CreateEntityByName("prop_physics_multiplayer");
        if(
    IsValidEntity(g_iBall))
        {
            
    SetEntityModel(g_iBallMDL_BALL);
            
    SetEntProp(g_iBallProp_Data"m_takedamage"2);
            
    DispatchSpawn(g_iBall);

            
    //DispatchKeyValue(g_iBall, "skin", bool:GetRandomInt(0,1) ? "1" : "0");
            //DispatchKeyValue(g_iBall, "targetname", "bomb");

            //SetEntPropEnt(g_iBall, Prop_Send, "m_hOwnerEntity", iCreator);
            
    SetEntProp(g_iBallProp_Data"m_takedamage"2);
            
    //SetEntPropEnt(g_iBall, Prop_Data, "m_hLastAttacker", iCreator);

            //Use the balls VPhysics for collisions
            
    SetEntPropg_iBallProp_Data"m_nSolidType");
            
    SetEntPropg_iBallProp_Send"m_nSolidType");

            
    //Only detect bullet/damage collisions
            
    SetEntProp(g_iBallProp_Data"m_CollisionGroup"2);
            
    SetEntProp(g_iBallProp_Send"m_CollisionGroup"2);

            
    //Set the shield's health
            
    SetEntProp(g_iBallProp_Data"m_iMaxHealth"150);
            
    SetEntProp(g_iBallProp_Data"m_iHealth"150);

            
    AcceptEntityInputg_iBall"DisableCollision" );
            
    AcceptEntityInputg_iBall"EnableCollision" );

            
    DispatchKeyValue(g_iBall"disableshadows""1");
            
    DispatchKeyValue(g_iBall"physicsmode""1");
            
    DispatchKeyValue(g_iBall"spawnflags""256");

            
    g_pos[2] += 50.0;
            
    TeleportEntity(g_iBallg_posNULL_VECTORNULL_VECTOR);

            
    SDKHook(g_iBallSDKHook_OnTakeDamageOnTakeDamage);
        }
    }

    public 
    Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype) {
        if(
    attacker && attacker <= MaxClients && IsClientInGame(attacker) && TMG_IsPlaying(attacker)) {
            new 
    iHealth GetEntProp(g_iBallProp_Data"m_iHealth");
            if(
    iHealth damage <= 0.0) {
                
    BallExplode();
            }

            
    g_bSuccess[attacker] = g_bSimon;
        } else {
            
    damage 0.0;
        }

        return 
    Plugin_Continue;

    __________________
    einmal mit profis arbeiten. einmal.
    Thrawn2 is offline
    JLHack7
    Junior Member
    Join Date: Dec 2009
    Old 10-26-2010 , 14:35   Re: [TF2] Target Practice
    Reply With Quote #7

    My bad I forgot about this thread for a bit.

    The initial versions used Prop_Physics and worked flawlessly, but I had to fire the input "DisableMotion" after the entity was spawned (which I did through sourcemod anyway)

    When I tried doing the console command "prop_dynamic_create" to spawn them it worked, so I assumed it would do the same if I spawned it via sourcemod and never tested that.

    I'll revert back to prop_physics.

    Frankly the public version was a bad idea, since I didn't test it in general. This isn't how I normally do things, I prefer to extensively test and fix them.

    Quote:
    Originally Posted by noodleboy347 View Post
    Soldier rockets can destroy them
    Soldier rockets are able to destroy the prop even though it doesn't have the proper hitbox?
    That... is interesting.

    Last edited by JLHack7; 10-26-2010 at 14:40.
    JLHack7 is offline
    Snaggle
    AlliedModders Donor
    Join Date: Jul 2010
    Location: England
    Old 10-26-2010 , 15:29   Re: [TF2] Target Practice
    Reply With Quote #8

    Quote:
    Originally Posted by JLHack7 View Post
    Soldier rockets are able to destroy the prop even though it doesn't have the proper hitbox?
    That... is interesting.
    Rockets only seem to damage it if you shoot the bottom of the target.
    Snaggle is offline
    JLHack7
    Junior Member
    Join Date: Dec 2009
    Old 11-11-2010 , 20:43   Re: [TF2] Target Practice v1.1
    Reply With Quote #9

    Updated to v1.1
    Changed target classname from prop_dynamic to prop_physics.
    This should fix problems with hitboxes.

    Also added the "DisableMotion" input post spawn so that the target still stays in place.
    JLHack7 is offline
    Unreal1
    AlliedModders Donor
    Join Date: Dec 2010
    Old 03-15-2011 , 23:05   Re: [TF2] Target Practice v1.1
    Reply With Quote #10

    Wht flags are required to spawn these targets? You should add a Cvar that allows you to modify the flag that makes them spawn.
    Unreal1 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 20:23.


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