Creating a Script which gives people the option to choose on

Post » Wed Sep 14, 2011 9:21 pm

Hi,

I need help with creating a script attached to a door in a exterior cell, which gives people the option to choose one out of 3 different interior cells, but I don't understand how to do that. Can someone help me with this? :)

dutch666
User avatar
Louise Lowe
 
Posts: 3262
Joined: Fri Jul 28, 2006 9:08 am

Post » Wed Sep 14, 2011 8:54 pm

As far as my limited experience goes, this isn't possible with a door (as they can only link to one other door). The only option is to place a door there as an activator, and then have the 3 doors there too, but initially disabled, and then the script enables one door and then disables the activator that initialized the message box.

I don't really have time to write that script for you, but that's what I'd do.
User avatar
Laura Tempel
 
Posts: 3484
Joined: Wed Oct 04, 2006 4:53 pm

Post » Wed Sep 14, 2011 10:01 am

Use the door as an activator, use an OnActivate block to present the player with the choices. (messagebox) Have the player make his choice, and then just use player.moveto to put 'em in the right cell. You can even have the script play the door sounds.
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Post » Wed Sep 14, 2011 6:19 pm

Yes, HeyYou's way is better, because with my method once you make the choice then you can't reverse it. Which you can also do with HeyYou's method, so do that :P.
User avatar
Courtney Foren
 
Posts: 3418
Joined: Sun Mar 11, 2007 6:49 am

Post » Wed Sep 14, 2011 7:07 am

The choice the PLayer makes must be abolute, and once the choice is made it can't be unmade :turned:

I was thinking about using 3 different XMarkerHeadings inside 3 different interior cells (one fit for a Mage, one for a Thief and one for a Warrior) and a script attached to just one door in a exterior cell which loads the Player inside the interior cell (s)he chooses, without being able to choose again.

Any ideas?


EDIT: The only thing I don't understand is how to make the game remember the players choice.
User avatar
Minako
 
Posts: 3379
Joined: Sun Mar 18, 2007 9:50 pm

Post » Wed Sep 14, 2011 6:28 pm

Here's an example script which loads the player into one interior cell only, without the 'choice' part:

scn O4ETurrisPlenusLoadScriptshort buttonshort messageOnBegin onActivate	MessageBox "Do you wish to travel inside the tower?" "Yes" "No"	set messageOn to 1EndBegin GameMode	if ( messageOn == 1 )		Set button to GetButtonPressed	if ( button >= 0 )		set messageOn to 0	endif	if ( button == 0 )		player.MoveToMarker O4TurrisPlenusMageMoveMarkerREF	elseif ( button == 1 )		set button to 0	endifendif	End


But, how to put the 'choice' part in it... :)
User avatar
Barbequtie
 
Posts: 3410
Joined: Mon Jun 19, 2006 11:34 pm

Post » Wed Sep 14, 2011 4:55 pm

Here's an example script which loads the player into one interior cell only without the 'choice' part:

scn O4ETurrisPlenusLoadScriptshort buttonshort messageOnshort DoOnceshort RememberButtonBegin onActivate       if DoOnce == 0	MessageBox "Do you wish to travel inside the tower?" "A" "B" "C"	set messageOn to 1              set DoOnce to 1      endifEndBegin GameMode	if ( messageOn == 1 )		Set button to GetButtonPressed	if ( button >= 0 )		set messageOn to 0	endif	if ( button == 0 )		player.MoveToMarker RefA	elseif ( button == 1 )		player.MoveToMarker RefB	elseif ( button == 2 )		player.MoveToMarker RefC	endifendif	End


But, how to put the 'choice' part in it... :)


Try that :). Might need some tweaking, but it's a start :).
User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Wed Sep 14, 2011 11:45 am

The way I'd go about doing that is this:

1. As HeyYou suggested, make an activator using a door mesh. This will be used to enable the appropriate door when the time comes.

