Keeping a companion out of the Tranquility Lane simulator

Post » Thu Dec 16, 2010 10:32 pm

I have a companion that I would like to prevent from following the player into the Tranquility Lane simulator. What scripting would I need to accomplish this? Thanks.
User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Thu Dec 16, 2010 1:54 pm

How are the companions getting to that worldspace in the first place?

You can use http://cs.elderscrolls.com/constwiki/index.php/GetInWorldspace to test for 'TranquilityLane' and http://cs.elderscrolls.com/constwiki/index.php/GetInCell for the various interior cells that start with "TL*".
User avatar
Rachael
 
Posts: 3412
Joined: Sat Feb 17, 2007 2:10 pm

Post » Thu Dec 16, 2010 6:09 pm

She's set to warp to you if you get too far away. I didn't think it would take into account moving across cells, but I guess it does because when I went into that simulator, she was there. Anyway, here's the script I'm using for her:

scn JacJasmineScript		short follow					;Is it on Followshort IsSneak					;Get is in Sneakref self					;Itselfshort stayshort TalkedOnceToPlayershort meleeshort rangedshort firedBegin OnLoad	set self to GetSelf			;Set the Reference to what you placed this on.	SetIgnoreFriendlyHits 1			;Does it ignore Friendly Hits? Default yes	if ( melee == 1 )		SetCombatStyle FollowersCombatStyleMelee	endif	if ( ranged == 1 )		SetCombatStyle FollowersCombatStyleRanged	endifEndBEGIN OnCombatEND	if ( GetPlayerTeammate == 1 )		If GetHealthPercentage < 0.50 && GetItemCount Stimpak >= 1			removeitem Stimpak 1				restoreAV EnduranceCondition 20				restoreAV PerceptionCondition 20				restoreAV LeftAttackCondition 20				restoreAV RightAttackCondition 20				restoreAV LeftMobilityCondition 20				restoreAV RightMobilityCondition 20				restoreAv Health 70		endif		If GetAV PerceptionCondition == 0 && GetItemCount Stimpak >= 1			removeitem Stimpak 1				restoreAV EnduranceCondition 20				restoreAV PerceptionCondition 20				restoreAV LeftAttackCondition 20				restoreAV RightAttackCondition 20				restoreAV LeftMobilityCondition 20				restoreAV RightMobilityCondition 20				restoreAv Health 70		endif		If GetAV EnduranceCondition == 0 && GetItemCount Stimpak >= 1			removeitem Stimpak 1				restoreAV EnduranceCondition 20				restoreAV PerceptionCondition 20				restoreAV LeftAttackCondition 20				restoreAV RightAttackCondition 20				restoreAV LeftMobilityCondition 20				restoreAV RightMobilityCondition 20				restoreAv Health 70		endif		If GetAV LeftAttackCondition == 0 && GetItemCount Stimpak >= 1			removeitem Stimpak 1				restoreAV EnduranceCondition 20				restoreAV PerceptionCondition 20				restoreAV LeftAttackCondition 20				restoreAV RightAttackCondition 20				restoreAV LeftMobilityCondition 20				restoreAV RightMobilityCondition 20				restoreAv Health 70		endif		If GetAV RightAttackCondition == 0 && GetItemCount Stimpak >= 1			removeitem Stimpak 1				restoreAV EnduranceCondition 20				restoreAV PerceptionCondition 20				restoreAV LeftAttackCondition 20				restoreAV RightAttackCondition 20				restoreAV LeftMobilityCondition 20				restoreAV RightMobilityCondition 20				restoreAv Health 70		endif		If GetAV LeftMobilityCondition == 0 && GetItemCount Stimpak >= 1			removeitem Stimpak 1				restoreAV EnduranceCondition 20				restoreAV PerceptionCondition 20				restoreAV LeftAttackCondition 20				restoreAV RightAttackCondition 20				restoreAV LeftMobilityCondition 20				restoreAV RightMobilityCondition 20				restoreAv Health 70		endif		If GetAV RightMobilityCondition == 0 && GetItemCount Stimpak >= 1			removeitem Stimpak 1				restoreAV EnduranceCondition 20				restoreAV PerceptionCondition 20				restoreAV LeftAttackCondition 20				restoreAV RightAttackCondition 20				restoreAV LeftMobilityCondition 20				restoreAV RightMobilityCondition 20				restoreAv Health 70		endif	endifENDBegin GameMode	if ( follow >= 1 )		If GetPlayerTeammate == 0						SetPlayerTeammate 1		endif	endif	If Follow >= 1 && self.GetUnconscious == 0 && self.GetDead == 0		If Player.IsSneaking == 1 && IsSneak == 0			Set IsSneak to 1			evp		elseif Player.IsSneaking == 0 && IsSneak == 1			Set IsSneak to 0			evp		endif		If Self.GetDistance Player >= 2500			Self.MoveTo Player		Endif	EndifEnd


I was thinking about using a GetStage to have her wait if you have the journal entry for getting into the simulator, but I was wondering if there was a better way or if I could do that via a script. Thanks.
User avatar
Penny Courture
 
Posts: 3438
Joined: Sat Dec 23, 2006 11:59 pm

Post » Thu Dec 16, 2010 3:56 pm

               If Self.GetDistance Player >= 2500                         Self.MoveTo Player                 Endif 


You could add checks for the worldspace or interior house cells here. If the player is in Tranquility Lane then do not perform the 'MoveTo Player' part of the code.
User avatar
Cassie Boyle
 
Posts: 3468
Joined: Sun Nov 05, 2006 9:33 am

Post » Thu Dec 16, 2010 1:07 pm

So this should work?

             If Self.GetDistance Player >= 2500                             if ( Player.GetInCell TL == 0 )                                   Self.MoveTo Player                             Endif                Endif 


I'm used to Morrowind scripting, which is why I'm asking. :)
User avatar
Vincent Joe
 
Posts: 3370
Joined: Wed Sep 26, 2007 1:13 pm

Post » Thu Dec 16, 2010 11:41 pm

That will only work when you are in one of the houses.
Since you start in the worldspace, your companion would show up there and not follow you into a house.

If Self.GetDistance Player >= 2500   if player.IsInInterior == 0      if GetInWorldspace TranquilityLane == 0         Self.MoveTo Player      endif   else      if Player.GetInCell TL == 0         Self.MoveTo Player      Endif   endifendif

I have not tested this since I wrote it off my cuff.
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Post » Thu Dec 16, 2010 7:55 pm

Hmm. I think something like this should work because I still want her to "jump" in interiors if she gets too far away:

If Self.GetDistance Player >= 2500      if GetInWorldspace TranquilityLane == 0         Self.MoveTo Player      endif


Thanks again, WillieSea. :)
User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am


Return to Fallout 3