This global mod adds the following global BHAV
0x080B - "Distance - Modified for room/level" (Target OID, Temp#): Measures the distance in tiles between the Stack Object and the Target OID returning the measurement in Temp[Temp#].
The base distance is the same as the 0x000B primitive. If the objects are in different rooms, 25 is added. If the objects are on different levels, 100 is added for each level. Two objects 28 tiles apart according to primitive 0x000B but two floors apart (and hence in different rooms) will have a distance of 263 (28 base + 25 for different room + 200 for 2 levels apart). This makes it much easier to "find the nearest ..." type code, as the global automatically allows for different rooms and levels.
Copy this mod into your downloads folder, if you split my mods into a seperate sub-folder, I suggest you place it there as a number of my mods need it.
If you use SimPe to delve into my mods, you can get SimPe to recognise the new global BHAVs as follows.
- Start SimPe
- From the "Extra" menu, select "Preferences..."
- Click on the "File Table" in the left-hand ribbon
- Click on "add" (left most item of the "add" "delete" "change" triple)
- Click the "Load File" button
- Browse to the sub-folder you copied the WH_DistanceGlobals.package file to and select the package
- Click the "Open" button
- Click the "OK" button
- There will be a new entry at the top of the "Advanced Settings" area that refers to the WH_DistanceGlobals.package file, check the box to its left
- Click the "Reload" button
- Click the "OK" button
The mod adds global BHAVs starting at 0x080B as listed above, so will conflict with any other mod that does the same.
No known conflicts
- The developers of SimPE.
You are free to use my code in any way you want, a credit would be nice, but not required.
Specifically, you may
- reverse engineer the code to figure out how I did it
- modify the code to do something different but similar and redistribute it, provided you change the name of the .package file
- merge my code into your own mod and redistribute it
- merge my code into another mod for your own use. You may redistribute this mod-mod ONLY if the author(s) of the other mod permit it
Before contacting me to report any issues, errors or conflicts please ensure you have read and followed Help Me To Help You and Help Me To Help You - Part 2
- Download DistanceGlobals_V1.0.zip