2. Place three doors (identical to the activator created in step one) at the same location as the activator. Make them persistent references and give each a unique RefID. (I'll use DutchMageDoorRef, DutchWarriorDoorRef & DutchThiefDoorRef for now). Set them as Initially Disabled.

3. Link each of the doors to its appropriate cell.

4. Attach the following script to the Activator door:

scn DutchDoorChoiceScriptShort ChoosingShort ChoiceBegin OnActivate PlayerMessageBox "Which will you choose?" "Mage" "Warrior" "Thief"Set Choosing to 1DisableEndBegin GameModeIf Choosing == 1 set Choice to GetButtonPressed   If Choice == 0    DutchMageDoorRef.Enable   ElseIf choice == 1    DutchWarriorDoorRef.Enable   ElseIf choice == 2    DutchThiefDoorRef.Enable   EndifEndifEnd


^That should disable the activator and enable the appropriate door (it may need some refining, though).

Edit: Ahhg! Ninja'd :ninja:
User avatar
Alisia Lisha
 
Posts: 3480
Joined: Tue Dec 05, 2006 8:52 pm

Post » Wed Sep 14, 2011 10:45 am

Thanks! I'll try both scripts and see which one fits my needs the best!

dutch666 :)
User avatar
Megan Stabler
 
Posts: 3420
Joined: Mon Sep 18, 2006 2:03 pm

Post » Wed Sep 14, 2011 2:11 pm

I've tested AliTheLord's script first:


scn O4ETurrisPlenusLoadScriptshort buttonshort messageOnshort DoOnceshort RememberButtonBegin onActivate       if DoOnce == 0        MessageBox "Do you wish to travel inside the tower?" "A" "B" "C"        set messageOn to 1              set DoOnce to 1      endifEndBegin GameMode        if ( messageOn == 1 )                Set button to GetButtonPressed        if ( button >= 0 )                set messageOn to 0        endif        if ( button == 0 )                player.MoveToMarker RefA        elseif ( button == 1 )                player.MoveToMarker RefB        elseif ( button == 2 )                player.MoveToMarker RefC        endifendif   End


Try that :). Might need some tweaking, but it's a start :).


The above script does work to a certain extend (it will load my tower interior of choice), but if I try to reaccess the tower the game does not remember which choice I've made before and nothing happens... :sad:

EDIT: I don't understand this portion of the script: "short RememberButton" it isn't used anywhere below line 6 :huh:
User avatar
rebecca moody
 
Posts: 3430
Joined: Mon Mar 05, 2007 3:01 pm

Post » Wed Sep 14, 2011 6:59 pm

*takes a stab at it*
ScriptName DoorChoiceActivatorSCPTInt bChooseOnceInt iButtonInt bMessageBegin OnActivate Player	If bChooseOnce ; iButton already set		If (iButton == 0) ; Door 1			PlaySound DoorSOUN              		Player.MoveToMarker RefA		ElseIf (iButton == 1) ; Door 2			PlaySound DoorSOUN              		Player.MoveToMarker RefB		ElseIf (iButton == 2) ; Door 3			PlaySound DoorSOUN              		Player.MoveToMarker RefC		EndIf	Else		Set bMessage to 1		ShowMessage "Choose a door", "Door 1", "Door 2", "Door 3", "Do Nothing"	EndIfEnd;==================================Begin GameMode	If bMessage	Else		Return	EndIf	Set iButton to GetButtonPressed	If (iButton == -1)		Return	Else		Set bMessage to 0		If (iButton == 0) ; Door 1			PlaySound DoorSOUN			Set bChooseOnce to 1              		Player.MoveToMarker RefA		ElseIf (iButton == 1) ; Door 2			PlaySound DoorSOUN			Set bChooseOnce to 1              		Player.MoveToMarker RefB		ElseIf (iButton == 2) ; Door 3			PlaySound DoorSOUN			Set bChooseOnce to 1              		Player.MoveToMarker RefC		ElseIf (iButton == 3) ; Do Nothing		EndIf	EndIfEnd

User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am


Return to IV - Oblivion

cron