Raised This Month: $ Target: $400
 0% 

[Advanced Coders] [Brainstorm] Semi-Clip Fix?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 12-16-2008 , 13:49   [Advanced Coders] [Brainstorm] Semi-Clip Fix?
Reply With Quote #1

hey, as many of you know, there's a few "semi-clips" out there. But they all have some sort of problem. I can't remeber where but, one works great until your on a "train" entity then it breaks that entity your standing on and causes it not to move.

Another way is the common way. SOLID_NOT. Now the only issue with this is, once you become SOLID_NOT, you can't "touch" things anymore. So entity triggers don't always work like hurt.

Now, I am trying to think of a fix for this.. the best I can come up with at this point is to do a trace line down. And if your < 2 units from an entity below you, grab it's name, if it has a classname of xyz (idk like entities that hurt you, I can't think of the name atm.), then remove SOLID_NOT. But ... yea.. .any other ideas?
Styles is offline
Send a message via AIM to Styles
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-16-2008 , 13:51   Re: [Advanced Coders] [Brainstorm] Semi-Clip Fix?
Reply With Quote #2

One solution maybe hooking FM_ShouldCollide, but I never found out how it works.
__________________

Community / No support through PM
danielkza is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 12-16-2008 , 13:52   Re: [Advanced Coders] [Brainstorm] Semi-Clip Fix?
Reply With Quote #3

Humm... I've never seen that before, I'll take a look now.
Styles is offline
Send a message via AIM to Styles
stupok
Veteran Member
Join Date: Feb 2006
Old 12-17-2008 , 00:13   Re: [Advanced Coders] [Brainstorm] Semi-Clip Fix?
Reply With Quote #4

From client.cpp:
Code:
/*
================================
ShouldCollide

  Called when the engine believes two entities are about to collide. Return 0 if you
  want the two entities to just pass through each other without colliding or calling the
  touch function.
================================
*/
int ShouldCollide( edict_t *pentTouched, edict_t *pentOther )
{
	// To make this a fast check, use iuser4 for the discs to know what other discs they should collide with
	if ( pentTouched->v.iuser4 != 0 && pentOther->v.iuser4 != 0 )
	{
		// Two friendly discs will have matching iuser4's
		if ( pentTouched->v.iuser4 == pentOther->v.iuser4 )
		{
			return 0;
		}

		// Discs hitting their owners
		CBaseEntity *pTouched = CBaseEntity::Instance(pentTouched);
		CBaseEntity *pOther = CBaseEntity::Instance(pentOther);
		/*
		if ( pOther->IsDisc() && pTouched->IsPlayer() && ((CDisc*)pOther)->m_hOwner == pTouched )
			return 0;
		if ( pTouched->IsDisc() && pOther->IsPlayer() && ((CDisc*)pTouched)->m_hOwner == pOther )
			return 0;
		*/
		//if ( pOther->IsDisc() || pTouched->IsDisc() )
			//return 0;
	}

	return 1;
}
I don't know what Instance() does, so I can't explain this. I'm pretty sure that ShouldCollide is not really used. It was probably just left in the source.
__________________
stupok is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 12-17-2008 , 00:43   Re: [Advanced Coders] [Brainstorm] Semi-Clip Fix?
Reply With Quote #5

what about http://forums.alliedmods.net/showthread.php?t=69728 + these fixes: http://forums.alliedmods.net/showpos...6&postcount=26 http://forums.alliedmods.net/showpos...8&postcount=32 (rather check for a trigger_gravity in the map and if yes use that fix)

never had problems with it and there is just one bug left for that semiclip which is in every semiclip so far: if you try to spec a semiclipped player through hltv it looks really ugly xD dunno how to impress me but i guess it has sth to with pev_angles + roll

edit:
i just remember that i read somewhere (i think it was in hawks semiclip tutorial) that shouldcollide is called very often + it doesnt work properly for semiclip

+ i found this fix for the old semiclip method which just sets pev_solid
Attached Files
File Type: sma Get Plugin or Get Source (tpfix.sma - 618 views - 3.7 KB)
__________________

Last edited by SchlumPF*; 04-05-2009 at 21:23.
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
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 09:17.


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