Scaling 1st person camera with player

Post » Fri May 27, 2011 10:39 am

I want to make a potion that down-scales the player, which I know how to do, but I noticed the 1st person camera doesn't scale down with the player. Is there any way to fix this or do I need to get the player stuck in 3rd person mode? I'd prefer not to use third-party programs, if possible. I don't have a lot of time to learn how to use stuff. :|
User avatar
He got the
 
Posts: 3399
Joined: Sat Nov 17, 2007 12:19 pm

Post » Fri May 27, 2011 7:29 pm

As far as I know, the only way to adjust camera height is by using nifscope to adjust it in the base animation... the problem there is that the camera will always be at or near that height after you do it regardless of race or PC size.
User avatar
Jaylene Brower
 
Posts: 3347
Joined: Tue Aug 15, 2006 12:24 pm

Post » Fri May 27, 2011 4:23 pm

Yeah, I've been reading up on it and that seems about right. That being the case, are there scripting commands to disable first person and switch to third?
User avatar
Dan Stevens
 
Posts: 3429
Joined: Thu Jun 14, 2007 5:00 pm

Post » Fri May 27, 2011 10:16 pm

I know that it is possible, and "DisablePlayerViewSwitch" is what's used in the chargen script, but I think you'd have to force them to be in 3rd person before you put that in place. I'm not sure about how to do that beyond using "PCForce3rdPerson".
User avatar
Nice one
 
Posts: 3473
Joined: Thu Jun 21, 2007 5:30 am

Post » Fri May 27, 2011 3:51 pm

Alright, now I'm trying to test, but my script doesn't start when I drink the potion. Does the "onpcequip" block not work for potions or what?
User avatar
Nicholas C
 
Posts: 3489
Joined: Tue Aug 07, 2007 8:20 am

Post » Fri May 27, 2011 5:20 pm

I think that there is an issue with onpcequip and potions, but I'm not sure about the particulars. Unless you have potion effects other than your scaling, you could just use a misc bottle renamed and scripted... Just script in the playsound for potions if you want that.
User avatar
Chelsea Head
 
Posts: 3433
Joined: Thu Mar 08, 2007 6:38 am

Post » Fri May 27, 2011 9:08 am

I think that there is an issue with onpcequip and potions, but I'm not sure about the particulars. Unless you have potion effects other than your scaling, you could just use a misc bottle renamed and scripted... Just script in the playsound for potions if you want that.


Genius! Let me go test that...

Okay, I'm getting an "EXPRESSION" and "right eval" error now. Can't seem to find the problem in the script.

begin shrinkingpotionscriptshort playershrunkshort dooncefloat timerif ( onPCequip == 1 )	set playershrunk to 1endifif ( playershrunk == 1 )	if ( doonce == 0 )		player-> setscale 0.5		pcforce3rdperson		disableplayerviewswitch		set timer to timer + getsecondspassed		set doonce to 1	endifendifif ( timer >= 30 )	player-> setscale 1	enableplayerviewswitch	set timer to 0	set playershrunk to 0        set doonce to 0endifend


Any ideas on what the problem is now?
User avatar
Mario Alcantar
 
Posts: 3416
Joined: Sat Aug 18, 2007 8:26 am

Post » Fri May 27, 2011 4:28 pm

OnPCEquip has to be declared as a short variable. Just as a tip, "right eval" is almost always an undeclared variable or something similar.

Oh, and you might want to set OnPCEquip back to 0 at some point, even though it's a local.
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Fri May 27, 2011 12:26 pm

Oh, you need to set that as a variable? That would explain a LOT.

Thanks for the help!
User avatar
Alex Blacke
 
Posts: 3460
Joined: Sun Feb 18, 2007 10:46 pm


Return to III - Morrowind