AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   Module: Orpheu (v2.6.3) (https://forums.alliedmods.net/showthread.php?t=116393)

meTaLiCroSS 01-23-2010 23:37

Re: Module: Orpheu2
 
Maybe isn't the best place to ask this, but how i can get the origin of the player's weapon first attachment?

AntiBots 01-24-2010 03:37

Re: Module: Orpheu2
 
Now work in Windows? WoW!!

Arkshine 01-24-2010 06:03

Re: Module: Orpheu2
 
Quote:

Originally Posted by meTaLiCroSS (Post 1065251)
Maybe isn't the best place to ask this, but how i can get the origin of the player's weapon first attachment?

Yes, that's not the right place. You could use Orpheu though, but you can use EngFunc_GetAttachment too.

hlstriker 01-24-2010 06:38

Re: Module: Orpheu2
 
This is really cool, good job :D

SnoW 01-24-2010 07:08

Re: Module: Orpheu2
 
Thank you Joa and everyone involved. I'll surely look into this.

meTaLiCroSS 01-24-2010 18:42

Re: Module: Orpheu2
 
Quote:

Originally Posted by Arkshine (Post 1065522)
Yes, that's not the right place. You could use Orpheu though, but you can use EngFunc_GetAttachment too.

With EngFunc_GetAttachment you don't get a weapon attachment :-/, you only get the player's model attachment.

Arkshine 01-24-2010 19:45

Re: Module: Orpheu2
 
You're right. You need to do what exactly with the weapon attachment ?

meTaLiCroSS 01-25-2010 13:43

Re: Module: Orpheu2
 
Quote:

Originally Posted by Arkshine (Post 1066420)
You're right. You need to do what exactly with the weapon attachment ?

Get his origin to do something, like a beam, effects, or something, like the HL Egon.

Code:

void CEgon::CreateEffect( void )
{

#ifndef CLIENT_DLL
    DestroyEffect();

    m_pBeam = CBeam::BeamCreate( EGON_BEAM_SPRITE, 40 );
    m_pBeam->PointEntInit( pev->origin, m_pPlayer->entindex() );
    m_pBeam->SetFlags( BEAM_FSINE );
    m_pBeam->SetEndAttachment( 1 );
    m_pBeam->pev->spawnflags |= SF_BEAM_TEMPORARY;    // Flag these to be destroyed on save/restore or level transition
    m_pBeam->pev->flags |= FL_SKIPLOCALHOST;
    m_pBeam->pev->owner = m_pPlayer->edict();

    m_pNoise = CBeam::BeamCreate( EGON_BEAM_SPRITE, 55 );
    m_pNoise->PointEntInit( pev->origin, m_pPlayer->entindex() );
    m_pNoise->SetScrollRate( 25 );
    m_pNoise->SetBrightness( 100 );
    m_pNoise->SetEndAttachment( 1 );
    m_pNoise->pev->spawnflags |= SF_BEAM_TEMPORARY;
    m_pNoise->pev->flags |= FL_SKIPLOCALHOST;
    m_pNoise->pev->owner = m_pPlayer->edict();

    m_pSprite = CSprite::SpriteCreate( EGON_FLARE_SPRITE, pev->origin, FALSE );
    m_pSprite->pev->scale = 1.0;
    m_pSprite->SetTransparency( kRenderGlow, 255, 255, 255, 255, kRenderFxNoDissipation );
    m_pSprite->pev->spawnflags |= SF_SPRITE_TEMPORARY;
    m_pSprite->pev->flags |= FL_SKIPLOCALHOST;
    m_pSprite->pev->owner = m_pPlayer->edict();

    if ( m_fireMode == FIRE_WIDE )
    {
        m_pBeam->SetScrollRate( 50 );
        m_pBeam->SetNoise( 20 );
        m_pNoise->SetColor( 50, 50, 255 );
        m_pNoise->SetNoise( 8 );
    }
    else
    {
        m_pBeam->SetScrollRate( 110 );
        m_pBeam->SetNoise( 5 );
        m_pNoise->SetColor( 80, 120, 255 );
        m_pNoise->SetNoise( 2 );
    }
#endif

}

I've found that in egon.cpp, see the black lines, what do the func SetEndAttachment?

joropito 01-25-2010 14:25

Re: Module: Orpheu2
 
This is what it does
PHP Code:

inline void SetEndAttachmentint attachment ) {
      
pev->skin = (pev->skin 0x0FFF) | ((attachment&0xF)<<12);



Arkshine 01-25-2010 15:18

Re: Module: Orpheu2
 
It attaches the entity on the weapon attachment 1 I guess, something like. But you can do that probably because it a custom entity (FL_CUSTOMENTITY).

I remember you can use too the weapon attachment with the player id and TE_BEAMENTS for example. ( eg : id | 0x2000 )

Anyway I'm going to do some research on it, long time i wanted to do this weapon.

[edit] Btw, you can do it without orpheu.


All times are GMT -4. The time now is 05:32.

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