Setting fatigue to 0 on player minor issues

Post » Thu Jan 21, 2010 5:22 pm

Let me explain specifically what the problem is:

Ok, so you create your scripted conditions to set the player's fatigue to 0 in a loop and he/she collapses to the floor (and stays there). Check. Now, I want to either Force3rdPerson or TVM (player ->), which doesn't change the camera view (this is supposed to be a 3rd person animation scene which just doesn't work in 1st person). Further, in-game it seems when your character is collapsed, you cannot manually change the camera view either (i.e. TAB doesn't work, console player->TVM or just TVM also doesn't do anything). Let me add that I am not making any syntax errors because when I comment out the section which sets fatigue to 0, the view changes as intended. Also to be clear, I just need the view to change - I have the animations all worked out already and they work.

Anyone have any ideas to work around this problem? Thanks.
User avatar
Milad Hajipour
 
Posts: 3482
Joined: Tue May 29, 2007 3:01 am

Post » Thu Jan 21, 2010 9:41 am

I'm not sure but I think it would work if your script changed to 3rd person view on a timer, perhaps 10 frames before the fatigue change. That would give it time to change but not really give the player time to do anything. You might also want to consider disabling player controls first just to be sure, but not knowing what your script is, it's hard to say if that would accomplish anything or not.
User avatar
Damned_Queen
 
Posts: 3425
Joined: Fri Apr 20, 2007 5:18 pm

Post » Thu Jan 21, 2010 5:59 am

simply placing the view change to before the collapse should work, as nieldarkstar says.
User avatar
Austin England
 
Posts: 3528
Joined: Thu Oct 11, 2007 7:16 pm

Post » Thu Jan 21, 2010 12:02 pm

Update: Yes this approach worked - a big thank you to both of you.

Turns out I did have the TVM 1 frame before the fatigue to 0 command via an advancing counter, but apparently this was not enough for the game to register the view change.

I added a timer check so that the fatigue loop occurs at 0.4 seconds after the TVM, and it works now - thanks again.

Now Im having some trouble forcing the collapsed player into a precise position and facing - specifically the facing. I know you can SetPos the player whereever you want, but it seems that face does not work on the player. For example, Player -> Face 0,0 does not do anything. Any further help on this issue? Here's my code if it helps:

begin frd_exanimscnshort noLoreshort companionshort countshort OnPCHitMefloat timerfloat MaxHealthfloat CurrentHealthfloat CurrentMajikafloat frdSpotxfloat frdSpotyfloat frdSpotzfloat frdAnglezif ( menumode == 1 )	returnendifset timer to ( timer + GetSecondsPassed )if ( count == 0 )		AiWander 0, 5, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0		Set count to 1		ForceGreetingendifif ( count == 3 )		;PCForce3rdPerson		Player -> TVM		Set timer to 0		AiWander 0, 5, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0		Set count to 4endifif ( count == 4 )	Player -> Face 0,0	if ( timer > 0.4 )		Player -> SetFatigue 0	endifendifend


Some quick notes about this script:
- It is attached to an NPC
- The AIWander lines are simply to control the animations for this NPC as events progress
- the local variable 'count' advances from 1 to 3 through dialogue activity
- if this script seems small to you, it is because I am replacing this NPC with different models for animation (as events progess) by using the Disable and then Set Delete technique, which is working great. This is also why I have unused variables, I will be using them once I get past these stumbling blocks.
- Currently everything works in this script except the 'Face' line (which is not changing the player's facing).

Thanks again in advance for any help.
User avatar
D IV
 
Posts: 3406
Joined: Fri Nov 24, 2006 1:32 am

Post » Thu Jan 21, 2010 8:33 am

Face, and some of the other AI functions, don't work on the player because you probably aren't an AI. If you are an AI and are playing MW, that's kind of cool.

The only good way to control the "player" or camera is to create a clone of the player (requires some external apps and MWSE scripting) and place the clone, then SetPos the player somewhere else. It's very tricky, though, and not always reliable at all.
User avatar
Abi Emily
 
Posts: 3435
Joined: Wed Aug 09, 2006 7:59 am

Post » Thu Jan 21, 2010 5:54 pm

Face, and some of the other AI functions, don't work on the player because you probably aren't an AI. If you are an AI and are playing MW, that's kind of cool.
You made my day, Peachy :icecream: B)

@pyxlmyxz : if your scene location is established (Position/PositionCell functions take no variables), you could try
player->PositionCell X Y Z Angle "YourcellName" ; if in interior
player->PositionCell X Y Z Angle "Balmora" ; if in exterior, any existing exterior cell name will do
Position should work also, I am not sure it takes degrees as angle measure

if your scene location is not fixed I fear you need MWSE xPositionCell
User avatar
Mr.Broom30
 
Posts: 3433
Joined: Thu Nov 08, 2007 2:05 pm


Return to III - Morrowind