Jump to content

script problem


Sonck

Recommended Posts

hello.

this is a script ive been working on. when u activate a teleportation stone it asks you to which floor you want to go.

the problem is that no matter which option you choose, it always teleports you to the first option. please tell me what is wrong

 

scn JKCPTeleportStonesScript

short button
short buttonPressed
short getbuttonpressed

Begin OnActivate
   if IsActionRef player == 1
		  set buttonPressed to 1
		  set button to -1
		  messagebox "teleport to?", "level 1", "level 2", "level 3"

   endif
end

begin gamemode
if buttonPressed == 1
set button to getbuttonpressed

if button > -1
	if button == 0
	  set buttonPressed to 0
	  set button to -1
			 player.movetomarker JKCPXMarkerRoom01
	elseif button == 1
	  set buttonPressed to 0
	  set button to -1
			  player.movetomarker JKCPXMarkerRoom00
	elseif button == 2
	  set buttonPressed to 0
	  set button to -1
			  player.movetomarker JKCPXMarkerRoomM1
	endif

endif
elseif buttonPressed == 0
  set button to -1
 endif
end

Link to comment
Share on other sites

hello.

this is a script ive been working on. when u activate a teleportation stone it asks you to which floor you want to go.

the problem is that no matter which option you choose, it always teleports you to the first option. please tell me what is wrong

 

scn JKCPTeleportStonesScript

short button
short buttonPressed
short getbuttonpressed

Begin OnActivate
   if IsActionRef player == 1
		  set buttonPressed to 1
		  set button to -1
		  messagebox "teleport to?", "level 1", "level 2", "level 3"

   endif
end

begin gamemode
if buttonPressed == 1
set button to getbuttonpressed

if button > -1
	if button == 0
	  set buttonPressed to 0
	  set button to -1
			 player.movetomarker JKCPXMarkerRoom00
	elseif button == 1
	  set buttonPressed to 0
	  set button to -1
			  player.movetomarker JKCPXMarkerRoom01
	elseif button == 2
	  set buttonPressed to 0
	  set button to -1
			  player.movetomarker JKCPXMarkerRoomM1
	endif

endif
elseif buttonPressed == 0
  set button to -1
 endif

 

um, yeah it's kind of messed up. that happens ^^ I'm not the greatest scriptor but I can see some things there that is incorrect. I had to learn by looking at existing ingame scripts and reading the wiki then running tests to see how things worked. I suggest that you check the wiki out TES Contruction Set Wiki

 

But just to point out, do you notice you don't have an 'end' for your 'begingamemode'? and not really sure, but you may have one too many 'elseif'. you actually got this to run that all the way through?

 

I'll test it out for you but you'll have to wait till the weekend before I can get to it. Lot's of stuff to do ^^

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...