TES34HEDR,€?SCPTeSCHD4mwse_inventorydemo “GSCVRGstatecontaineridcounttypevaluenamenexttypenametempstrweightSCDT“ X  == 1$  XŒ == 1s -1$ s == -1s 0mwse_inventorydemo$ s == 0s 2>Inventory demo. SNEAK to get started or JUMP to quit the demo.$ s == 1s 2CSNEAK again to reset for the next listing or JUMP to quit the demo.$ s == 2 XŠ == 1`When you stop sneaking put a creature, NPC, or container in the crosshair to see it's inventory.s 3 $ s == 3 XŠ == 0s 4 $ s == 6The container was empty!s 1$ s == 7That was the last time.s 1$ 88l<8 8û88l<88l<<?88l<88l<88l<88l<88f<88l<88l<88l<8° 8´%L ?88l<88l<88l<88f<88l<88l<88l<88l<88l<8 8X?id=%s%ncount=%d%ntype=%d (%s)%nvalue=%d%nweight=%.2f%nname=%s%n ?8 8l<8l 8n8 8l<8€ 8„%s~?+...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................OK. l > 0s 5  l == 0l 0s s 2 +  8‘<88l< l == 0$ 88l<<<88l< l == 1414418243 l == 1095062083 l == 1598246990l 0 l 0l 0$SCTX7 begin mwse_inventorydemo short state long container long id long count long type long value long name long next long typename long temp long str float weight if ( MenuMode == 1 ) return endif if ( GetPCJumping == 1 ) set state to -1 return elseif ( state == -1 ) set state to 0 StopScript mwse_inventorydemo return elseif ( state == 0 ) set state to 2 MessageBox "Inventory demo. SNEAK to get started or JUMP to quit the demo." return elseif ( state == 1 ) set state to 2 MessageBox "SNEAK again to reset for the next listing or JUMP to quit the demo." return elseif ( state == 2 ) if ( GetPCSneaking == 1 ) MessageBox "When you stop sneaking put a creature, NPC, or container in the crosshair to see it's inventory." set state to 3 endif return elseif ( state == 3 ) if ( GetPCSneaking == 0 ) set state to 4 endif return elseif ( state == 6 ) MessageBox "The container was empty!" set state to 1 return elseif ( state == 7 ) MessageBox "That was the last time." set state to 1 return endif ifx ( container ) ; A valid container selected (NPC/Creature/Container) setx id count type value weight name next to container->xContentList next ; The new form of inventory, it even picks a random LEVI type item. setx typename to xStringBuild "%L" type ; the type looks a little better as a 4 letter string setx str to xStringBuild "id=%s%ncount=%d%ntype=%d (%s)%nvalue=%d%nweight=%.2f%nname=%s%nnext=%d" id count type typename value weight name next ;xMessageFix "id=%s%ncount=%d%ntype=%d (%s)%nvalue=%d%nweight=%.2f%nname=%s%nnext=%d" id count type typename value weight name next "OK" xMessageFix "%s" str "" MessageBox "..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................." "OK." if ( count > 0 ) set state to 5 endif if ( next == 0 ) ; That's the last item in this container set container to 0 set state to state + 2 endif else ; Need to get a container (NPC, Creature, or Container) to start setx container to xGetPCTarget if ( container == 0 ) return endif setx type to container->xRefType if ( type == 1414418243 ) ; CONT elseif ( type == 1095062083 ) ; CREA elseif ( type == 1598246990 ) ; NPC_ else set container to 0 endif set type to 0 set next to 0 return endif endSCPT{ SCHD4mwse_formatexampleÔ*SCVR*lenmatchjunktempfilenamestringvalueSCDTÔf 2743.9876543218 8-mwse_formatdemo85 89%s ?88l<88l<<8Y 8cHello, %88l< ?8w 8World!8‡ 8%s%N%88l< ?8¡ 8³Hello, World!%N%88l< ?8Ç 8Õ Hello, World! ?88l<88l<88l<8ý 8line1=%2.2D line2=%d%N%88l< ?88f<88f<88f<8G 8_value=%f %.3F %2.0f%n%88l< ?8s 8›'He said, %1.1QSeen any elves?%Q%196.5n%88l< ?8¯ 8·another8¿ 8Çblinder8Ï 8×spline8ß 8?A blank %2s follows.%n%nAnd this %1.3se makes %.1s total of 8%N88l< ?88l<<8? 8C%s%88l<?88l<88l<88l<88l<88l<8‰ 8™%d '%s' %d == % <8£ 8§%s%88l<?88l<88l<88l<88l<88l<8í 8ù %d '%s' %d <8 8line1=%d line2=%d%88l<?88l<88l<88l<88l<88l<88l<8g 8q%d %d %d <8{ 8‘value=%d.%d %2.8f%s%88l<?88l<88l<88l<88f<88l<88l<88f<88l<88l<88l<8  8%d %d %d %f '%s' <8% 85%.0s, %q%.0s%q%88l<?88l<88l<88l<88l<88l<88l<8… 8“ %d '%s' '%s' <8 8¥%3.3s%88l<?88l<88l<88l<88l<8á 8é%d '%s' <8ó 8%nAnd this line makes a %s88l<?88l<88l<88l<88l<8K 8S%d '%s' <l 5l 788l<88l<8 8‹%%%d.%ds ?88l<88l<8© 8µ Format: %s <8¿ 8ÑA source message88l< ?88l<88l<88l< ?88l<f 100.0 l * 16 /88f<88l<88l<88l<8N 8j%d %d/16 %Q%s%Q for %.3f%% <l 87388l<88l<8’ 8š%d=0x%h <8¤ 8² Hello World!8º 8Â%L%L%L ?88l<88l<88l<88l<88l<88l<8 8%L%L ?88l<88l<8, 80%s <…Check the mwse_formatexample script, the log file, and generated text file to see examples of all of the new text formating features.mwse_formatexampleSCTX)begin mwse_formatexample ; This is more sample code than demo. You'll want to run it and then check the file it creates! long len long match long junk long temp long filename long string float value set value to 2743.987654321 ; Just an interesting float value. ; % style formatting now works for xFileWriteString, xLogMessage, and xFileWriteMessage (and xFileReadString too). ; Using % format characters in the string now triggers return values from xFileWrite! ; Using the special file name "*" skips writing to a file and sends the result directly into a string instead. ; You must remember to use setx with the new form of xFileWriteString or you'll corrupt the stack. ; Putting the file name into a string reduces the size of the compiled script (and might run faster too) if you use it often. setx filename to xStringBuild "%s" "mwse_formatdemo" ; Writing straight to a string instead of a file ; A trailing % suppresses the normal null when printing to a file or the end of line marker when printing to the log. ; A %N or %n will write a CR/LF pair used to mark the end of the line in an ordinary MS-Windows text file. ; The format string "%s%n%" could be used to write strings into standard text file format, like this! xFileRewind filename xFileWriteText filename "Hello, %" ; There won't be a trailing null thanks to the final %, xFileWriteText filename "%s%N%" "World!" ; so this one will continue on that line and the %N% makes a real line! xFileWriteText filename "Hello, World!%N%" ; This should be identical to the previous pair. ; We can get the length of strings setx len to xStringLength "Hello, World!" ; The % pattern letter isn't case sensitive, so %D and %d are the same. ; For shorts and longs use %d, for floats use %f. They are NOT interchangable! ; You can also use the %Q can be used to show the " symbol. ; Note that %N, %Q, and the trailing % don't need (and shouldn't have) matching variables, but %S, %D, and %F do. ; You can use %3.4f style formats, but F only uses the number after the period and D, N, and Q ignore both. xFileWriteText filename "line1=%2.2D line2=%d%N%" len len xFileWriteText filename "value=%f %.3F %2.0f%n%" value value value xFileWriteText filename "He said, %1.1QSeen any elves?%Q%196.5n%" ; With this last line, you should now have an ordinary text file named mwse_formatdemo in the MWSE subdirectory of Data Files. ; The leading number for a string will skip that many characters from the beginning of the string. xFileWriteText filename "A blank %2s follows.%n%nAnd this %1.3se makes %.1s total of 8%N%" "spline" "blinder" "another" ; OK, now for a little text file input. ; The first value returned is a count of now many successful matches were made and it's usually equal one more than the number of variables. ; The second value is always the number of physical characters read, not the number of characters in the results. ; A trailing % sign for xFileReadString will read one line from a text file (and throughs the CR/LF pair away). xFileRewind filename setx match string to xFileReadText filename "%s%" ; string will have a value of "Hello, World!" and match will be 2 xLogMessage "%d '%s' %d == %" match string string ; I'll echo the various variable values back to the log file so you can compare them. setx match temp to xFileReadText filename "%s%" ; temp should now be the same string (and even the numerical values will match!) xLogMessage "%d '%s' %d" match temp temp ; We can choose to read back in with patterns similar to those used for writing. setx match temp junk to xFileReadText filename "line1=%d line2=%d%" ; Note you don't use a %N when reading though!, match=3 xLogMessage "%d %d %d" match temp junk ; We can also read them in other unusual ways, but %f doesn't pay any attention to width specifiers during input. setx match temp junk value string to xFileReadText filename "value=%d.%d %2.8f%s%" ; value is rounded and string has a leading space. xLogMessage "%d %d %d %f '%s'" match temp junk value string ; A plain string pattern %s will read all the way to the end, so it doesn't make sense to put it in the middle! ; Using a width of 0 after the period in a string pattern %.0s (or even %2.0s) will cause a minimal amount of reading. setx match junk string to xFileReadText filename "%.0s, %q%.0s%q%" ; junk="He said" and string="Seen any elves?" the ", " and quotes are lost. xLogMessage "%d '%s' '%s'" match junk string setx match string to xFileReadText filename "%3.3s%" ; string will have "lan", the "k line follows." is lost and match=1 to signal that. xLogMessage "%d '%s'" match string ; Skipping the trailing % on read will read until a null character or the end of the file. setx match string to xFileReadText filename "%nAnd this line makes a %s" ; string will have "total of 8" AND the CR/LF pair! xLogMessage "%d '%s'" match string ; Here's a fun thought. Create a substring function by dynamically creating the format string! (%% produces/matches a single %) set junk to 5 set temp to 7 setx string to xStringBuild "%%%d.%ds" junk temp ; string="%5.7s" xLogMessage "Format: %s" string setx match temp to xStringParse string "A source message" ; string="rce mes", match=1 setx len to xStringLength temp ; len=7 set value to ( 100.0 * len / 16 ) ; value = 43.750% xLogMessage "%d %d/16 %Q%s%Q for %.3f%%" match len temp value ; the trailing %% is a % not the "skip the end of line" marker ; You can write or read integer values (shorts/longs) using hexadecimal with %H or %h. set temp to 873 xLogMessage "%d=0x%h" temp temp ; decimal 873 is hex 369 ; The only remaining pattern is %L which is used to directly convert 4 character segments of a string into long values. setx match junk temp string to xStringParse "%L%L%L" "Hello World!" setx string to xStringBuild "%L%L" string temp ; string="rld!o Wo" xLogMessage "%s" string MessageBox "Check the mwse_formatexample script, the log file, and generated text file to see examples of all of the new text formating features." StopScript mwse_formatexample endSCPTbSCHD4mwse_pipeexampletSCVRcountnumreadsentreceivedSCDTt X  == 1$ 88l<8 8\88f<85 8=|demo13<f 0.088W 8_|demo1<88l<88f< l < 1[I sent %f, but the server didn't respond! Maybe it's just slow. Or maybe it's not running.fOKI sent %f and received %f.ffOK f f f *l l 1 - l == 0mwse_pipeexample  8rf 3.14159l 5SCTX~begin mwse_pipeexample long count long numread float sent float received if ( MenuMode == 1 ) return endif ifx ( count ) xFileWriteFloat "|demo1" sent set received to 0.0 setx numread received to xFileReadFloat "|demo1" 1 if ( numread < 1 ) MessageBox "I sent %f, but the server didn't respond! Maybe it's just slow. Or maybe it's not running." sent "OK" else MessageBox "I sent %f and received %f." sent received "OK" endif set sent to ( sent * sent ) set count to ( count - 1 ) if ( count == 0 ) StopScript mwse_pipeexample endif else set sent to 3.14159 set count to 5 endif endSCPTá SCHD4mwse_keysetupœ6SCVR6statecodesneakcodejumpcodedivecodetempkeytimerSCDTœl 088l<?88l<88l<?88l<88l<?88l<f f X - l != l l != l f <= 2Press one key at a time please.f 4  $  s == 0 XŠ == 0 f <= 00Please press and hold the SNEAK key (or button).f 4  l != 0 l == ll ls 1f 0  $ s == 1 XŠ == 1 f <= 0You can release the key now.f 4 s 2f 0 $ s == 2 XŒ == 0 f <= 0/Please press and hold the JUMP key (or button).f 4  l != 0 l == ll ls 3f 0  $ s == 3 l != 0 f <= 0You can release the key now.f 4 s 4f 0 $ s == 4 l == 0 f <= 02Please press and hold a key to be used for DIVING.f 4  l == ll ls 5f 0  $ s == 5 l != 0 f <= 0You can release the key now.f 4 s 6Key selection complete. $ s == 7s 0 mwse_keysetup$ s 78. 8< mwse_keysdemo<88l<88l<88l<8d 8‚%d Sneak%n%d Jump%n%d Dive%n%8Š 8˜ mwse_keysdemo ?SCTX»begin mwse_keysetup short state long code long sneakcode long jumpcode long divecode long temp long key float timer set code to 0 setx key to xKeyPressed code setx temp to xKeyPressed code setx code to xKeyPressed code set timer to ( timer - GetSecondsPassed ) if ( key != temp ) if ( code != temp ) if ( timer <= 2 ) MessageBox "Press one key at a time please." set timer to 4 endif endif return endif if ( state == 0 ) if ( GetPCSneaking == 0 ) if ( timer <= 0 ) MessageBox "Please press and hold the SNEAK key (or button)." set timer to 4 endif elseif ( key != 0 ) if ( key == temp ) set sneakcode to key set state to 1 set timer to 0 endif endif return elseif ( state == 1 ) if ( GetPCSneaking == 1 ) if ( timer <= 0 ) MessageBox "You can release the key now." set timer to 4 endif else set state to 2 set timer to 0 endif return elseif ( state == 2 ) if ( GetPCJumping == 0 ) if ( timer <= 0 ) MessageBox "Please press and hold the JUMP key (or button)." set timer to 4 endif elseif ( key != 0 ) if ( key == temp ) set jumpcode to key set state to 3 set timer to 0 endif endif return elseif ( state == 3 ) if ( key != 0 ) if ( timer <= 0 ) MessageBox "You can release the key now." set timer to 4 endif else set state to 4 set timer to 0 endif return elseif ( state == 4 ) if ( key == 0 ) if ( timer <= 0 ) MessageBox "Please press and hold a key to be used for DIVING." set timer to 4 endif else if ( key == temp ) set divecode to key set state to 5 set timer to 0 endif endif return elseif ( state == 5 ) if ( key != 0 ) if ( timer <= 0 ) MessageBox "You can release the key now." set timer to 4 endif else set state to 6 MessageBox "Key selection complete." endif return elseif ( state == 7 ) set state to 0 StopScript mwse_keysetup return endif ; ( state == 6 ) ; Storing the results into a text file for later set state to 7 xFileRewind "mwse_keysdemo" xFileWriteText "mwse_keysdemo" "%d Sneak%n%d Jump%n%d Dive%n%" sneakcode jumpcode divecode endSCPTfSCHD4mwse_keywatch,'SCVR'currentpreviouscodetimersneaktimerSCDT, X  == 1$  XŠ == 1f f X + f > 9.0+Sneaking active for 9 seconds, so quitting.l 0l 0l 0f 0.0f 0.0 mwse_keywatch$ f 0.0 l l88l<?88l< f == 0.0 l != 0l 0l 0l 0 l != 0 l == 0/Release all keys and mouse buttons to continue. f 1.0ˆPress keys and mouse buttons alone or in groups. You can experiment with holding them too. When finished, SNEAK for 9 seconds to quit. $  l != 0 l != l keycode=%g status=%g ll f f X + f > 13f 1.0l 0l 0l 0PMonitoring for all keys again. Remember that sneaking for 9 seconds will quit. $  l != lf 1.0 keycode=%g status=%g ll f f X + l == 0 f > 57Sneaking for 9 seconds will quit this part of the demo.f 1.0 $  f > 4l loYou've held one key or button for more than 3 seconds, so now only it will be monitored for the next 9 seconds.  SCTX¿ begin mwse_keywatch long current long previous long code float timer float sneaktimer if ( MenuMode == 1 ) return endif if ( GetPCSneaking == 1 ) set sneaktimer to ( sneaktimer + GetSecondsPassed ) if ( sneaktimer > 9.0 ) MessageBox "Sneaking active for 9 seconds, so quitting." set code to 0 set current to 0 set previous to 0 set timer to 0.0 set sneaktimer to 0.0 StopScript mwse_keywatch return endif else set sneaktimer to 0.0 endif set previous to current ; Remember the last key press/result setx current to xKeyPressed code ; code 0 matches any key, 1-254 watches for a specific one if ( timer == 0.0 ) ; Starting out, so give instructions if ( code != 0 ) ; Leftover code? This shouldn't happen, but just in case... set code to 0 set current to 0 set previous to 0 elseif ( current != 0 ) ; Key being pressed if ( previous == 0 ) ; A DoOnce condition MessageBox "Release all keys and mouse buttons to continue." endif else ; No keys pressed, time to start. set timer to 1.0 MessageBox "Press keys and mouse buttons alone or in groups. You can experiment with holding them too. When finished, SNEAK for 9 seconds to quit." endif return endif if ( code != 0 ) ; Waiting for a specific key, current holds a status value if ( current != previous ) ; A different key than last time MessageBox " keycode=%g status=%g " code current endif set timer to ( timer + GetSecondsPassed ) if ( timer > 13 ) ; after four more seconds return to monitoring all keys set timer to 1.0 set current to 0 set previous to 0 set code to 0 MessageBox "Monitoring for all keys again. Remember that sneaking for 9 seconds will quit." endif return endif ; Code is 0, so any key will do, current holds the code for the key pressed if ( current != previous ) ; A different key than last time set timer to 1.0 MessageBox " keycode=%g status=%g " code current else ; Same key as last time set timer to ( timer + GetSecondsPassed ) if ( current == 0 ) if ( timer > 5 ) MessageBox "Sneaking for 9 seconds will quit this part of the demo." set timer to 1.0 endif return endif if ( timer > 4 ) ; Held long enough so watch only for it set code to current MessageBox "You've held one key or button for more than 3 seconds, so now only it will be monitored for the next 9 seconds." endif endif endSCPTëSCHD4mwse_keystatusÎ0SCVR0pguppgdndonepgupcodepgdncodedonecodetimerSCDTÎ X  == 1$  l == 0bPress the Page Up and Page Down keys, separately or together. Press the END key when you're done.l 33l 34l 35 88l<?88l<88l<?88l<88l<?88l< l > 0 l > 0BothPgUp f 0  l > 0PgDnf 0 l == 0f f X + f > 6f 0!Press the END key if you're done.    l > 0f 0l 0mwse_keystatus SCTX™begin mwse_keystatus long pgup long pgdn long done long pgupcode long pgdncode long donecode float timer if ( MenuMode == 1 ) return endif if ( donecode == 0 ) MessageBox "Press the Page Up and Page Down keys, separately or together. Press the END key when you're done." set pgupcode to 33 set pgdncode to 34 set donecode to 35 endif setx pgup to xKeyPressed pgupcode setx pgdn to xKeyPressed pgdncode setx done to xKeyPressed donecode if ( pgup > 0 ) if ( pgdn > 0 ) MessageBox "Both" else MessageBox "PgUp" endif set timer to 0 else if ( pgdn > 0 ) MessageBox "PgDn" set timer to 0 elseif ( done == 0 ) set timer to timer + GetSecondsPassed if ( timer > 6 ) set timer to 0 MessageBox "Press the END key if you're done." endif endif endif if ( done > 0 ) set timer to 0 set donecode to 0 StopScript mwse_keystatus endif endSCPTµSCHD4mwse_levitatedemopt5ASCVRAflyingactiveupcodedncodeupdnstrlencodeheightpxpytempSCDT5 X  == 1$  player X omwse_levitate_spell == 0 playermwse_levitate_spell playermwse_dispel_spellUCast your new MWSE Levitate spell within 9 seconds or this part of the demo will end.f 0.0s 0s 0$  player X! omwse_levitate_spell == 0 s == 0f f X + f > 9MWSE Levitate demo finished. playermwse_levitate_spell playermwse_dispel_spell playermwse_levitate_max playermwse_levitate_minmwse_levitatedemo $ f 0.0s 0s 0RRecast the MWSE Levitate spell within 9 seconds or this part of the demo will end. playermwse_levitate_max playermwse_levitate_min$ 88s<8 8©88l<?88l<88l<?88l< X  == 1 playerf X X f != ff fl 0  playerf X Y f != ff fl 0  88s<8 8> playerf X Z l > 0f f s + player Zf l > 0f f s - player Zf XŒ == 0s 0 playermwse_levitate_min playermwse_levitate_max  8¥l l l + XŒ + l > 0s 15 playermwse_levitate_max playermwse_levitate_min  83s 1/Use your JUMP and DIVE keys to fly up and down. playermwse_levitate_min88l<8 8 83l 69l 6783 8A mwse_keysdemo<l 188l<8 838e 8m%d %s%8u 8ƒ mwse_keysdemo?88l<88l<88l<88l<8 8/8½ 8ÃJump88lGetSpell mwse_levitate_spell == 0 ) player->AddSpell mwse_levitate_spell player->AddSpell mwse_dispel_spell MessageBox "Cast your new MWSE Levitate spell within 9 seconds or this part of the demo will end." set temp to 0.0 set active to 0 set flying to 0 return endif if ( player->GetSpellEffects mwse_levitate_spell == 0 ) if ( active == 0 ) set temp to ( temp + GetSecondsPassed ) if ( temp > 9 ) MessageBox "MWSE Levitate demo finished." player->RemoveSpell mwse_levitate_spell player->RemoveSpell mwse_dispel_spell player->RemoveSpell mwse_levitate_max player->RemoveSpell mwse_levitate_min StopScript mwse_levitatedemo endif return endif set temp to 0.0 set active to 0 set flying to 0 MessageBox "Recast the MWSE Levitate spell within 9 seconds or this part of the demo will end." player->RemoveSpell mwse_levitate_max player->RemoveSpell mwse_levitate_min return endif ifx ( active ) setx dn to xKeyPressed dncode setx up to xKeyPressed upcode if ( GetInterior == 1 ) ; Trying to prevent levitating through ceilings! set temp to ( player->GetPos x ) if ( temp != px ) set px to temp set up to 0 endif set temp to ( player->GetPos y ) if ( temp != py ) set py to temp set up to 0 endif endif ifx ( flying ) set height to ( player->GetPos Z ) if ( up > 0 ) set height to ( height + flying ) player->SetPos Z height elseif ( dn > 0 ) set height to ( height - flying ) player->SetPos Z height elseif ( GetPCJumping == 0 ) set flying to 0 player->AddSpell mwse_levitate_min player->RemoveSpell mwse_levitate_max endif else ; not flying set up to ( up + dn + GetPCJumping ) if ( up > 0 ) set flying to 15 player->AddSpell mwse_levitate_max player->RemoveSpell mwse_levitate_min endif endif else ; not active, need to initialize set active to 1 MessageBox "Use your JUMP and DIVE keys to fly up and down." player->AddSpell mwse_levitate_min ifx ( upcode ) else ; Keys aren't defined yet set upcode to 69 ; e default set dncode to 67 ; c default xFileRewind "mwse_keysdemo" set len to 1 whilex ( len ) setx len code str to xFileReadText "mwse_keysdemo" "%d %s%" ; reads one line ifx ( len ) setx up to xStringCompare str "Jump" setx dn to xStringCompare str "Dive" if ( up == 0 ) set upcode to code elseif ( dn == 0 ) set dncode to code endif endif endwhile endif endif endSPELfNAMEmwse_levitate_spellFNAMMWSE LevitateSPDT ENAM ÿÿdNPC_ûNAMEplayerFNAMNPDT4FLAGRNAMANAMBNAMCNAMKNAMAIDT SPELÄNAMEmwse_levitate_maxFNAMMWSE LevitateSPDT ENAM ÿÿd,,ENAMSÿddENAMSÿddENAMOÿddSPELdNAMEmwse_levitate_minFNAMMWSE LevitateSPDT ENAM ÿÿd22SCPT^ SCHD4mwse_textinput†SCVRendcharmessagelengthSCDT†88l<8 8 8_Þl 358) 8IUse Backspace to replace this. ?88l<l 0$88l<8 8u 888l<88l<?88l<88l<88l<8· 8ï7%s %~?× 0Press the END key when your message is complete.$Ý88l<8& 8H!The message you typed was %Q%s%Q.~?...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................l 0l 0mwse_textinputSCTXmbegin mwse_textinput long endchar long message long length ifx ( endchar ) else ; Initialization needed when endchar == 0 DisablePlayerControls set endchar to 35 ; END key setx message to xStringBuild "Use Backspace to replace this." set length to 0 return endif ifx ( length ) else ; Actual string edit while length == 0 setx length message to xTextInput message endchar ; endchar could be 13 to stop at Enter MessageBox "" xMessageFix "%s %" message ; spaces and trailing % needed in case the player uses Backspace MessageBox " " MessageBox "Press the END key when your message is complete." return endif EnablePlayerControls MessageBox "" MessageBox "" xMessageFix "The message you typed was %Q%s%Q." message MessageBox "..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................." set length to 0 set endchar to 0 StopScript mwse_textinput endSCPT© SCHD4mwse_groupjumpf-SCVR-quantumtempcleanupjumpnpcrefvalidtimerSCDTf X  == 1$  s <= 0s 50IJump and the world jumps with you. Sneak and this part of the demo ends. s XŒ XŠ == 1s 0s 1l 0  s == 0f f X - f <= 0IJump and the world jumps with you. Sneak and this part of the demo ends.f 5   s < ss s 88s<8 8ds s 1 -88l<8 8—88l<<88l< 8£<88l< l == 0 s == 1s 0mwse_groupjump s 0$ 88l<<<88l< l != 1598246990l 0 88l<8 8`88s<8 8R88l<< 8`88l<<ž 8KSCTXÂbegin mwse_groupjump ; You can compare the performance of this script with versions 0.9.1 and 0.9.2. ; Try decreasing the value of quantum from the console to have less npcs processed per frame and compare performance. short quantum short temp short cleanup short jump long npcref long valid float timer if ( MenuMode == 1 ) return endif if ( quantum <= 0 ) ; The number of NPCs/Creatures checked per frame. set quantum to 50 MessageBox "Jump and the world jumps with you. Sneak and this part of the demo ends." endif set jump to GetPCJumping if ( GetPCSneaking == 1 ) ; Signal to make one more pass through the list to restore normal behavior set jump to 0 set cleanup to 1 set npcref to 0 endif if ( jump == 0 ) set timer to ( timer - GetSecondsPassed ) if ( timer <= 0 ) MessageBox "Jump and the world jumps with you. Sneak and this part of the demo ends." set timer to 5 endif endif if ( temp < quantum ) set temp to quantum endif whilex ( temp ) set temp to temp - 1 ifx ( npcref ) ; Working through the list setx npcref to xNextRef npcref else ; At the beginning of the list setx npcref to xFirstNPC endif if ( npcref == 0 ) ; At end of the list (at least done for this frame) if ( cleanup == 1 ) ; And in cleanup mode, so realy finished set cleanup to 0 StopScript mwse_groupjump endif set temp to 0 return endif setx valid to npcref->xRefType if ( valid != 1598246990 ) ; NPC_ type set valid to 0 ; only NPCs can/should jump endif ifx ( valid ) ifx ( jump ) xSetRef npcref ForceJump else xSetRef npcref ClearForceJump endif endif endwhile endSCPT3SCHD4mwse_teststart0SCVRstateSCDT0 X  == 1$ G CharGenState != -1$ s == 0 player X omwse_demo_spell == 0 playermwse_demo_spell9Cast your new MWSE Demo spell to begin the demonstration. player X! omwse_demo_spell == 1s -3 mwse_keysetup $ s == -3 X m mwse_keysetup == 0s -2mwse_levitatedemo $ s == -2 X mmwse_levitatedemo == 0s -1Select a demo to run (or rerun) Quit Key Setup Levitate Key Status Key Watch Text InputInventory Demo Group Jump I/O Examples $ s == -1s X s == 1 mwse_keysetup s == 2mwse_levitatedemo s == 3mwse_keystatus s == 4 mwse_keywatch s == 5mwse_textinput s == 6mwse_inventorydemo s == 7mwse_groupjump s == 8mwse_formatexample $ s == 1 X m mwse_keysetup == 0s -2  s == 2 X mmwse_levitatedemo == 0s -2  s == 3 X mmwse_keystatus == 0s -2  s == 4 X m mwse_keywatch == 0s -2  s == 5 X mmwse_textinput == 0s -2  s == 6 X mmwse_inventorydemo == 0s -2  s == 7 X mmwse_groupjump == 0s -2  s == 8 X mmwse_formatexample == 0s 9mwse_pipeexample  s == 9 X mmwse_pipeexample == 0s -2  SCTX©begin mwse_teststart short state if ( MenuMode == 1 ) return elseif ( CharGenState != -1 ) return elseif ( state == 0 ) if ( player->GetSpell mwse_demo_spell == 0 ) player->AddSpell mwse_demo_spell MessageBox "Cast your new MWSE Demo spell to begin the demonstration." elseif ( player->GetSpellEffects mwse_demo_spell == 1 ) set state to -3 StartScript mwse_keysetup endif return elseif ( state == -3 ) if ( ScriptRunning mwse_keysetup == 0 ) set state to -2 StartScript mwse_levitatedemo endif return elseif ( state == -2 ) if ( ScriptRunning mwse_levitatedemo == 0 ) set state to -1 MessageBox "Select a demo to run (or rerun)" "Quit" "Key Setup" "Levitate" "Key Status" "Key Watch" "Text Input" "Inventory Demo" "Group Jump" "I/O Examples" endif return elseif ( state == -1 ) set state to GetButtonPressed if ( state == 1 ) StartScript mwse_keysetup elseif ( state == 2 ) StartScript mwse_levitatedemo elseif ( state == 3 ) StartScript mwse_keystatus elseif ( state == 4 ) StartScript mwse_keywatch elseif ( state == 5 ) StartScript mwse_textinput elseif ( state == 6 ) StartScript mwse_inventorydemo elseif ( state == 7 ) StartScript mwse_groupjump elseif ( state == 8 ) StartScript mwse_formatexample endif return elseif ( state == 1 ) if ( ScriptRunning mwse_keysetup == 0 ) set state to -2 endif elseif ( state == 2 ) if ( ScriptRunning mwse_levitatedemo == 0 ) set state to -2 endif elseif ( state == 3 ) if ( ScriptRunning mwse_keystatus == 0 ) set state to -2 endif elseif ( state == 4 ) if ( ScriptRunning mwse_keywatch == 0 ) set state to -2 endif elseif ( state == 5 ) if ( ScriptRunning mwse_textinput == 0 ) set state to -2 endif elseif ( state == 6 ) if ( ScriptRunning mwse_inventorydemo == 0 ) set state to -2 endif elseif ( state == 7 ) if ( ScriptRunning mwse_groupjump == 0 ) set state to -2 endif elseif ( state == 8 ) if ( ScriptRunning mwse_formatexample == 0 ) set state to 9 StartScript mwse_pipeexample endif elseif ( state == 9 ) if ( ScriptRunning mwse_pipeexample == 0 ) set state to -2 endif endif endGLOB*NAME CharGenStateFNAMsFLTVSPEL‚NAMEmwse_dispel_spellFNAM MWSE DispelSPDT ENAM9ÿÿddENAMÿÿÿÿSSCR5DATA111208739941348181830NAMEmwse_teststartSPEL^NAMEmwse_demo_spellFNAM MWSE DemoSPDT ENAM;ÿÿddSCPT] SCHD4mwse_textinputaltƒSCVRendcharmessagelengthSCDTƒ88l<8 8 8_Þl 358) 8IUse Backspace to replace this. ?88l<l 0$88l<8 8u 888l<88l<?88l<88l<88l<8· 8é0%s %~?× 0Press the END key when your message is complete.$Ý88l<8  8B!The message you typed was %Q%s%Q.~?...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................l 0l 0mwse_textinputaltSCTXobegin mwse_textinputalt long endchar long message long length ifx ( endchar ) else ; Initialization needed when endchar == 0 DisablePlayerControls set endchar to 35 ; END key setx message to xStringBuild "Use Backspace to replace this." set length to 0 return endif ifx ( length ) else ; Actual string edit while length == 0 setx length message to xTextInputAlt message endchar ; endchar could be 13 to stop at Enter MessageBox "" xMessageFix "%s %" message ; spaces and trailing % needed in case the player uses Backspace MessageBox " " MessageBox "Press the END key when your message is complete." return endif EnablePlayerControls MessageBox "" MessageBox "" xMessageFix "The message you typed was %Q%s%Q." message MessageBox "..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................." set length to 0 set endchar to 0 StopScript mwse_textinputalt endSCPT>SCHD4mwse_npcserviceoêSCVRgsmvSCDTê88s<8 8¤s 088l<?88l<88l<8B 8f" %H ~?6......................................................88s<8 8Fs 088l<?88l<8Ü 8" %H ~?6......................................................s 188s<8 8ès 088l<?88l<8~ 8¢" %H ~?6......................................................s 1SCTXøbegin mwse_npcservice ; I used this to test the Service functions by targeting this on some NPC from the console and then setting the v, g, m, and s values. short g short s short m long v ifx ( g ) set g to 0 setx v to xGetService v xMessageFix " %H " v MessageBox "......................................................" endif ifx ( s ) set s to 0 xSetService v xMessageFix " %H " v MessageBox "......................................................" set g to 1 endif ifx ( m ) set m to 0 xModService v xMessageFix " %H " v MessageBox "......................................................" set g to 1 endif end