Usecode Tutorial for Fishnet Stockings
Posted: Mon Jun 20, 2016 4:37 am
One of the items not included in the SIfixes is setting Flag 123, which allows you to ask the usual folks (Harnna, Jendon, and Bucia) about the fishnet stockings you found on or near Shmed after he attacks you. The released version of the game does not have these stockings, so the flag is never set. If you use the F2 cheat menu to set the flag you'll see the conversation option.
Previously I was trying to get Shmed’s death or the item on his corpse to somehow trigger this flag, but the original game didn't set other flags that way unless part of some other script. Most flags are set by conversation, such as giving info or an item, or by triggering an egg. Picking up items such as Erstam's Jawbone, the Flux Analyzer, and the Philanderer's Friend trigger eggs underneath them that set these flags accordingly. The Furnace lab explosions when you move certain reagents would be another eggample. These eggs are set to Criteria: "Something on" so when an item is moved off of them, they trigger an action.
Since there has been some interest in a tutorial, here’s a rough attempt.
Before you begin, it’s a good idea to have the latest Exult, SIfixes, Exult Studio, and Notepad++ installed.
1) Download the latest GIT source code snapshot from the Exult download page:
http://exult.info/download.php
2) Extract the files and find the content\sifixes folder. In the data folder has the output files, and the src folder has the input or source files.
3) Open the folder content\sifixes\src\header\si and open the file si_gflags.uc with Notepad++. You may need to right-click on it to get the option.
In Notepad++, to the Language Menu, then C, and choose C. This will color some of the words and functions, making the code a little more readable.
4) Scroll down to about line 162 or search for SLAIN_WOLF, and add this line after it:
This names the flag so we can use the friendly name elsewhere. The // indicates a comment which is the decimal number of the flag.
Save the file.
5) Use Notepad++ to create a new empty file, and copy/paste this content into it:
Save this file as fishnets.uc in the Misc folder, content\sifixes\src\misc.
6) Open the file usecode.uc from content\sifixes\src in Notepad++.
Scroll down around line 58 and add these two lines:
This should line up with the other #include “misc/script.uc” lines listed above it.
Save the file. You can now close Notepad++ if you wish, it will reopen the three files when you reopen it.
7) Right-click on the make.bat file in content\sifixes\src, and choose Edit with Notepad++.
Go to the last blank line and add the word pause to the line, then save the file. This will let you see confirmation that your code compiled correctly or had an error, and if so where.
8) Right-click on that same make.bat file and choose Run as Administrator. This will recreate the output files that will be placed in content\sifixes\data. Go into that folder and find the Usecode file. It does not have a file extension.
9) Go to your SIfixes folder, something like C:\Program Files\Exult\Serpent_Isle\mods\sifixes\data and rename the existing Usecode file to orig_usecode. This way you can easily undo the swap if you need.
10) Copy that new Usecode file from content\sifixes\data to C:\Program Files\Exult\Serpent_Isle\mods\sifixes\data or your equivalent.
11) Copy your existing Exult shortcut, or make a new one. Then edit this shortcut by right-clicking on it and going to Properties. On the Target line, add a space and two dashes and the word edit to the end of the line. It should look something like: "C:\Program Files\Exult\Exult.exe" –edit
Click the Apply button, then optionally go to the General tab and rename the shortcut to Exult Edit Mode or similar. Click the OK button.
12) Start Exult Edit Mode and choose Show Mods under Serpent Isle, then choose Serpent Isle Fixes. Start a new game. The game engine will start in Edit Mode with Exult Studio open.
13) In Exult Press F2 to enter the cheat window. Note your starting coordinates, 0478, 2483.
Press N for NPC editing, then type 75 and press Enter. Shmed is already sitting in his office, the shack outside of the Knight’s Test. Press T to teleport to that spot, then press Escape twice.
14) In Exult Studio, go the Edit menu, then Create egg... Set the following options:
Criteria: Something on
Flags: Auto-reset (on by default)
Probability: 100 (we want this to happen consistently)
Distance: 1 (should be fine, it is the default)
Select the Usecode tab, then click on the Browse button under that. If it is not already selected, your file path should be something like C:\Program Files\Exult\Serpent_Isle\mods\sifixes\data\usecode with a list of Objects and Shapes.
Select the line FoundStockings, 00bffH, Object. Click OK.
The Function Number or Name should now show FoundStockings.
The Quality field should be set to 1 as the default. If not, set it.
Click the Apply button, then click on the main Exult map to place the egg. You can safely move it. In this case, I put it on the empty table in the southeast corner of Shmed’s office. It should be just a hair to the right of the bottom center, so the bottom of the green U shape is under the wall.
15) Back in Exult Studio, on the left side under Shape Files, click on shapes.vga.
In the lower right corner, click on the Frames button. This will expand out all the possible shapes there.
In the Find field, type in the word stockings and click on the Down button.
The blue moonsilk stockings will be selected, but the next item is the gray fishnet stockings.
Drag and drop that item onto the main Exult window. Like the egg you can reposition it. It should be on top of the green U shaped egg on the table, similar to the Jawbone or Flux Analyzer.
16) Optionally, you can double-click on Shmed and drag items from Exult Studio’s shapes section to his paperdoll. In the leaked beta version he has chain leggings, which makes him a more challenging opponent. Close his paperdoll window when you are done.
17) In the main Exult window, press F2, then T to teleport, and D to enter decimal coordinates. Enter the X and Y one at a time, 0478 and then 2483. The leading zero is optional. Press Escape twice to go back to the starting location.
18) In Exult Studio, go to the File menu, then choose Save all. This will update the map, as well as Shmed’s equipment. If you only save the map, I am not sure if Shmed’s updated gear will be saved. (Marzo, Dominus?) Close the main Exult window as well.
19) Restart Exult using the normal shortcut and start a new game. As before you can teleport to Shmed’s office by using F2, N, 75, T, Escape twice. You can check your current flag 123 status by going into F2, F, 123. It should be unset until you pick up the fishnet stockings, which should immediately set the flag when you pick them up or move them. If so, congratulations!
If anyone would like to try these instructions and give me feedback I’d appreciate it. I wish this Phorum had a preview button.
Previously I was trying to get Shmed’s death or the item on his corpse to somehow trigger this flag, but the original game didn't set other flags that way unless part of some other script. Most flags are set by conversation, such as giving info or an item, or by triggering an egg. Picking up items such as Erstam's Jawbone, the Flux Analyzer, and the Philanderer's Friend trigger eggs underneath them that set these flags accordingly. The Furnace lab explosions when you move certain reagents would be another eggample. These eggs are set to Criteria: "Something on" so when an item is moved off of them, they trigger an action.
Since there has been some interest in a tutorial, here’s a rough attempt.
Before you begin, it’s a good idea to have the latest Exult, SIfixes, Exult Studio, and Notepad++ installed.
1) Download the latest GIT source code snapshot from the Exult download page:
http://exult.info/download.php
2) Extract the files and find the content\sifixes folder. In the data folder has the output files, and the src folder has the input or source files.
3) Open the folder content\sifixes\src\header\si and open the file si_gflags.uc with Notepad++. You may need to right-click on it to get the option.
In Notepad++, to the Language Menu, then C, and choose C. This will color some of the words and functions, making the code a little more readable.
4) Scroll down to about line 162 or search for SLAIN_WOLF, and add this line after it:
Code: Select all
FOUND_FISHNETS = 0x7B, //123
Save the file.
5) Use Notepad++ to create a new empty file, and copy/paste this content into it:
Code: Select all
void FoundStockings object#(0xBFF) ()
{
if (event == EGG)
gflags[FOUND_FISHNETS] = true; //Added to si_gflags.uc as 0x7B
}
6) Open the file usecode.uc from content\sifixes\src in Notepad++.
Scroll down around line 58 and add these two lines:
Code: Select all
// Enables flag for fishnet questions
#include "misc/fishnets.uc"
Save the file. You can now close Notepad++ if you wish, it will reopen the three files when you reopen it.
7) Right-click on the make.bat file in content\sifixes\src, and choose Edit with Notepad++.
Go to the last blank line and add the word pause to the line, then save the file. This will let you see confirmation that your code compiled correctly or had an error, and if so where.
8) Right-click on that same make.bat file and choose Run as Administrator. This will recreate the output files that will be placed in content\sifixes\data. Go into that folder and find the Usecode file. It does not have a file extension.
9) Go to your SIfixes folder, something like C:\Program Files\Exult\Serpent_Isle\mods\sifixes\data and rename the existing Usecode file to orig_usecode. This way you can easily undo the swap if you need.
10) Copy that new Usecode file from content\sifixes\data to C:\Program Files\Exult\Serpent_Isle\mods\sifixes\data or your equivalent.
11) Copy your existing Exult shortcut, or make a new one. Then edit this shortcut by right-clicking on it and going to Properties. On the Target line, add a space and two dashes and the word edit to the end of the line. It should look something like: "C:\Program Files\Exult\Exult.exe" –edit
Click the Apply button, then optionally go to the General tab and rename the shortcut to Exult Edit Mode or similar. Click the OK button.
12) Start Exult Edit Mode and choose Show Mods under Serpent Isle, then choose Serpent Isle Fixes. Start a new game. The game engine will start in Edit Mode with Exult Studio open.
13) In Exult Press F2 to enter the cheat window. Note your starting coordinates, 0478, 2483.
Press N for NPC editing, then type 75 and press Enter. Shmed is already sitting in his office, the shack outside of the Knight’s Test. Press T to teleport to that spot, then press Escape twice.
14) In Exult Studio, go the Edit menu, then Create egg... Set the following options:
Criteria: Something on
Flags: Auto-reset (on by default)
Probability: 100 (we want this to happen consistently)
Distance: 1 (should be fine, it is the default)
Select the Usecode tab, then click on the Browse button under that. If it is not already selected, your file path should be something like C:\Program Files\Exult\Serpent_Isle\mods\sifixes\data\usecode with a list of Objects and Shapes.
Select the line FoundStockings, 00bffH, Object. Click OK.
The Function Number or Name should now show FoundStockings.
The Quality field should be set to 1 as the default. If not, set it.
Click the Apply button, then click on the main Exult map to place the egg. You can safely move it. In this case, I put it on the empty table in the southeast corner of Shmed’s office. It should be just a hair to the right of the bottom center, so the bottom of the green U shape is under the wall.
15) Back in Exult Studio, on the left side under Shape Files, click on shapes.vga.
In the lower right corner, click on the Frames button. This will expand out all the possible shapes there.
In the Find field, type in the word stockings and click on the Down button.
The blue moonsilk stockings will be selected, but the next item is the gray fishnet stockings.
Drag and drop that item onto the main Exult window. Like the egg you can reposition it. It should be on top of the green U shaped egg on the table, similar to the Jawbone or Flux Analyzer.
16) Optionally, you can double-click on Shmed and drag items from Exult Studio’s shapes section to his paperdoll. In the leaked beta version he has chain leggings, which makes him a more challenging opponent. Close his paperdoll window when you are done.
17) In the main Exult window, press F2, then T to teleport, and D to enter decimal coordinates. Enter the X and Y one at a time, 0478 and then 2483. The leading zero is optional. Press Escape twice to go back to the starting location.
18) In Exult Studio, go to the File menu, then choose Save all. This will update the map, as well as Shmed’s equipment. If you only save the map, I am not sure if Shmed’s updated gear will be saved. (Marzo, Dominus?) Close the main Exult window as well.
19) Restart Exult using the normal shortcut and start a new game. As before you can teleport to Shmed’s office by using F2, N, 75, T, Escape twice. You can check your current flag 123 status by going into F2, F, 123. It should be unset until you pick up the fishnet stockings, which should immediately set the flag when you pick them up or move them. If so, congratulations!
If anyone would like to try these instructions and give me feedback I’d appreciate it. I wish this Phorum had a preview button.