timed chair transport

Post » Tue May 17, 2011 6:07 am

i want to make a chair that when activated it teleports you, but i want the animation of you sitting first included. ive been trying to use a timer but it doesnt work and now whenever i enter the room the game crashes?

heres the code i have so far
scriptName 11BLTESTtimerchairshort OnActivatefloat timerbegin gameMode	if OnActivate		activate     ;to get the animation of sitting down			set timer to 5		endif					if ( timer > 0 )		set timer to timer - GetSecondsPassed	else		MessageBox "Time to Teleport!" "Ok"  ;this isnt what itll really say		player.movetomarker 11BLtombtrans	endifendif	End


help please lol
User avatar
Emma Louise Adams
 
Posts: 3527
Joined: Wed Jun 28, 2006 4:15 pm

Post » Tue May 17, 2011 9:10 am

Well, for starters, there is no such function as 'If Onactivate'. And I am pretty sure trying to make a variable name that is the same as a block command will cause problems.
The next biggest problem is you started a 'reference id name' with a numeric character. That will never work. '11BLtombtrans' is what I am referring to. You should get into the habit of never using a numeric as a first character in any new objects you create or use.

scriptName 11BLTESTtimerchairshort myStatfloat timerbegin onactivate	activate     ;to get the animation of sitting down	set timer to 5	set myStat to 1endbegin GameMode	if myStat == 1		if ( timer > 0 )			set timer to timer - GetSecondsPassed		else			MessageBox "Time to Teleport!" "Ok"  ;this isnt what itll really say			player.movetomarker 11BLtombtrans		endif	endif	End

User avatar
Alberto Aguilera
 
Posts: 3472
Joined: Wed Aug 29, 2007 12:42 am

Post » Tue May 17, 2011 1:37 pm


scriptName 11BLTESTtimerchairshort myStatfloat timerbegin onactivate	activate     ;to get the animation of sitting down	set timer to 5	set myStat to 1end



Willie - quick question wont the activate also act as a return keeping timer and Mystat from getting set ??
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Tue May 17, 2011 12:12 am

thanks that works now, but everytime i enter the room it just loads me back to the marker automatically and i cant figure a way around it.

also i dont mean to be annoying but you said about starting references with numbers, would BL11 be alright for naming references?
User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Tue May 17, 2011 7:58 am

Willie - quick question wont the activate also act as a return keeping timer and Mystat from getting set ??

I don't know, the WIKI is not clear on the subject. Testing would determine for sure. My initial guess is that it should work fine. The 'player.MoveTo' will terminate the script though.

thanks that works now, but everytime i enter the room it just loads me back to the marker automatically and i cant figure a way around it.

also i dont mean to be annoying but you said about starting references with numbers, would BL11 be alright for naming references?

You need to tell the script to stop running. I missed that part.

begin GameMode	if myStat == 1		if ( timer > 0 )			set timer to timer - GetSecondsPassed		else			set myStat to 3			MessageBox "Time to Teleport!" "Ok"  ;this isnt what itll really say			player.movetomarker 11BLtombtrans		endif	endif	End


Any Alphabetic character will work. Just don't use a numeric because the script will interpret it as a 'form ID' when its compiled and it will not work.
User avatar
Joanne
 
Posts: 3357
Joined: Fri Oct 27, 2006 1:25 pm

Post » Tue May 17, 2011 1:00 am

alright that worked, thanks so much for the help!
User avatar
Vicky Keeler
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:03 am

Post » Tue May 17, 2011 1:40 am

I don't know, the WIKI is not clear on the subject. Testing would determine for sure. My initial guess is that it should work fine. The 'player.MoveTo' will terminate the script though.

OK - was just wondering as I've always made sure to set the variables before activating just in case

ie.
begin onactivate	set timer to 5	set myStat to 1        activate     ;to get the animation of sitting down	end

User avatar
!beef
 
Posts: 3497
Joined: Wed Aug 16, 2006 4:41 pm

Post » Tue May 17, 2011 7:23 am

OK - was just wondering as I've always made sure to set the variables before activating just in case

That is how I code it as well. It just makes more sense. ;)
User avatar
meg knight
 
Posts: 3463
Joined: Wed Nov 29, 2006 4:20 am

Post » Tue May 17, 2011 7:13 am

Willie - quick question wont the activate also act as a return keeping timer and Mystat from getting set ??


No, activate doesnt act as a return :) ... cause remember it is often used in gamemode block with no problem.
User avatar
Ladymorphine
 
Posts: 3441
Joined: Wed Nov 08, 2006 2:22 pm


Return to IV - Oblivion