AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Advanced Coders] [Brainstorm] Semi-Clip Fix? (https://forums.alliedmods.net/showthread.php?t=82061)

Styles 12-16-2008 13:49

[Advanced Coders] [Brainstorm] Semi-Clip Fix?
 
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?

danielkza 12-16-2008 13:51

Re: [Advanced Coders] [Brainstorm] Semi-Clip Fix?
 
One solution maybe hooking FM_ShouldCollide, but I never found out how it works.

Styles 12-16-2008 13:52

Re: [Advanced Coders] [Brainstorm] Semi-Clip Fix?
 
Humm... I've never seen that before, I'll take a look now.

stupok 12-17-2008 00:13

Re: [Advanced Coders] [Brainstorm] Semi-Clip Fix?
 
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.

SchlumPF* 12-17-2008 00:43

Re: [Advanced Coders] [Brainstorm] Semi-Clip Fix?
 
1 Attachment(s)
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


All times are GMT -4. The time now is 09:17.

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