Hlavn strnka    Vyhadvanie       Homepage    Registrcia   Prihlsenie
Rubriky
Tutorily
Recenzie
Rzne
Vyhadvanie
Odkazy
lenovia
Download
FRUM
IRC kanl
IRC web klient
GALRIA
Tutorily na XSI
RSS
Registrcia
Diskusn boardy
  • The lambda
  • Mapping
  • Modeling
  • Coding
  • Half-Life

  • Najnovie lnky
    Automatická textová správa
    Vocko Tutoril
    07.06.2009 : 11:02:12
    V tomto tutoriále si spravíme automatickú textovú správu, ktorá sa prehraje vždy s nejakým zvukom.
    Kompilovanie SDK aj na VC++ .Net 2003
    Vocko Tutoril
    10.05.2009 : 10:46:16
    Kto by si chcel pod¾a tutoriálov tu na lambde nieèo prida do kódu, stretne sa s problémom, neskompiluje to.
    Env_mirror alebo zrkadlenie modelov
    Vocko Tutoril
    24.04.2009 : 18:49:30
    Tutoriál na zrkadlenie tu už je, ale èo ak chceme odráža i modely? Na tom nám poslúži entita env_mirror, ktorá sa nachádza iba v Spirite 1.4 alebo novšej verzii.
    HL2 : Obloukový prùchod
    R4z0r Tutoril
    01.05.2008 : 05:48:46
    Dnes si ukážeme zpùsob, jak vytvoøit elegantní obloukový prùchod, bez nutnosti používat øezání geometrie brushem...
    Pridanie zoomu do mp5
    NICKSss Tutoril
    03.03.2008 : 18:55:16

    No,dnes si povieme ako prida zoom na mp5-ku namiesto granátu.
    Pridanie mp3 do spiritu
    NICKSss Tutoril
    02.03.2008 : 20:55:09

    Návod na pridanie mp3 do Half-Life 1 alebo Spirt 1.2,otestované na verzii 1.2.

    Asi už mate zbrane add-ons vo Spirite 1.2 a nechcete prejst na ver.1.4 lebo všetko stratite

    pre Mp3... Na internete som našiel návody pre HL1 a po anglicky ktoré po skompilovani

    fungovali asi takto : Aplikácia HL.EXE Neodpovedá...
    *locus
    Deli Tutoril
    22.02.2008 : 20:13:47
    Pre niektorých mapperov neznámy pojem, ale pre niektorých ve¾mi úèinná pomôcka.
    Vïaka tomuto príspevku sa vám posnažím priblíži tajomstvá jednej z najväèších zbraní spiritu.
    Spirit of Half-Life - Predstavenie
    Wizz Tutoril
    27.10.2007 : 08:52:04
    Predtým než sa pustíte do èítania, chcel by som Vás upozorni že èlánok už nemusí by 100% aktualny. Èlánok som totiž napísal ešte za svojich mladých èias - 13. júna 2004, èo je viac ako tri roky. Zverejni som sa ho rozhodol po nátlaku a výhražkach ostatných redaktorov
    Smoke grenade
    qery
    [17.05.2004 : 18:41:11] 112 Tutoril
    tan : 2808
    Priemern znmka : 2
    Dnes sa pokúsime vytvori smoke grenade èiže dymivý granát :D

    Nakolko to èítam z vlastných zdrojákoch, ktoré som písal neskoro v noci, dúfam ze tam nezabudnem niè napísa. Keby to niekomu náhodou nechcelo chodi tak mi pls napíšte nejakú správu aby som to mohol opravi.



    Zaèneme tým, že si do adresára VALVE\MODELS nahráme súbory p_smokegrenade.mdl, v_smokegrenade.mdl a w_smokegrenade.mdl. Ïalej vytvoríme súbor smokegrenade.cpp, ktorý bude obsahova nasledujúci text:



    #include "extdll.h"
    #include "util.h"
    #include "cbase.h"
    #include "monsters.h"
    #include "weapons.h"
    #include "nodes.h"
    #include "player.h"

    #define SMOKEGRENADE_PRIMARY_VOLUME 450

    enum smokegrenade_e
    {
    SMOKEGRENADE_IDLE = 0,
    SMOKEGRENADE_PINPULL,
    SMOKEGRENADE_THROW1, // toss
    SMOKEGRENADE_DRAW
    };

    class CSmokeGrenade : public CBasePlayerWeapon
    {
    public:
    void Spawn( void );
    void Precache( void );
    int iItemSlot( void ) { return 5; }
    int GetItemInfo(ItemInfo *p);

    void PrimaryAttack( void );
    BOOL Deploy( void );
    BOOL CanHolster( void );
    void Holster( int skiplocal = 0 );
    void WeaponIdle( void );
    float m_flStartThrow;
    float m_flReleaseThrow;
    };
    LINK_ENTITY_TO_CLASS( weapon_smokegrenade, CSmokeGrenade );

    void CSmokeGrenade::Spawn( )
    {
    Precache( );
    m_iId = WEAPON_SMOKEGRENADE;
    SET_MODEL(ENT(pev), "models/w_smokegrenade.mdl");

    pev->dmg = 0;
    m_iDefaultAmmo = SMOKEGRENADE_DEFAULT_GIVE;
    FallInit();// get ready to fall down.
    }


    void CSmokeGrenade::Precache( void )
    {
    PRECACHE_MODEL("models/w_smokegrenade.mdl");
    PRECACHE_MODEL("models/v_smokegrenade.mdl");
    PRECACHE_MODEL("models/p_smokegrenade.mdl");
    }

    int CSmokeGrenade::GetItemInfo(ItemInfo *p)
    {
    p->pszName = STRING(pev->classname);
    p->pszAmmo1 = "Hand Grenade";
    p->iMaxAmmo1 = SMOKEGRENADE_MAX_CARRY;
    p->pszAmmo2 = NULL;
    p->iMaxAmmo2 = -1;
    p->iMaxClip = WEAPON_NOCLIP;
    p->iSlot = 4;
    p->iPosition = 4;
    p->iId = m_iId = WEAPON_SMOKEGRENADE;
    p->iWeight = SMOKEGRENADE_WEIGHT;
    p->iFlags = ITEM_FLAG_LIMITINWORLD | ITEM_FLAG_EXHAUSTIBLE;

    return 1;
    }

    BOOL CSmokeGrenade::Deploy( )
    {
    m_flReleaseThrow = -1;
    return DefaultDeploy( "models/v_smokegrenade.mdl", "models/p_smokegrenade.mdl", SMOKEGRENADE_DRAW, "crowbar" );
    }

    BOOL CSmokeGrenade::CanHolster( void )
    {
    // can only holster hand grenades when not primed!
    return ( m_flStartThrow == 0 );
    }

    void CSmokeGrenade::Holster( int skiplocal /* = 0 */ )
    {
    m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
    if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
    {
    SendWeaponAnim( SMOKEGRENADE_DRAW );
    }
    else
    {
    // no more grenades!
    m_pPlayer->pev->weapons &= ~(1< SetThink( DestroyItem );
    pev->nextthink = gpGlobals->time + 0.1;
    }

    EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM);
    }

    void CSmokeGrenade::PrimaryAttack()
    {
    if (!m_flStartThrow && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] > 0)
    {
    m_flStartThrow = gpGlobals->time;
    m_flReleaseThrow = 0;

    SendWeaponAnim( SMOKEGRENADE_PINPULL );
    m_flTimeWeaponIdle = gpGlobals->time + 0.5;
    }
    }


    void CSmokeGrenade::WeaponIdle( void )
    {
    if (m_flReleaseThrow == 0)
    m_flReleaseThrow = gpGlobals->time;

    if (m_flTimeWeaponIdle > gpGlobals->time)
    return;

    if (m_flStartThrow)
    {
    Vector angThrow = m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle;

    if (angThrow.x < 0)
    angThrow.x = -10 + angThrow.x * ((90 - 10) / 90.0);
    else
    angThrow.x = -10 + angThrow.x * ((90 + 10) / 90.0);

    float flVel = (90 - angThrow.x) * 4;
    if (flVel > 500)
    flVel = 500;

    UTIL_MakeVectors( angThrow );

    Vector vecSrc = m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16;

    Vector vecThrow = gpGlobals->v_forward * flVel + m_pPlayer->pev->velocity;

    // alway explode 3 seconds after the pin was pulled
    float time = m_flStartThrow - gpGlobals->time + 3.0;
    if (time < 0)
    time = 0;

    CGrenade::SmokeShootTimed( m_pPlayer->pev, vecSrc, vecThrow, time );

    SendWeaponAnim( SMOKEGRENADE_THROW1 );

    // player "shoot" animation
    m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

    m_flStartThrow = 0;
    m_flNextPrimaryAttack = gpGlobals->time + 0.5;
    m_flTimeWeaponIdle = gpGlobals->time + 0.5;

    m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;

    if ( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] )
    {
    // just threw last grenade
    // set attack times in the future, and weapon idle in the future so we can see the whole throw
    // animation, weapon idle will automatically retire the weapon for us.
    m_flTimeWeaponIdle = m_flNextSecondaryAttack = m_flNextPrimaryAttack = gpGlobals->time + 0.5;// ensure that the animation can finish playing
    }
    return;
    }
    else if (m_flReleaseThrow > 0)
    {
    // we've finished the throw, restart.
    m_flStartThrow = 0;

    if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
    {
    SendWeaponAnim( SMOKEGRENADE_DRAW );
    }
    else
    {
    RetireWeapon();
    return;
    }

    m_flTimeWeaponIdle = gpGlobals->time + RANDOM_FLOAT ( 10, 15 );
    m_flReleaseThrow = -1;
    return;
    }

    if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
    {
    int iAnim;
    float flRand = RANDOM_FLOAT(0, 1);
    if (flRand <= 0.75)
    {
    iAnim = SMOKEGRENADE_IDLE;
    m_flTimeWeaponIdle = gpGlobals->time + RANDOM_FLOAT ( 10, 15 );// how long till we do this again.
    }
    else
    {
    iAnim = SMOKEGRENADE_IDLE;
    m_flTimeWeaponIdle = gpGlobals->time + 75.0 / 30.0;
    }

    SendWeaponAnim( iAnim );
    }
    }


    Ïalej si otvoríme súbor ggrenade.cpp vymeníme nasledujúce procedúry:



    void CGrenade::Smoke( void )
    {
    if (UTIL_PointContents ( pev->origin ) == CONTENTS_WATER)
    {
    UTIL_Bubbles( pev->origin - Vector( 64, 64, 64 ), pev->origin + Vector( 64, 64, 64 ), 100 );
    }
    else
    {
    if (pev->dmg==1)
    {
    int mytemp;
    for (mytemp=0;mytemp<20+RANDOM_FLOAT(-2,10);mytemp++)
    {
    MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin );
    WRITE_BYTE( TE_SMOKE );
    WRITE_COORD( pev->origin.x + RANDOM_FLOAT(-25, 25));
    WRITE_COORD( pev->origin.y + RANDOM_FLOAT(-15, 15));
    WRITE_COORD( pev->origin.z + RANDOM_FLOAT(-25, 25));
    WRITE_SHORT( g_sModelIndexSmoke );
    WRITE_BYTE( 50 + RANDOM_FLOAT(-10, 10)); // scale * 10
    WRITE_BYTE( RANDOM_FLOAT(1, 6)); // framerate
    MESSAGE_END();
    }
    /*MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin );
    WRITE_BYTE( TE_SMOKE );
    WRITE_COORD( pev->origin.x );
    WRITE_COORD( pev->origin.y );
    WRITE_COORD( pev->origin.z );
    WRITE_SHORT( g_sModelIndexSmoke );
    WRITE_BYTE( 50 ); // scale * 10
    WRITE_BYTE(3 ); // framerate
    MESSAGE_END();*/
    }
    else
    {
    MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin );
    WRITE_BYTE( TE_SMOKE );
    WRITE_COORD( pev->origin.x );
    WRITE_COORD( pev->origin.y );
    WRITE_COORD( pev->origin.z );
    WRITE_SHORT( g_sModelIndexSmoke );
    WRITE_BYTE( (pev->dmg - 50) * 0.80 ); // scale * 10
    WRITE_BYTE( 12 ); // framerate
    MESSAGE_END();
    }
    }

    UTIL_Remove( this );
    }

    void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType )
    {
    float flRndSound;// sound randomizer

    pev->model = iStringNull;//invisible
    pev->solid = SOLID_NOT;// intangible

    pev->takedamage = DAMAGE_NO;

    // Pull out of the wall a bit
    if ( pTrace->flFraction != 1.0 )
    {
    if (pev->dmg==1)
    {
    pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * 76 * 0.6);
    }
    else
    {
    pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24) * 0.6);
    }
    }

    int iContents = UTIL_PointContents ( pev->origin );

    if (pev->dmg==1)
    {
    }
    else
    {
    MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, pev->origin );
    WRITE_BYTE( TE_EXPLOSION ); // This makes a dynamic light and the explosion sprites/sound
    WRITE_COORD( pev->origin.x ); // Send to PAS because of the sound
    WRITE_COORD( pev->origin.y );
    WRITE_COORD( pev->origin.z );
    if (iContents != CONTENTS_WATER)
    {
    WRITE_SHORT( g_sModelIndexFireball );
    }
    else
    {
    WRITE_SHORT( g_sModelIndexWExplosion );
    }
    WRITE_BYTE( (pev->dmg - 50) * .60 ); // scale * 10
    WRITE_BYTE( 15 ); // framerate
    WRITE_BYTE( TE_EXPLFLAG_NONE );
    MESSAGE_END();
    }
    CSoundEnt::InsertSound ( bits_SOUND_COMBAT, pev->origin, NORMAL_EXPLOSION_VOLUME, 3.0 );
    entvars_t *pevOwner;
    if ( pev->owner )
    pevOwner = VARS( pev->owner );
    else
    pevOwner = NULL;

    pev->owner = NULL; // can't traceline attack owner if this is set

    RadiusDamage ( pev, pevOwner, pev->dmg -1, CLASS_NONE, bitsDamageType );

    if (pev->dmg==1)
    {
    }
    else
    {
    if ( RANDOM_FLOAT( 0 , 1 ) < 0.5 )
    {
    UTIL_DecalTrace( pTrace, DECAL_SCORCH1 );
    }
    else
    {
    UTIL_DecalTrace( pTrace, DECAL_SCORCH2 );
    }
    }

    flRndSound = RANDOM_FLOAT( 0 , 1 );

    switch ( RANDOM_LONG( 0, 2 ) )
    {
    case 0: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/debris1.wav", 0.55, ATTN_NORM); break;
    case 1: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/debris2.wav", 0.55, ATTN_NORM); break;
    case 2: EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/debris3.wav", 0.55, ATTN_NORM); break;
    }

    pev->effects |= EF_NODRAW;
    SetThink( Smoke );
    pev->velocity = g_vecZero;
    pev->nextthink = gpGlobals->time + 0.3;

    if (iContents != CONTENTS_WATER)
    {
    int sparkCount = RANDOM_LONG(0,3);
    for ( int i = 0; i < sparkCount; i++ )
    Create( "spark_shower", pev->origin, pTrace->vecPlaneNormal, NULL );
    }
    }



    A ešte pridáme túto procedúru:



    CGrenade * CGrenade:: SmokeShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time )
    {
    CGrenade *pGrenade = GetClassPtr( (CGrenade *)NULL );
    pGrenade->Spawn();
    UTIL_SetOrigin( pGrenade->pev, vecStart );
    pGrenade->pev->velocity = vecVelocity;
    pGrenade->pev->angles = UTIL_VecToAngles(pGrenade->pev->velocity);
    pGrenade->pev->owner = ENT(pevOwner);

    pGrenade->SetTouch( BounceTouch ); // Bounce if touched

    // Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate
    // will insert a DANGER sound into the world sound list and delay detonation for one second so that
    // the grenade explodes after the exact amount of time specified in the call to ShootTimed().

    pGrenade->pev->dmgtime = gpGlobals->time + time;
    pGrenade->SetThink( TumbleThink );
    pGrenade->pev->nextthink = gpGlobals->time + 0.1;
    if (time < 0.1)
    {
    pGrenade->pev->nextthink = gpGlobals->time;
    pGrenade->pev->velocity = Vector( 0, 0, 0 );
    }

    pGrenade->pev->sequence = RANDOM_LONG( 3, 6 );
    pGrenade->pev->framerate = 1.0;

    // Tumble through the air
    // pGrenade->pev->avelocity.x = -400;

    pGrenade->pev->gravity = 0.5;
    pGrenade->pev->friction = 0.8;

    SET_MODEL(ENT(pGrenade->pev), "models/w_smokegrenade.mdl");
    pGrenade->pev->dmg = 1;

    return pGrenade;
    }



    A samozrejme nesmieme zabudnú na WEAPONS.H kde pridáme tieto riadky:



    #define WEAPON_SMOKEGRENADE 20
    #define SMOKEGRENADE_WEIGHT 5
    #define SMOKEGRENADE_MAX_CARRY 5
    #define SMOKEGRENADE_MAX_CLIP WEAPON_NOCLIP
    #define SMOKEGRENADE_DEFAULT_GIVE 5


    Ïalej nájdeme v súbore WEAPONS.H tento riadok:


    static CGrenade *ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time );


    a zaòho pridáme tento riadok:

    static CGrenade *SmokeShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time );



    V súbore WEAPONS.CPP nájdeme tento riadok:



    UTIL_PrecacheOtherWeapon("weapon_handgrenade");


    a zaòho doplníme tento riadok:


    UTIL_PrecacheOtherWeapon("weapon_smokegrenade");



    A nakoniec v PLAYER.CPP nájdeme riadky:



    case 101:
    gEvilImpulse101 = TRUE;
    GiveNamedItem( "item_suit" );
    GiveNamedItem( "item_battery" );
    GiveNamedItem( "weapon_crowbar" );
    GiveNamedItem( "weapon_9mmhandgun" );
    GiveNamedItem( "ammo_9mmclip" );
    GiveNamedItem( "weapon_shotgun" );
    GiveNamedItem( "ammo_buckshot" );
    GiveNamedItem( "weapon_9mmAR" );
    GiveNamedItem( "ammo_9mmAR" );
    GiveNamedItem( "ammo_ARgrenades" );
    GiveNamedItem( "weapon_handgrenade" );


    a doplníme tam:


    GiveNamedItem( "weapon_smokegrenade" );


    Tak a ak som niekde nespravil chybu tak by to malo zbehnú na prvý pokus.

    BODOVANIE LNKU
    Boduje sa ako v kole (1- vborn, 5-zl)
           

    Priemern znmka : 2
    Hlasovalo : 6

    KOMENTRE KU LNKU
    Poet komentrov ku lnku : 10

    1. Majacik Redaktor
    [20.05.2004-09:26] 222
    neviem kde s to splasil ale je tam asi dost riadkov zbytocne no ja mam doma tiez nejaky smoke tak skusim tvoj a porovnam a zmojim a ked bude moj lepsi tak dam tutu a ked nie tak si dobry

    2. Choosen
    [20.05.2004-10:26] 224
    Veni , vidi , fuck ...

    3. DragoraN
    [20.05.2004-13:44] 228
    vy robite counter-strike z halflifu ci co )

    -- may the wind be on your back --

    4. Majacik Redaktor
    [21.05.2004-17:56] 230
    nie my robime z hl nieco lespie ako CS

    5. Jackar Admin
    [22.05.2004-11:31] 235
    Dobry postreh

    6. qery Admin
    [22.05.2004-12:07] 238
    heh samozrejme ze robyme nieco lepsie ;)

    [rmb]qery
    -=HL4ever=-
    qery.no-ip.com

    7. DragoraN
    [23.05.2004-07:36] 243
    robi ten dymovy granat aj nieco? napr. nevidia cezneho prisery? alebo je to len tak..

    -- may the wind be on your back --

    8. qery Admin
    [23.05.2004-17:04] 245
    myslim ze funguje len v multiplayery. singleplayer som neskusal.

    [rmb]qery
    -=HL4ever=-
    qery.no-ip.com

    9. Wizz Admin
    [24.05.2004-09:31] 249
    no to by sa musela menit dajaka vec u monstier, aby nevidely cez ten sprite. Ale aj tak to tazko spravit aby to bolo funkcne v singleplayeri. Aby napriklad vojaci strielali do dymu a nie presne na teba ...

    10. qery Admin
    [24.05.2004-16:44] 250
    dalo by sa to niekde spravit lebo viem ze to bolo v podbotoch. tam som to kdesi nasiel ked som ix upravoval ;)

    [rmb]qery
    -=HL4ever=-
    qery.no-ip.com

    Pre pridvanie komentrov muste by prihlsen
    Pokia ete nieste zaregistrovan, mete tak urobi TU

    Vyhadvanie

    Rozren vyhadvanie

    AREA 42
    Hlka
    Aj moj komp uz ma alergii na slovo Acer, vzdy kdyz to nekdo napise , tak mi pohasne obraz, DVD Rom se vysune tak rychlo ze tocici se DVD leta po pokoji jak urvana cirkularka a naskoci hlaska neco o prehrati systemu...

    J.D.Skalpel @ ICQ with Jackar

    Starie hlky >> Komentre >>

    Anketa
    Bavi vas aj moding inych hernych zanrov ako FPS ?

    1.Ano, strategie [29%]

    2.Ano, RPG [22%]

    3.Ano, sportove hry [27%]

    4.Nie, ine ako FPS neriesim [23%]

    Spolu hlasovalo : 4040
    Starie ankety >>

    Najtanejie
    1.Atomová bomba ako v crossfire (30862x)
    2.HL2: První kroky (30255x)
    3.Counter-Strike entity (22442x)
    4.Half-Life: Padlé Mìsto demo - Recenze (20427x)
    5.Pozadie pomocou textúry sky (18537x)
    On-Line
    Tieto strnky si prve ta 1 lovek.
    Sponzor webu
    Spriatelen weby
    Ikona na náš web
    Preklady hier, mapy do Half-life a CS, chat a mnoho ïalšieho
    Filmový svet pod lupou
    ceskemody.cz
    HL Zone
    Vše o HL2
    Scifi-guide.net
    Mappersky portal zaoberajuci sa hramy ako CoD1, MoH:AA ci SourceSDK HL2 ale aj mnohymi dalsimi ...
    Nosferatu - novy Slovensky mod o upiroch
    Terrorist attack mod do HL
    PSP novinky, forum, download
    AirSoft Team AlfaCommandos Bratislava
    ICQ - Lamerz bar
    V zujme ochrany duevnho zdravia redaktorov tu u viac ICQ panel nenjdete :P

    Vsledky vaeho snaenia sa mete njs na lamz.thelambda.sk ...

    Vetky texty publikovan na tchto strnkach s majetkom thelambda.sk alebo ich autorov.
    (C) 2003-2006 thelambda.sk VSETKY PRAVA VYHRADENE
    www.TheLambda.SK Enter RS
    Strnka bola natan za 1.17 seknd.