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

[TF2] Friendly Mode (v. 16.0112)


Post New Thread Reply   
 
Thread Tools Display Modes
Scipizoa
Senior Member
Join Date: Aug 2012
Location: ask me
Old 04-14-2013 , 10:00   Re: [TF2] Friendly Mode
Reply With Quote #31

Quote:
Originally Posted by ddhoward View Post
Wrong. People in Godmode CAN goomba others. Changing the buddha to godmode would not change ANYTHING, other than remove a player's ability to rocket/sticky jump. And if you read the first post, you will see that setting the punish CVARS to negative values makes the punishment a slay.


I am unable to recreate this issue. Please ensure that you change the map upon updating/installing the plugin.
ok calm down i said i wasn't sure about the god mode thing, but god news I do know for a fact that you cannot gomba stomp while your in uber mode, and as for the slay thing yea I read it but thats irelevant,

now if theres someway that instead of godmode/buddha you can simulate an uber type mode it'd be better for several reasons

1. you cannot goomba stomp while being ubered, or using uber on yourself[i've tried]

2. despite being in ubermode your still killed for going into another teams spawn area or falling into a death pit or something[some servers use savloc/tele mods or setspawn mods, and rtd is a factor for noclip

Just a thought however ;)

as for the remember thing, I always restart server when adding a new plugin. does that remember cvar count towards team/class switch related kills/deaths?as I said I was testing it out by switching from heavy to medic, though My medic was unable to use all of his weapons[I did this 0n purpose by setting that other cvar] but he was still able to receive damage

I just tested it again right now and yes I still get killed :0

EDIT: ok epic I did some more testing here what I came up with

First as i stated if you go friendly, respawn then change class your no longter fully protected, you can't kill ppl still nor can you damage buildings, and people cannot kill you BUT, sentries can detect/kill you and you can be goomba'd and I don't mean just the constant bouncing on someones head goomba which occures with Buddha mode, but the goomba stomp actually kills you

I don't know what else is effected upon class change if I find any more i'll post it here
__________________

ZaBaGaBe Gaming Community: http://steamcommunity.com/groups/ZBGB

Last edited by Scipizoa; 04-14-2013 at 10:52.
Scipizoa is offline
Wazman
AlliedModders Donor
Join Date: Oct 2012
Location: Unknown place ????
Old 04-14-2013 , 14:41   Re: [TF2] Friendly Mode
Reply With Quote #32

Quote:
Uploading new version 13.0413 (2054). It is attached to this post, and will soon replace the version in the first post in this thread. Changes are:
Players who enter Friendly mode while holding a blocked weapon will be forced to remove that weapon, assuming that sm_friendly_blockweps = 1.
Error log spam should be fixed, big thanks to thetwistedpanda.
Lol, my friend showed me the
if(building > 0) too lol, I didn't get to upload last night
but meh, you already got the fix hehe.

Last edited by Wazman; 04-14-2013 at 14:43.
Wazman is offline
Scipizoa
Senior Member
Join Date: Aug 2012
Location: ask me
Old 04-14-2013 , 14:48   Re: [TF2] Friendly Mode
Reply With Quote #33

Fail waz. Fail lmao
__________________

ZaBaGaBe Gaming Community: http://steamcommunity.com/groups/ZBGB

Last edited by Scipizoa; 04-14-2013 at 14:49.
Scipizoa is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-14-2013 , 15:47   Re: [TF2] Friendly Mode
Reply With Quote #34

Looks similar to something we have, except we turn people into harmless ponies.
Unfortunately plugins like rtd do not provide natives to disable the takedamage, rolls, etc.
You can provide your own and build them into these other plugins, which is what will end up having to be done in the end if you want everything to work smoothly with these types of plugins... To prevent them from rolling, check if they are immune, block them from dealing damage via goomba stomps, etc.

There are some simple things you can do...
Change alpha or render mode of these players, or use a different player model.
Remove their collision.
Prevent sentries from targeting them.
Remove their hitbox.

Even if you make the friendly payers unsolid, they will still collide with, and stand on normal players. Other players will also get stuck in them, so you have to deal with that as well.

If you want to be lazy about it, just use the hidden mvm uber. Its like the normal uber, but it only flashes when you take damage. You still die to map traps, and plugins checking if you are ubered will ignore you... I think.... Then just throw a render mode over them and they should be easily identified.

public OnEntityCreated(building, const String:classname[]) {
if(entity[building] > 0) {
SDKHook(building, SDKHook_Spawn, OnEntitySpawned);
}
}

Wat? Get the classname and hook it if strcontains obj_ = 0

Also, you shouldnt have to reload the map, unless there are some really strange settings going on. Just make sure you hook players on map or plugin start if late loaded, and on plugin end you remove the effect on clients that have the mode on?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 04-14-2013 at 16:12.
friagram is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-14-2013 , 18:09   Re: [TF2] Friendly Mode
Reply With Quote #35

Uploading new version 13.0414 (1406). It is attached to this post, and will soon replace the version in the first post in this thread. Changes are:
  • Fixed a bug where friendly players who respawned (changed class while in spawn, admin slayed them, etc.) were not "fully" friendly upon respawn if sm_friendly_remember = 1. Stupid mistake on my part.
  • Added cvar sm_friendly_notarget. When enabled, friendly players will be immune to airblasts, invisible to sentries, etc.
  • Added cvar sm_friendly_buddha. When enabled, friendly players will have full buddha mode. When disabled, friendly players will only be immune to damage from other clients.*

*When disabled, friendly players will still be vulnerable to "special" sources of damage from other players, such as Goomba Stomp or the RTD effects Toxic and Timebomb. This will be a difficult issue to solve.

Please let me know if you run into any issues.
Attached Files
File Type: smx friendly.smx (7.3 KB, 121 views)
File Type: sp Get Plugin or Get Source (friendly.sp - 340 views - 13.2 KB)

Last edited by ddhoward; 04-14-2013 at 18:37.
ddhoward is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-14-2013 , 18:23   Re: [TF2] Friendly Mode
Reply With Quote #36

Quote:
Originally Posted by friagram View Post
Unfortunately plugins like rtd do not provide natives to disable the takedamage, rolls, etc.
You can provide your own and build them into these other plugins, which is what will end up having to be done in the end if you want everything to work smoothly with these types of plugins... To prevent them from rolling, check if they are immune, block them from dealing damage via goomba stomps, etc.
I figured as much. Including THAT extreme measure of compatibility with other plugins is not a main goal at this time though.
Quote:
Originally Posted by friagram View Post
Change alpha or render mode of these players, or use a different player model.
I was thinking some sort of particle effect that follows the player, similar to the slight glow provided by sm_spyvision or the glow that appears when a player rolls the RTD effect Scary Bullets. I don't want to interfere other plugins that change alpha, change models, etc.
Quote:
Originally Posted by friagram View Post
Remove their collision. Remove their hitbox.
That's my next priority; I have a feeling that it's going to be more difficult than anything else so far was.
Quote:
Originally Posted by friagram View Post
Prevent sentries from targeting them.
Already done, that was included in the original version posted by Dyl0n.
Quote:
Originally Posted by friagram View Post
Just make sure you hook players on plugin start if late loaded, and on plugin end you remove the effect on clients that have the mode on?
Right now they are hooked upon joining the server, I believe. Would I just be able to duplicate that to OnPluginStart?

Change this:
Code:
public OnClientPutInServer(client)
{
	SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
	SDKHook(client, SDKHook_WeaponSwitch, OnWeaponSwitch);
}
To this?:
Code:
public OnPluginStart(client)
{
	[OTHER STUFF THAT HAPPENS OnPluginStart]
	HookNewClient(client);
}

public OnClientPutInServer(client)
{
	HookNewClient(client);
}

public OnPluginEnd(client)
{
	if (ClientIsFriendly[client]) {
		MakeClientHostile(client);
	}
}

HookNewClient(const client) {
	SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
	SDKHook(client, SDKHook_WeaponSwitch, OnWeaponSwitch);
}
Again, keep in mind that I've only been using SourcePawn for 3 days, lol.

Last edited by ddhoward; 04-14-2013 at 19:47.
ddhoward is offline
Helvetica
Senior Member
Join Date: Nov 2011
Location: U.S.
Old 04-15-2013 , 02:11   Re: [TF2] Friendly Mode
Reply With Quote #37

Quote:
Originally Posted by Sreaper View Post
Looks nice. Will it also remove the player's collision to prevent griefing?
Yes this absolutely needs to happen. Some kind of decal or particle that denotes a player as friendly would be helpful too, so people that are fighting don't waste their time on people that can't be killed.
Helvetica is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-15-2013 , 03:09   Re: [TF2] Friendly Mode
Reply With Quote #38

You have to search for them with findentitybyclassname, and hook entity "player"
To change hitbox, just change their surroundingvexmins and surroundingvecmaxs if i recall correctly, just make four static float arrays, two for reducing hitbox, and two for restoring it.

Another problem... Not sure if this will impact you.
If you set the notarget flag before inventory application, clients will not recieve their items properly, and will become civilian mode. Similarly, it can hapen when they touch a supply locker when under the effect of notarget... items will not be generated properly. This is most noticable when they have advanced options set to not move them in their spawn room when respawning.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 04-15-2013 at 03:16.
friagram is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-15-2013 , 04:01   Re: [TF2] Friendly Mode
Reply With Quote #39

Quote:
Originally Posted by friagram View Post
You have to search for them with findentitybyclassname, and hook entity "player"
You make it sound so simple, lol.

Quote:
To change hitbox, just change their surroundingvexmins and surroundingvecmaxs if i recall correctly, just make four static float arrays, two for reducing hitbox, and two for restoring it.
Wouldn't resizing the hitbox also change the player's perspective? When I resize myself with sm_resize, I find that my perspective changes to match my new size and hitbox. When changing my size to extremely small amounts, I find that my perspective drops to below the floor beneath me. Wouldn't this be an issue with the method you have suggested? Or is the perspective changing a special feature of sm_Resize?

Further, wouldn't just removing collision be good enough? There simply MUST be a way for players marked as "friendly" to have a complete lack of collision with all other players. And I recall reading somewhere that removing a player's collision in TF2 also causes projectiles and hitscan bullets to pass through them? I'm probably wrong though.

EDIT: Unless of course you mean that I would only reduce the width and depth of the hitboxes, and not the height. That's an interesting idea to me, but it seems like players would be able to fall into strange places that they would normally be to big to fit into?

Quote:
Another problem... Not sure if this will impact you.
If you set the notarget flag before inventory application, clients will not recieve their items properly, and will become civilian mode. Similarly, it can hapen when they touch a supply locker when under the effect of notarget... items will not be generated properly. This is most noticable when they have advanced options set to not move them in their spawn room when respawning.
When does "inventory application" take place? I don't seem to be having an issue with civvie mode. I did at one point, but an update I've put out since seems to have solved it. No idea what I did to fix it; I seem to recall it having something to do with sm_friendly_remember.



I'm at the point now where simple logic and copy/paste prowess no longer serve me to the extents that I need. :\ Updating the plugin any further will be a fulfilling challenge.

Last edited by ddhoward; 04-15-2013 at 04:14.
ddhoward is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-15-2013 , 07:49   Re: [TF2] Friendly Mode
Reply With Quote #40

Changing their mins and maxs will prevent them from being targeted by stuff... Wranglers, sentries, bullets, projectiles will go through them. Making them unsolid will, for the most part, allow projectiles to pass through them.. However hitscan weapons will still hit them and stop (i think).. Uless you change their collision type to something strange, but then they most likely wont be able to activate triggers, so doors won't work. I could be wrong. If you find collision properties that let them be targeted by mousever, but not wrangler, sentry, bullets, projectiles, while also allowing triggers to activate, let me know. It would be better than messing with the mins and maxs because it makes the player harder to target or makes it harder for them to activate triggers, since triggers have to touch the mins or maxs to activate.

Perspective is set by eye position attachment point on the model... I think, or it is calculated some other way. The mins and maxs is not exactly the hitbox.. It is used for simpler calculations. Changing the players mins and maxs will not alter perspective like changing model scale with the resize plugin. Hitboxes for player models are actually many, and follow bone movement to detect location damage. Sorry for confusion.

Inventory application happens every time a player is given items... On spawn or cabinet touch, or by the sourcemod function regenerateplayer.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 12:32.


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