Raised This Month: $ Target: $400
 0% 

[TF2] Medic Shield


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-07-2014 , 13:18   Re: [TF2] Medic Shield
Reply With Quote #1

Quote:
Originally Posted by abrandnewday View Post
So I loaded the shield model up (models/props_mvm/mvm_player_shield.mdl) and found out it has an unused BLU skin (which doesn't have the veiny energy lines that the RED skin has).

So I modified the code that Pelipoika created, and made it spawn the blue skin for the BLU team.

PHP Code:
    if (IsValidClient(client) && IsPlayerAlive(client) && TF2_GetPlayerClass(client) == TFClass_Medic)
    {
        new 
shield CreateEntityByName("entity_medigun_shield");
        if(
shield != -1)
        {
            
DispatchSpawn(shield);
            
SetEntPropEnt(shieldProp_Send"m_hOwnerEntity"client);  
            
SetEntProp(shieldProp_Send"m_iTeamNum"GetClientTeam(client));
            
//SetEntProp(shield, Prop_Send, "m_iSkin", GetClientTeam(client)); <--This didn't work, sadly
            
if (GetClientTeam(client) == _:TFTeam_RedDispatchKeyValue(shield"skin""0");
            else if (
GetClientTeam(client) == _:TFTeam_BlueDispatchKeyValue(shield"skin""1");
            
Delay(client);
            return 
Plugin_Handled;
        }
    } 
Now, there is a second shield model, and it seems to be an upgraded version of the first shield. The model is "models/props_mvm/mvm_player_shield2.mdl. I don't know how to trigger the upgraded shield to appear, and there's no keyvalue info on the Valve Developer Wiki yet, so I'm at a loss.

But yeah, team-coloring on the shield!

I was wondering if Pelipoika would be ok with me modifying his work, adding a timer convar to choose the delay, adding in the blue shield for BLU Medics, etc and releasing it publicly. If not, then feel free to use the above code Peli.
The MvM shield has two sizes: 90 degree and 180 degree. I assume the second model is the larger shield.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-07-2014 , 13:44   Re: [TF2] Medic Shield
Reply With Quote #2

Quote:
Originally Posted by Powerlord View Post
The MvM shield has two sizes: 90 degree and 180 degree. I assume the second model is the larger shield.
Weird how they didnt use a submodel
Mitchell is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-07-2014 , 14:03   Re: [TF2] Medic Shield
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
The MvM shield has two sizes: 90 degree and 180 degree. I assume the second model is the larger shield.
Your assumption is correct. I loaded them both up. 2nd shield is the larger shield.

Also, here's an image of both shields with their BLU skins. Notice the lack of veiny energy lines like the RED shield has.

[IMG]http://img585.**************/img585/9633/znjp.png[/IMG]

Last edited by 404UserNotFound; 01-07-2014 at 14:07.
404UserNotFound is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 01-07-2014 , 14:27   Re: [TF2] Medic Shield
Reply With Quote #4

Quote:
Originally Posted by abrandnewday View Post
So I loaded the shield model up (models/props_mvm/mvm_player_shield.mdl) and found out it has an unused BLU skin (which doesn't have the veiny energy lines that the RED skin has).

So I modified the code that Pelipoika created, and made it spawn the blue skin for the BLU team.

Now, there is a second shield model, and it seems to be an upgraded version of the first shield. The model is "models/props_mvm/mvm_player_shield2.mdl. I don't know how to trigger the upgraded shield to appear, and there's no keyvalue info on the Valve Developer Wiki yet, so I'm at a loss.

But yeah, team-coloring on the shield!

I was wondering if Pelipoika would be ok with me modifying his work, adding a timer convar to choose the delay, adding in the blue shield for BLU Medics, etc and releasing it publicly. If not, then feel free to use the above code Peli.
You may do whatever you want with the code
Pelipoika is offline
Pirate Jesus
Member
Join Date: Aug 2010
Old 02-28-2014 , 14:52   Re: [TF2] Medic Shield
Reply With Quote #5

What's the status on this?
__________________
Pirate Jesus is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 02-28-2014 , 16:58   Re: [TF2] Medic Shield
Reply With Quote #6

Quote:
Originally Posted by Pirate Jesus View Post
What's the status on this?
Forgot about it. Will get on it eventually.
404UserNotFound is offline
rswallen
SourceMod Donor
Join Date: Jun 2013
Location: 127.0.0.1
Old 02-28-2014 , 17:57   Re: [TF2] Medic Shield
Reply With Quote #7

Using the big shield models is really easy:
[1] When you precache the model, save the return (a model index) to a global variable
[2] When you create the shield entity, set entprop "m_nModelIndex" to the saved value

PHP Code:
OnMapStart()
{
    
g_mdlBigShield  PrecacheModel("models/props_mvm/mvm_player_shield2.mdl");
}

CreateShield(client)
{
    if (
IsValidClient(client) && IsPlayerAlive(client) && TF2_GetPlayerClass(client) == TFClass_Medic)
    {
        new 
shield CreateEntityByName("entity_medigun_shield");
        if(
shield != -1)
        {
            
DispatchSpawn(shield);

            
SetEntProp(shieldProp_Send"m_nModelIndex"g_mdlMiniShield);

            
SetEntPropEnt(shieldProp_Send"m_hOwnerEntity"client);
            
SetEntProp(shieldProp_Send"m_iTeamNum"GetClientTeam(client));
            if (
GetClientTeam(client) == _:TFTeam_RedDispatchKeyValue(shield"skin""0");
            else if (
GetClientTeam(client) == _:TFTeam_BlueDispatchKeyValue(shield"skin""1");
        }
    }


Last edited by rswallen; 02-28-2014 at 17:57.
rswallen is offline
Pirate Jesus
Member
Join Date: Aug 2010
Old 02-28-2014 , 18:45   Re: [TF2] Medic Shield
Reply With Quote #8

Quote:
Originally Posted by abrandnewday View Post
Forgot about it. Will get on it eventually.
That's great. As soon as this is relatively bug free and working as close to the actual shield as possible, i was going to look in to implementing this into the TF2x10 mod if i can balance a medigun to use it instead of whatever else... Potentially anyways.
__________________
Pirate Jesus is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-07-2014 , 13:08   Re: [TF2] Medic Shield
Reply With Quote #9

SetEntityModel, maybe?
Mitchell is offline
turtsmcgurts
SourceMod Donor
Join Date: Jul 2011
Old 03-01-2014 , 01:02   Re: [TF2] Medic Shield
Reply With Quote #10

Would it be possible to change the rotation of the shield? I'm thinking of some type of ball encompassing a player made of multiple shields.
turtsmcgurts 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 04:52.


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