Jump to content

Stoiss

Members
  • Posts

    481
  • Joined

  • Last visited

Posts posted by Stoiss

  1. relax guys :P i have plans for making a new video at some point :P ofc Uniq could show the fps in his pic :P

     

    the scope view is still a little buggy as it renderer 2 times on the same screen i hope this can be fixed at some point. but im pretty happy how the scopes works now :)

  2. the md3 is for proj and view model eez :) glm files is the one there is in the players hand when you see him in 3 person view for what i can understand from it

     

    byt the problem Mau has it that he needs to turn the grenades hand tag so it is in side the hand and not out side as it is seeing in this pic here.

     

    @@DT85 knows how to to it, so he might be able to help with this one here :)

  3. Found the dependece in clientthink function, but is deep inside, into the core of the code.

    Clientthink is a function too much important and too much things depend on it. edit function or make a new "clientthink2" function only for a force power is not really a good solution. i wanna try with this edit:

    void ClientThink( int clientNum, usercmd_t *ucmd ) {
        gentity_t *ent;
        qboolean restore_ucmd = qfalse;
        usercmd_t sav_ucmd = {0};
    
        ent = g_entities + clientNum;
    
        if ( ent->s.number<MAX_CLIENTS )
        {
            if ( ent->client->ps.viewEntity > 0 && ent->client->ps.viewEntity < ENTITYNUM_WORLD )
            {//you're controlling another NPC
                gentity_t *controlled = &g_entities[ent->client->ps.viewEntity];
                qboolean freed = qfalse;
                if ( controlled->NPC
                    && controlled->NPC->controlledTime
                    && ent->client->ps.forcePowerLevel[FP_TELEPATHY] > FORCE_LEVEL_3 ||
                    controlled->NPC && controlled->NPC->controlledTime
                    && ent->client->ps.forcePowerLevel[FP_CONTROLMIND] > FORCE_LEVEL_0 )
                {//An NPC I'm controlling with mind trick
                    if ( controlled->NPC->controlledTime < level.time )
                    {//time's up!
                        G_ClearViewEntity( ent );
                        freed = qtrue;
                    }
                    else if ( ucmd->upmove > 0 )
                    {//jumping gets you out of it FIXME: check some other button instead... like ESCAPE... so you could even have total control over an NPC?
                        G_ClearViewEntity( ent );
                        ucmd->upmove = 0;//ucmd->buttons = 0;
                        //stop player from doing anything for a half second after
                        ent->aimDebounceTime = level.time + 500;
                        freed = qtrue;
                    }
                }
                else if ( controlled->client //an NPC
                    && PM_GentCantJump( controlled ) //that cannot jump
                    && controlled->client->moveType != MT_FLYSWIM ) //and does not use upmove to fly
                {//these types use jump to get out
                    if ( ucmd->upmove > 0 )
                    {//jumping gets you out of it FIXME: check some other button instead... like ESCAPE... so you could even have total control over an NPC?
                        G_ClearViewEntity( ent );
                        ucmd->upmove = 0;//ucmd->buttons = 0;
                        //stop player from doing anything for a half second after
                        ent->aimDebounceTime = level.time + 500;
                        freed = qtrue;
                    }
                }
    
                if ( !freed )
                {//still controlling, save off my ucmd and clear it for my actual run through pmove
                    restore_ucmd = qtrue;
                    memcpy( &sav_ucmd, ucmd, sizeof( usercmd_t ) );
                    memset( ucmd, 0, sizeof( usercmd_t ) );
                    //to keep pointing in same dir, need to set ucmd->angles
                    ucmd->angles[PITCH] = ANGLE2SHORT( ent->client->ps.viewangles[PITCH] ) - ent->client->ps.delta_angles[PITCH];
                    ucmd->angles[YAW] = ANGLE2SHORT( ent->client->ps.viewangles[YAW] ) - ent->client->ps.delta_angles[YAW];
                    ucmd->angles[ROLL] = 0;
                    if ( controlled->NPC )
                    {
                        VectorClear( controlled->client->ps.moveDir );
                        controlled->client->ps.speed = (sav_ucmd.buttons&BUTTON_WALKING)?controlled->NPC->stats.walkSpeed:controlled->NPC->stats.runSpeed;
                    }
                }
                else
                {
                    ucmd->angles[PITCH] = ANGLE2SHORT( ent->client->ps.viewangles[PITCH] ) - ent->client->ps.delta_angles[PITCH];
                    ucmd->angles[YAW] = ANGLE2SHORT( ent->client->ps.viewangles[YAW] ) - ent->client->ps.delta_angles[YAW];
                    ucmd->angles[ROLL] = 0;
                }
            }
            else if ( ent->client->NPC_class == CLASS_ATST )
            {
                if ( ucmd->upmove > 0 )
                {//get out of ATST
                    GEntity_UseFunc( ent->activator, ent, ent );
                    ucmd->upmove = 0;//ucmd->buttons = 0;
                }
            }
    
    
            PM_CheckForceUseButton( ent, ucmd );
        }
    
        Vehicle_t *pVeh = NULL;
    
        // Rider logic.
        // NOTE: Maybe this should be extracted into a RiderUpdate() within the vehicle.
        if ( ( pVeh = G_IsRidingVehicle( ent ) ) != 0  )
        {
            // If we're still in the vehicle...
            if ( pVeh->m_pVehicleInfo->UpdateRider( pVeh, ent, ucmd ) )
            {
                restore_ucmd = qtrue;
                memcpy( &sav_ucmd, ucmd, sizeof( usercmd_t ) );
                memset( ucmd, 0, sizeof( usercmd_t ) );
                //to keep pointing in same dir, need to set ucmd->angles
                //ucmd->angles[PITCH] = ANGLE2SHORT( ent->client->ps.viewangles[PITCH] ) - ent->client->ps.delta_angles[PITCH];
                //ucmd->angles[YAW] = ANGLE2SHORT( ent->client->ps.viewangles[YAW] ) - ent->client->ps.delta_angles[YAW];
                //ucmd->angles[ROLL] = 0;
                ucmd->angles[PITCH] = sav_ucmd.angles[PITCH];
                ucmd->angles[YAW] = sav_ucmd.angles[YAW];
                ucmd->angles[ROLL] = sav_ucmd.angles[ROLL];
                //if ( sav_ucmd.weapon != ent->client->ps.weapon && PM_WeaponOkOnVehicle( sav_ucmd.weapon ) )
                {//trying to change weapons to a valid weapon for this vehicle, to preserve this weapon change command
                    ucmd->weapon = sav_ucmd.weapon;
                }
                //else
                {//keep our current weapon
                //    ucmd->weapon = ent->client->ps.weapon;
                //    if ( ent->client->ps.weapon != WP_NONE )
                    {//not changing weapons and we are using one of our weapons, not using vehicle weapon
                        //so we actually want to do our fire weapon on us, not the vehicle
                        ucmd->buttons = (sav_ucmd.buttons&(BUTTON_ATTACK|BUTTON_ALT_ATTACK));
                //        sav_ucmd.buttons &= ~ucmd->buttons;
                    }
                }
            }
        }
    
        ent->client->usercmd = *ucmd;
    
    //    if ( !g_syncronousClients->integer )
        {
            ClientThink_real( ent, ucmd );
        }
    
        // If a vehicle, make sure to attach our driver and passengers here (after we pmove, which is done in Think_Real))
        if ( ent->client && ent->client->NPC_class == CLASS_VEHICLE )
        {
            pVeh = ent->m_pVehicle;
            pVeh->m_pVehicleInfo->AttachRiders( pVeh );
        }
    
    
        // ClientThink_real can end up freeing this ent, need to check
        if ( restore_ucmd && ent->client )
        {//restore ucmd for later so NPC you're controlling can refer to them
            memcpy( &ent->client->usercmd, &sav_ucmd, sizeof( usercmd_t ) );
        }
    
        if ( ent->s.number )
        {//NPCs drown, burn from lava, etc, also
            P_WorldEffects( ent );
        }
    }
    

    Should work with the two powers, not only with FP_MINDTRICK level 4. now i will test.  :

    AH YES! IT WORKS! YEAAH! :D

     

    Now i need just to end the forcefreeze! :D

    you could also take does if statements and make them in to a new function name, and then call them from clientthink and do a sec one also for you new mind control stuff like have one function call MindControle(); and Mindtrick(); in clientthink but looks like you got your stuff working so nvm :P

×
×
  • Create New...