PositionCell stops timer?

Post » Thu Nov 14, 2013 3:00 pm

I've made a simple cut scene script, where player should act as camera, but there's a problem.

When I use PositionCell script, timer stops, when I removed this line, anything works fine. What am I doing wrong?

begin Cutscene1float timershort s1If ( GetDistance, Player <= 256 )	set timer to (timer + GetSecondsPassed)	if ( s1 == 0 )		if(s1==0)			Player-> PositionCell, 512, -554, 480, 20 "My Cell"			PCForce1stPerson			DisablePlayerControls			PlaySound "cavein"			set s1 to 1		endif		if(timer >= 2) ;here script stops, when Player-> PositionCell is enabled			if(s1==1)				set objectdoessomething to 1				PlaySound "endboom4"				set s1 to 2			endif		endif		if(timer >=4)			if(s1==2)				Player-> PositionCell, 448, -960, -64, 180 "My Cell"				EnablePlayerControls				set s1 to 3			endif		endif		if(timer >= 20) ;here also script stops, when first PositionCell is disabled, this above is enabled			if(s1==3)				set objectdoessomething to 2				PlaySound "endboom4"				set s1 to 4			endif		endif	endifendifend Cutscene1
User avatar
Scotties Hottie
 
Posts: 3406
Joined: Thu Jun 08, 2006 1:40 am

Post » Thu Nov 14, 2013 12:59 pm

Do you want 1) to learn scripting, or 2) to just have this particular script working?

if 1), get Morrowind Scripting for Dummies and check how local scripts, global scripts and eventually global targeted scripts work, and how to use MessageBox to show internal script variables values at runtime for debugging.

if 2), local scripts (attached to a object in the CS) run in player current interior cell or player current exterior loaded cells (usually at least 3x3 cell matrix, depending on .ini settings) so when you teleport player away the local script in your starting cell stops running.

In short you need

- a global script

or

- 2 local scripts, one running in starting and one running in destination cell

[EDIT]typos

User avatar
Dalton Greynolds
 
Posts: 3476
Joined: Thu Oct 18, 2007 5:12 pm


Return to III - Morrowind

cron