Thread: [Tutorial] XSE Scripting Tutorial
View Single Post
  #44    
Old June 2nd, 2008 (09:28 PM).
~Teh Panda~'s Avatar
~Teh Panda~
Sea of Dreams - Redux
Community Supporter
 
Join Date: Aug 2007
Quote originally posted by Darthatron:
Wow... Soo many posts... :o


MultiChoice is something that you should really only do when you know all of the basics. You see it needs to use Variables, which may be difficult to some. I'll show you how to make a working script with multichoice, however I won't go into too much detail.
Spoiler:
Ok, so first we will set a #Dynamic.
Code:
#Dynamic 0x800000
Next we want to lock the Player so he/she can't move. Also make the Person we are talking to Face the Player.
Code:
Lock
FacePlayer
Next we will call the MultiChoice Command.
Code:
MultiChoice 0xA 0x4 0x1 B_True
Ok, you should know what each of those means, because it's explained in the Command Help...

Next we need to copy the Value "LASTRESULT" into another Var, so we can use it. Today I will be using 0x4003
Code:
CopyVar 0x4003 LASTRESULT
Now, we are going to "Check" if the Value of 0x4003 is 0. If it is we will goto another script.
Code:
Compare 0x4003 0x0
If B_TRUE Call @Choice1
Pretty much we just go that for as many results as the MultiChoice Box has. This certain Multichoice has 5 Options. So...
Code:
Compare 0x4003 0x1
If B_TRUE Call @Choice2
Compare 0x4003 0x2
If B_TRUE Call @Choice3
Compare 0x4003 0x3
If B_TRUE Call @Choice4
Compare 0x4003 0x4
If B_TRUE Call @Choice5
Next we are going to Release the Lock Command, giving control back to the player. And also End the script.
Code:
Release
End
Ok... That's pretty much it, all you really hae to do now is decide what you want each choice to do... Here is my beautiful example.
Code:
#Dynamic 0x800000

#ORG @Main
Lock
FacePlayer
MultiChoice 0xA 0x4 0x1 0x1
CopyVar 0x4003 LASTRESULT
Compare 0x4003 0x0
If B_TRUE Call @Choice1
Compare 0x4003 0x1
If B_TRUE Call @Choice2
Compare 0x4003 0x2
If B_TRUE Call @Choice3
Compare 0x4003 0x3
If B_TRUE Call @Choice4
Compare 0x4003 0x4
If B_TRUE Call @Choice5
Release
End

#ORG @Choice1
Message @Text1
BoxSet 6
Return

#ORG @Choice2
Message @Text2
BoxSet 6
Return

#ORG @Choice3
Message @Text3
BoxSet 6
Return

#ORG @Choice4
Message @Text4
BoxSet 6
Return

#ORG @Choice5
Message @Text5
BoxSet 6
Return

#ORG @Text1
= Message 1.

#ORG @Text2
= Message 2.

#ORG @Text3
= Message 3.

#ORG @Text4
= Message 4.

#ORG @Text5
= Message 5.


HackMew is writing it up as we speak.
Nice, something else to work on now. i cannot wait until Hackmew is done! :)