Raised This Month: $ Target: $400
 0% 

[TF2] Medic Shield


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kamuixmod18
Junior Member
Join Date: Apr 2013
Old 12-27-2013 , 20:28   [TF2] Medic Shield
Reply With Quote #1

So any possibility to bring this into the normal gameplay too or is it doomed to stay in MVM only?
kamuixmod18 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-29-2013 , 04:42   Re: [TF2] Medic Shield
Reply With Quote #3

You could try spawning the entity and setting it up, could work.
May have to precache the model. There should be an attribute for it, though many dont work outside of mvm.
If it uses particles... I dunno, some of those are only loaded for mvm maps.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 12-29-2013 , 06:02   Re: [TF2] Medic Shield
Reply With Quote #4

It does seem to work; entity_medigun_shield, set m_hOwnerEntity to whoever (or whatever...it works on bosses too, and probably many more things, maybe everything ) and you might need to set m_iTeamNum, although I haven't encountered any problems with not doing that yet. No precache needed.
PHP Code:
new shield CreateEntityByName("entity_medigun_shield");
DispatchSpawn(shield);
SetEntPropEnt(shieldProp_Send"m_hOwnerEntity"ownerEntity); 
And that's basically it. However, it does seem to fade away on its own after about 10 seconds, so you'll probably want to respawn it every few seconds. Doing so is completely seamless, as far as I've seen.

Additionally, keep in mind that m_hOwnerEntity != parent per se, so you'll probably want a repeating 1.0-or-so timer to check if the owner of the shield is still != -1 and alive/valid.

TL;DR: It's possible, and someone who isn't lazy like me should make a full plugin out of it.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 12-29-2013 at 06:03.
MasterOfTheXP is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 12-29-2013 , 07:39   Re: [TF2] Medic Shield
Reply With Quote #5

Quote:
Originally Posted by MasterOfTheXP View Post
It does seem to work; entity_medigun_shield, set m_hOwnerEntity to whoever (or whatever...it works on bosses too, and probably many more things, maybe everything ) and you might need to set m_iTeamNum, although I haven't encountered any problems with not doing that yet. No precache needed.
PHP Code:
new shield CreateEntityByName("entity_medigun_shield");
DispatchSpawn(shield);
SetEntPropEnt(shieldProp_Send"m_hOwnerEntity"ownerEntity); 
And that's basically it. However, it does seem to fade away on its own after about 10 seconds, so you'll probably want to respawn it every few seconds. Doing so is completely seamless, as far as I've seen.

Additionally, keep in mind that m_hOwnerEntity != parent per se, so you'll probably want a repeating 1.0-or-so timer to check if the owner of the shield is still != -1 and alive/valid.

TL;DR: It's possible, and someone who isn't lazy like me should make a full plugin out of it.
Now, the question is. How to get the bigger version of the shield?

:EDIT:

Anyway, here's a little thing i made with it.

Pressing reload as medic activates the shield (can also bind sm_shield to a button)
There is a 60 second cooldown for the shield.

Requires morecolors to compile
Attached Files
File Type: sp Get Plugin or Get Source (shield.sp - 436 views - 2.1 KB)

Last edited by Pelipoika; 12-29-2013 at 09:08.
Pelipoika is offline
vadia111
BANNED
Join Date: Dec 2013
Location: Usa
Old 12-31-2013 , 09:34   Re: [TF2] Medic Shield
Reply With Quote #6

link this plugin is broken !!! its faill ..... please new link for donwload !!!
vadia111 is offline
Send a message via ICQ to vadia111 Send a message via AIM to vadia111 Send a message via Yahoo to vadia111 Send a message via Skype™ to vadia111
Sreaper
髪を用心
Join Date: Nov 2009
Old 12-31-2013 , 23:18   Re: [TF2] Medic Shield
Reply With Quote #7

Quote:
Originally Posted by vadia111 View Post
link this plugin is broken !!! its faill ..... please new link for donwload !!!
Attached Files
File Type: smx shield.smx (10.2 KB, 453 views)
File Type: sp Get Plugin or Get Source (shield.sp - 356 views - 2.1 KB)
Sreaper is offline
vadia111
BANNED
Join Date: Dec 2013
Location: Usa
Old 12-31-2013 , 09:35   Re: [TF2] Medic Shield
Reply With Quote #8

this plugin is very important for me
vadia111 is offline
Send a message via ICQ to vadia111 Send a message via AIM to vadia111 Send a message via Yahoo to vadia111 Send a message via Skype™ to vadia111
Mitchell
~lick~
Join Date: Mar 2010
Old 12-31-2013 , 11:15   Re: [TF2] Medic Shield
Reply With Quote #9

Quote:
Originally Posted by vadia111 View Post
this plugin is very important for me
YOu need to download it and compile it on your own system.
Mitchell is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-07-2014 , 00:43   Re: [TF2] Medic Shield
Reply With Quote #10

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.

Last edited by 404UserNotFound; 01-07-2014 at 00:44.
404UserNotFound 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