Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → 3rd person camera
3rd person camera
2004-11-04, 10:21 AM #1
I have question:

Is possible to change position (and other parameters) of 3rd-person camera in JK ?

could someone help me ?



Ort.
-= Jedi Knight I forever =-
2004-11-04, 10:34 AM #2
Take a look at SaberMaster's Chase Camera Mod.

EAH_Triscuit Made this Camera Cog, Using ParseArg + SetThingLook -

Code:
flags=0x200
symbols

thing       player
int         actorFlags

message     activated
message     pulse
message     startup

sound       lightActivate=activate04.wav
sound       lightDeactivate=deactivate04.wav
template	gtemp=+smoke		local
message     killed
message     newplayer

end

# =========================================

code

   player = GetSourceRef();
   actorFlags = GetActorFlags(player);
   if(GetInv(player, 42))
   {
      if(BitTest(actorFlags, 4))
      {
         jkPrintUNIString(player, 252);
         ClearActorFlags(player, 4);
         SetInvActivated(player, 42, 0);
         PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
         SetPulse(0);
      }
      else
      {
         if(GetInv(player, 13))
         {
activated:
            if(TOGGLE)
            {
           
               SetPulse(0);
               Print("3rd Person View: Normal");
               SetCameraFocus(1, player);
               DestroyThing(ghostcam);
               TOGGLE = 0;
               Return;
            }
            Print("3rd Person View: Chase Camera");
            ghostcam=CreateThing(gtemp, player); 
            ParseArg(ghostcam, "timer=999999 size=0 movesize=0 surfdrag=0 airdrag=0 physflags=0x402a4e vel=(0.0/0.0/0.0) angvel=(0.0/0.0/0.0) typeflags=0x1 thingflags=0x310 collide=1"); 
            SetPulse(0.01);
reset_camera:
            SetCameraFocus(1, ghostcam); 
         }
         else
         {
killed:
newplayer:
            if(TOGGLE) call reset_camera;
         }
      }
   }

   Return;

# ........................................................................................

startup:
      player = GetLocalPlayerThing();
Return;
Return;

# ........................................................................................

pulse:
      TOGGLE = 1;
      ppos = GetThingPos(player);
      gpos = GetThingPos(ghostcam);
	SetThingVel(ghostcam, VectorScale(VectorSub(VectorAdd(VectorScale(VectorNorm(GetThingLVec(player)), -0.15), VectorAdd(ppos, '0 0 0.06')), gpos), 6));			
	SetThingLook(ghostcam, VectorSub(ppos, gpos));						
	if(!HasLOS(ghostcam, player)) call fix_camera;
	if(VectorDist(ppos, gpos) > 4) call fix_camera;
Return;

# ........................................................................................

fix_camera:
      TeleportThing(ghostcam, player);
Return;

end


[T0rN]
2004-11-05, 11:14 AM #3
Quite tricky.
thanx i'll try this.
-= Jedi Knight I forever =-

↑ Up to the top!