Announcement

Collapse
No announcement yet.

Sanctity Lost

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    It totally messed up the game
    Really? Wow, it's bad!
    I was using a "camera" within my Pawn class without that CalcCamera solution (a-hem, my script below is a mess because it was just for my placeholder without improvements):
    Code:
    class CIPawn extends UTPawn
    placeable;
    
    
    var bool                bIsProned;
    var                     AnimNodeBlend CrouchBlend;
    var float               CrouchEyeHeight;
    var bool                bRun;
    var float		Stamina;
    var float		SprintTimer;
    var float		SprintRecoverTimer;
    var float		Empty;
    var bool		bSprinting;
    var name                AnimName;
    var bool                EnemyClass;
    //var float             AnalogSpeed;
    //var bool              bInterpLocation;
    var Pawn                CIPawn;
    var()bool               bCamShake;
    var bool                MadeNoise;
    
    /////////Camera Switch//////////
    var float               Dist;
    var vector              Loc, Pos;
    var rotator             Rot;
    
    ///////////Grenades/////////
    
    var bool bCanThrowGrenade;
    var int GrenadeCount;
    var bool bThrowingGrenade;
    var bool bIsNapalm;
    var int GrenadeSpreadDist;
    var float ThrowTime;
    var float SpawnGrenTime;
    var int i;
    
    
    ///////////
    
    ///////////Grenade function///////////
    
    exec function GiveGrenade()
    {
    
    
    	if(GrenadeCount >= 4)
    	{
    		return;
    	}
    
    	GrenadeCount++;
    
    
    }
    
    
    //Grenade Throw function
    exec function ThrowGrenade()
    {
    
    
        ConsoleCommand("ThrowGrenade");
    
        if(bThrowingGrenade || GrenadeCount <= 0)
        {
           return;
        }
    
    	//Dont allow grenade throwing
    	bThrowingGrenade=true;
    
        WorldInfo.Game.BroadcastHandler.Broadcast(self, "Throwing Grenade");
    
    	if (bThrowingGrenade)
    	{
    		if ( GrenadeCount > 0 )
    		{
    			TopHalfAnimSlot.PlayCustomAnim( 'Throw', 3.0, 0.2, 0.2, false, true);
    
    			SetTimer(SpawnGrenTime, false, 'CreateGrenade');
    		}
    	}
        SetTimer(ThrowTime, false, 'RefillAmmo');
    }
    
    simulated function RefillAmmo()
    {
        // if we have enough or more ammo than the weapon needs 
        if(GrenadeCount >= 0)
        {
           // subtrack the grenades from our inventory
           GrenadeCount --;
        }
        else
        {
           // empty our inventory from grenades
           GrenadeCount = 0;
        }
    
        // Allow throwing grenades again
        bThrowingGrenade=false;
    }
    
    simulated function CreateGrenade()
    {
    
            local Projectile SpawnedGrenade;
    	local float theta;
            local vector SpreadVector;
    	local rotator Aim;
            local Vector FinalLocation;
    
    	Aim = Weapon.GetAdjustedAim( Location );			// get fire aim direction
    
    	if (bThrowingGrenade || SpawnedGrenade != none)
    	{
    		// Give the grenade some gradual spread.
    		theta = GrenadeSpreadDist * PI / 32768.0 * (i - float(GrenadeCount - 1) / 2.0);
    		SpreadVector.X = Cos(theta);
    		SpreadVector.Y = Sin(theta);
    		SpreadVector.Z = 0.0;
    
    		Mesh.GetSocketWorldLocationAndRotation ('RB_Handle0', FinalLocation);
                    SpawnedGrenade = Spawn(Class 'CI_ThrownItem',self,, FinalLocation, Rotation);
    		UTProjectile(SpawnedGrenade).TossZ += (FRand() * 200 - 100);
    
    	}
    
    	SpawnedGrenade.Init(SpreadVector >> Aim);
    }
    
    
    
    
    ////////////////////////////////////
    
    
    simulated event PostIntAnimTree(SkeletalMeshComponent SkelComp)
    {
           if(SkelComp == Mesh)
           {
            AimNode = AnimNodeAimOffSet(mesh.FindAnimNode('AnimNode'));
            CrouchBlend = AnimNodeBlend(mesh.FindAnimNode('CrouchBlend'));
           super.PostInitAnimTree(SkelComp);
            //AimNode.bForceAimDir = true; //forces centercenter
            FullBodyAnimSlot = AnimNodeSlot(mesh.FindAnimNode('FullBodySlot'));
            TopHalfAnimSlot = AnimNodeSlot(Mesh.FindAnimNode('TopHalfSlot'));
    
    }
    
    }
    
    
    //event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
    //{
    //local NegaAI MP;
    //MP = NegaAI(Controller);
    //super.TakeDamage(0, MP, vect(0,0,0), vect(0,0,0), class'DmgType_Crushed');
    ////I can put an animation here and it will be settled OR Call for Physics here, like Falling
    ////FullBodyAnimSlot.PlayCustomAnim('Liv_Crouched',0.8, 0.2, 0.2, false,true, , );
    //
    //}
    
    
    
    simulated function PostBeginPlay()
    {
    	super.PostBeginPlay();
    	SetPhysics(PHYS_Walking);
    }
    
    exec function SwitchPOV()
    {
    
            ConsoleCommand("SwitchPOV");
            
            if (Dist != CamOffset.Y)
    
            {
                    CamOffset.Y *= -1.f;
                    Dist = Lerp(Dist,CamOffset.Y,0.50);
            }
            Loc += CamOffset >> Rot;
            Pos = Loc - Vector(Rot) * Dist;
            //I don't know how to implement Interpolation Speed:
    }
    
    function ActivateCameraShake()
    {
    bCamShake=true;
    }
    
    
    /** Test function to enable Proning */
    exec function EnableProne()
    {
    	bIsProned = true;
    	
    }
    
    /** Test function to disable Proning */
    exec function DisableProne()
    {
    	bIsProned = false;
    }
    
    simulated function SetCharacterClassFromInfo(class<UTFamilyInfo> Info)
    {
    
    }
    
    event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime)
    {
    	//local name AnimName;
    
    	AnimName = SeqNode.AnimSeqName;
    }
    
    event OnAnimPlay(AnimNodeSequence SeqNode)
    {
    
    }
    
    simulated event PlayFootStepSound(int FootDown)
    {
    	local SoundCue FootSound;
    	FootSound = SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneCue';
    	PlaySound(FootSound, false, true,,, true);
    	MakeNoise(10.0f);
    }
    
    
    exec function SetSpeed( int speed )
    {
    	GroundSpeed = speed;
    }
    
    exec function Run()
    	{
                local SoundCue FootSound;
    	FootSound = SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneCue';
    	PlaySound(FootSound, false, true,,, true);
            MakeNoise(20.0f);
    	ConsoleCommand("Run");
    	Groundspeed = 300;
    	bRun = true;
    
        // If we have enough speed, run
        if(Groundspeed >= 290)
        {   
        StopFiring();    
    
        }
    }
    
    exec function StopRun()
    {
    	GroundSpeed = 150;
    }
    
    
    exec function StartSprint()
    {
         if(Stamina==5.0){
         //sprintBreathing.Play();
    
         GroundSpeed = 600;
         bSprinting = true;
         MakeNoise(50.0f);
             if(GroundSpeed == 600)
             {
                 setTimer(SprintTimer, false, 'EmptySprint');
             }
         }
    }
    
    
    simulated function EmptySprint()
    {
        Stamina = Empty;
        Groundspeed = 300;
        bSprinting = true;
        setTimer(SprintRecoverTimer, false, 'ReplenishStamina');
    }
    
    simulated function ReplenishStamina()
    {
    
        Stamina = 5.0;
        bSprinting = false;
        setTimer(SprintRecoverTimer, false, 'ReplenishStamina');
    }
    
    exec function StopSprinting()
    {
    	GroundSpeed = 150;
    }
    
    simulated event StartCrouch(float HeightAdjust)
    {
    	SetBaseEyeHeight();
    	EyeHeight += HeightAdjust;
    	CrouchMeshZOffset=HeightAdjust;
    
    	if(Mesh != none)
    	{
    		Mesh.SetTranslation(Mesh.Translation + vect(0,0,1) * HeightAdjust);
    	}
    }
    
    
    //override to make player mesh visible by default
    simulated event BecomeViewTarget( PlayerController PC )
    { 
       local CIPlayerController UTPC;
    
       Super.BecomeViewTarget(PC);
    
       if (LocalPlayer(PC.Player) != None) 
       { 
          UTPC = CIPlayerController(PC);
          if (UTPC != None)
          { 
             //set player controller to behind view and make mesh visible 
             UTPC.SetBehindView(true); 
             SetMeshVisibility(UTPC.bBehindView); 
             
             //Show Crosshair = false, hide = true 
             UTPC.bNoCrosshair = false; 
          }
       }
    }
    
    simulated function FaceRotation(rotator NewRotation, float DeltaTime)
    {
    
    // Do not update Pawn's rotation if no accel
    if (Normal(Acceleration)!=vect(0,0,0))
    {
    if ( Physics == PHYS_Ladder )
    {
    NewRotation = OnLadder.Walldir;
    }
    else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
    		{
    			NewRotation.Pitch = 0;
    		}
    //Pawn.FaceRotation(RInterpTo(Pawn.Rotation, NewRotation, DeltaTime, RotationSpeed, true), DeltaTime);
            NewRotation = RLerp(Rotation,NewRotation,0.06,true);
    	SetRotation(NewRotation);
    
    	}
    }
    
    //When Aiming and shooting,the rotator cease
    simulated singular event Rotator GetBaseAimRotation()
    {
    local rotator	POVRot;
    
    // If we have a controller, by default we aim at the player's 'eyes' direction
    // that is by default Controller.Rotation for AI, and camera (crosshair) rotation for human players.
    
    // If we have no controller, we simply use our rotation
    POVRot = Rotation;
    
    // If our Pitch is 0, then use RemoveViewPitch
    if( POVRot.Pitch == 0 )
    {
    POVRot.Pitch = RemoteViewPitch << 8;
    }
    
    return POVRot;
    }
    
    
    simulated function name GetDefaultCameraMode(PlayerController RequestedBy)
    {
    	return 'ThirdPerson';
    }
    
    
    ///////////HIT WALL EVENT//////////////
    //event bool NotifyHitWall(vector HitNormal, actor Wall)
    //{
    //
    //if(Wall != none && CIPawn.Groundspeed == 300)
    //{
    //    FullBodyAnimSlot.PlayCustomAnim('Throw',4.0, 0.2, 0.2, false,true, , );
    //    CIPawn.Acceleration=vect(0,0,0);
    //CIPawn.Velocity=vect(0,0,0);
    //CIPawn.GroundSpeed=0;
    //}
    //return true;
    //}
    //
    //event HitWall( vector HitNormal, actor Wall, PrimitiveComponent WallComp )
    //{
    //
    //if(Wall != none && Groundspeed == 300)
    //{
    //
    //		 FullBodyAnimSlot.PlayCustomAnim('Throw',4.0, 0.2, 0.2, false,true, , );
    //CIPawn.Acceleration=vect(0,0,0);
    //CIPawn.Velocity=vect(0,0,0);
    //CIPawn.Groundspeed =0;
    //}
    //}
    //////////////////////////////
    
    defaultproperties
    {
    
            EyeHeight=+0038.000000
    	CrouchEyeHeight=+0020.000000
    	BaseEyeHeight=+0038.000000
    
            WalkingPct=+0.4
           CrouchedPct=+0.4
            CrouchHeight=45.0
            CrouchRadius=25.0
            bCanCrouch=true
            BaseTranslationOffset=12.0
           WalkableFloorZ=0.9999
            LeftFootControlName=LeftFootControl
            RightFootControlName=RightFootControl
            bEnableFootPlacement=true
            MaxFootPlacementDistSquared=56250000.0 // 7500 squared
            SprintTimer=2.0
    	SprintRecoverTimer=5.0
    	Stamina=5
            Empty=1.0
            GroundSpeed=150.0
           // AnalogSpeed=300.0
           CamOffset=(X=16.0,Y=30.0,Z=-28.0)
    
    
            Begin Object  Name=MyLightEnvironment
            bSynthesizeSHLight=TRUE
            bIsCharacterLightEnvironment=TRUE
            End Object
            Components.Add(MyLightEnvironment)
            LightEnvironment=MyLightEnvironment
    
            Begin Object Name=WPawnSkeletalMeshComponent
    		SkeletalMesh=SkeletalMesh'CopernicusIsland_Characters.Mesh.Liv'
    		AnimSets(0)=AnimSet'CopernicusIsland_Characters.Mesh.Liv_AnimSet'
    		bCacheAnimSequenceNodes=FALSE
    		AlwaysLoadOnClient=true
    		AlwaysLoadOnServer=true
    		bOwnerNoSee=false
    		CastShadow=true
    
            CollideActors=true
            //BlockRigidBody=true
            AlwaysCheckCollision=true
    
    		bUpdateSkelWhenNotRendered=false
    		bIgnoreControllersWhenNotRendered=TRUE
    		bUpdateKinematicBonesFromAnimation=true
    		bCastDynamicShadow=true
    		RBChannel=RBCC_Untitled3
    		RBCollideWithChannels=(Untitled3=true)
    		LightEnvironment=MyLightEnvironment
    		bOverrideAttachmentOwnerVisibility=true
    		bAcceptsDynamicDecals=FALSE
    		AnimTreeTemplate=AnimTree'CopernicusIsland_Characters.Mesh.Liv_AnimTree'
    		//PhysicsAsset=PhysicsAsset'CopernicusIsland_Characters.Mesh.Liv_Physics'
    		bHasPhysicsAssetInstance=true
    		TickGroup=TG_PreAsyncWork
    		MinDistFactorForKinematicUpdate=0.2
    		bChartDistanceFactor=true
    		//bSkipAllUpdateWhenPhysicsAsleep=TRUE
    		RBDominanceGroup=20
    		//Scale=0.6
    		//MotionBlurScale=0.0
    		bAllowAmbientOcclusion=false
    		bUseOnePassLightingOnTranslucency=TRUE
    	End Object
    	Mesh=WPawnSkeletalMeshComponent
    	Components.Add(WPawnSkeletalMeshComponent)
    
    
    		Begin Object Name=CollisionCylinder
    		CollisionRadius=+0040.000000
    		CollisionHeight=+0060.000000
                    End Object
                    CylinderComponent=CollisionCylinder
    	
    
    
    	/////Grenades/////
    	bCanThrowGrenade=true
    	GrenadeCount=1
    	ThrowTime=1.0
    	SpawnGrenTime=0.5
    	
    	WeaponSocket= RB_Handle0
    	
    	//Begin Object Class=StaticMeshComponent Name=SodaCan
    	//	StaticMesh=StaticMesh'CopernicusIsland_Weapons.Mesh.SodaCan'
     	// LightEnvironment=MyLightEnvironment
           // bNotifyRigidBodyCollision=true
    //		AlwaysCheckCollision=true
    //		ScriptRigidBodyCollisionThreshold=1.0
    //	End Object
    //		//Mesh=SodaCan
    //		Components.Add(SodaCan)
    
    	//////////
    
            Health = 100
            MadeNoise = true
    	bIsProned=false
    	bIsCrouched=false
    	EnemyClass = true
    	bDirectHitWall=false
            bCollideWorld = true
            bPushesRigidBodies=true
    	InventoryManagerClass=class'CI_InventoryManager'
    
    }
    But I had some extra time in the last days and I tested another camera class, extending my Pawn from UDKPawn instead UTPawn as I did before. Everything worked very well. I've got inspiration from the camera class used in Stealth Project ( https://forums.epicgames.com/threads...alth-Framework ). Despite this, I'll stick with my "camera" within my Pawn class until I substitute the placeholder model for the main character of my game. And leave my agony about a smooth switch Y axis in the last touches ^^

    Leave a comment:


  • replied
    It totally messed up the game


    Sent from my iPhone using Tapatalkpp

    Leave a comment:


  • replied
    Did you test that camera? I'm asking it because I am having problems with Axis Y switch interpolation (smooth movement). It's working but it is too dull and I can't solve this without a CalcCamera... And I don't want to use a CalcCamera because I'm using some effects and a Camera Class suit better for me.
    Just to know if you reached something similar to camera interpolation and if you have some clue for me.

    Leave a comment:


  • replied
    Ok amy will do


    Sent from my iPhone using Tapatalkpp

    Leave a comment:


  • replied
    Originally posted by Kelt'ar View Post
    Jesus no reply to above.

    Ok, I saw the Gears of war cam tut with taking cover. Do you guys think this will be something to add to the game?
    -First off, thanks for posting your demo tour here! I followed and watched your other posts about SL and you really improved a lot of things (we can see how much love you're putting on your project).
    Answering your question... A big yes! A cover system in your game it would be a feature very appreciated. You know, games with weapons (firearms mainly) without a cover system are harder to play. BUT I really like how your camera isn't shaking as GoW games (or in this GoW cam tut, which I tested some time ago). In this camera GoW tut, everything works very fine but when the player walks... all that shaking cam makes me sick and dizzy, a puck-o-rama! Please, leave the camera without shakes as you made if you go to with GoW cam tut.

    Leave a comment:


  • replied
    Thanks Patrick


    Sent from my iPhone using Tapatalkpp

    Leave a comment:


  • replied
    Thanks You its a good Job

    Leave a comment:


  • replied
    Thx gaz.


    Sent from my iPhone using Tapatalk

    Leave a comment:


  • replied
    nice to see some actual levels.looking good and well matched to your characters.its also good to see how other lone developers approach their work.
    im certainly up for a bit of playtesting.

    Leave a comment:


  • replied
    Ok snipe..thx

    Leave a comment:


  • replied
    refine what you have

    Leave a comment:


  • replied
    Jesus no reply to above.

    Ok, I saw the Gears of war cam tut with taking cover. Do you guys think this will be something to add to the game?

    Leave a comment:


  • replied
    Ok guys, I have a pretty buggy and wip version ready to go (not sure if I even want to call it an alpha). But if you would like to give it a ride let me know. and I ill either post the link here or send it to you.

    Leave a comment:


  • replied
    oooo thanks for an alpha(beta?) quick tour! From another dev pov, I know how much hard work you've put in to get where you are so far with your game.

    Reminded me a bit of Deus Ex, same kinda feel sneaking, dodging and spookiness. It's gunna be tough getting past those dudes when they start shooting back. I like the atmospherics with mist, towers, buildings and the sea lapping quietly which invokes a 'what's around the mf corner!?' feeling. I guess I'm saying that although interaction with other team members and your mission are important, certainly, you've also made the space between those interactions mean something using the haunting atmospherics. That 'between' factor I hadn't really thought about before that much but you work that well.
    Also you know where to go through your map, but other players won't necessarily and it's good the route forward is pretty apparent -mountains at left, sea at right, then valley, but there's pro made games that fail at that basic step, where to next, and irritate their players no end.
    I hope you don't rush to release it before it's nicely polished... which can be soooo tempting. When you think of how far you've come and the effort -- a bit of extra time, polishing and thought will make all the difference.
    I mean the work you've done on the faces is impressive and that's not a huge thing but it makes a big difference.
    So don't go rushing, and thanks again for the inspiration that helps keep me going!

    Leave a comment:


  • replied
    Testing out the game...Lots of work to be done, but we're close:

    Leave a comment:

Working...
X