!!!READ ME - 2. Owner Initial Setup Instructions.txt 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. // :SHOW:
  2. // :CATEGORY:NPC
  3. // :NAME:PMAC
  4. // :AUTHOR:Aine Caoimhe
  5. // :KEYWORDS:
  6. // :CREATED:2015-11-24 20:38:40
  7. // :EDITED:2015-11-24 19:38:40
  8. // :ID:1095
  9. // :NUM:1872
  10. // :REV:1
  11. // :WORLD:OpenSim
  12. // :DESCRIPTION:
  13. // PARAMOUR MULTI-ANIMATION CONTROLLER (PMAC) v1.02 (OSSL)
  14. // :CODE:
  15. PARAMOUR MULTI-ANIMATION CONTROLLER (PMAC) v1.0 (OSSL)
  16. by Aine Caoimhe January 2015
  17. OWNER INITIAL SET-UP AND INSTALLATION
  18. **** OVERVIEW *****
  19. A new PMAC system is usually supplied inside an object that is already set up and configured for general use,
  20. containing all of the necessary animations, notecards, etc. In most cases you can simply "rez and play" right
  21. away provided your region is already set up to allow the necessary script functions.
  22. This notecard contains details configuring regions correctly to allow PMAC to work, details about some of the
  23. user settings you may wish to change, and trouble-shooting tips.
  24. The step-by-step overview for a new user is to set (or confirm) the following:
  25. 1. Ensure the server supports the script
  26. 2. Ensure the region is configured to allow the necessary functions
  27. 3. Rez the object
  28. 4. If necessary, reset or even recompile the scripts
  29. 5. Adjust any user settings according to preference
  30. ***************************************
  31. 1. Ensure Server Support of the Script
  32. ****************************************
  33. PMAC uses both LSL and OSSL functions that make extensive use of vectors and rotations for positioning and text-based
  34. notecards for data storage. The server must use the period (decimal point)(.) as the decimal separator for numbers that
  35. require this precision (called "floats").
  36. In almost all cases your server will already have this configuration (otherwise other scripts would also have issues)
  37. but if you experience problems with odd behaviour this is the first thing to check. Some computer localizations (particularly
  38. linux systems in Europe) may be configured to use the comma (,) as the decimal separator which will *not*
  39. work with this system (and many other LSL scripts). Consult your operating system guide as to how to
  40. configure the computer to use the decimal point separator.
  41. ********************************************************************
  42. 2. Ensure the Region is Configured to Allow the Necessary Functions
  43. ********************************************************************
  44. The PMAC script makes extensive use of a special set of functions that are only available in Opensim: OSSL functions.
  45. Depending on your region's configuration, these may or may not be available so it is essential to check and ensure that
  46. the correct settings have been made. As a general rule of thumb:
  47. - By default, stock Opensim builds will need changes to the region configuration
  48. - By default, the Diva distribution is pre-configured correctly and will require no changes
  49. - Most open grid configurations will require at least some changes
  50. - Many region hosting services will require some changes, although this is slowly changing, and for many
  51. such providers any changes to the ini files must be made by their staff. If that's the case for you, please
  52. provide them with a copy of this information.
  53. ****** NOTE: there have been recent changes to OSSL function set-up and enabling *****
  54. The method for setting OSSL functions changed as of Opensim Git #2e1f5bb (r/25931 2015-04-14) so the instructions
  55. below may not be fully applicable to your region's set-up. Please see:
  56. http://ainetutorials.blogspot.ca/2015/04/notice-ossl-implementation-changes-for.html for further information
  57. You will still need to enable NPC in the [NPC section] in either case.
  58. Unless you are using a special custom configuration (such as the Diva distribution) the configuration changes that
  59. need to be made are located in the /bin/opensim.ini file that is in the same directory as the opensim.exe for the
  60. instance that runs the region.
  61. Scroll down through the opensim.ini file and look for the [NPC] section and ensure that NPCs are enabled to allow
  62. PMAC to rez them in the region
  63. [NPC]
  64. Enabled = true
  65. Now scroll through the opensim.ini file and find the [XEngine] section -- usually it is before the [NPC] section.
  66. There are a number of changes that need to be made here. First, we need to generally allow OSSL functions, then
  67. we need to ensure that some of the ones used by PMAC are both available and suitably "protected" against abuse
  68. by other visitors to your region.
  69. In the [XEngine] section find the line where the AllowOSFunctions variable is set and ensure it is set to true.
  70. [XEngine]
  71. AllowOSFunctions = true
  72. A little further down, look for OSFunctionThreatLevel which sets a global "threat level" for OSSL functions.
  73. If an OSSL has this threat level or less, it will be allowed for any script that wants to use it. By default
  74. Opensim has this set to VeryLow but in my opinion a global Low setting is perfectly secure.
  75. [XEngine]
  76. OSFunctionThreatLevel = Low
  77. PMAC uses a number of functions that are "higher threat" than this, though. You could just set a far higher
  78. global threat level but then you would expose yourself and your region guests to malicious visitors so I strongly
  79. advise against doing so. Instead, you can set specific functions to be available only to a limited range of users.
  80. The options are to specify one or more of the following to have permission to use each function (the one(s) you use
  81. will depend on your specific set-up):
  82. - ESTATE_OWNER allows scripts owned by the estate owner of the region to use those functions
  83. - ESTATE_MANAGER does the same for scripts owned by one of your estate managers
  84. - PARCEL_OWNER does the same for scripts owned by a parcel owner and located in that parcel
  85. - PARCEL_GROUP_MEMBER does the same for scripts owned by a member of the same group that the parcel
  86. - by specifying the UUID of a user (or multiple users) to allow scripts they own to use the functions
  87. Note that in all cases it is the script owner (usually whoever rezzed the object) that is checked against
  88. the permission, not the person using it.
  89. It is beyond the scope of these instructions to go any further into this so if you wish to get absolutely all
  90. of the details see: http://opensimulator.org/wiki/Threat_level
  91. For someone who is a region owner (usually this means ESTATE_OWNER) I would suggest setting all OSSL functions
  92. to be available at least for any scripts that you own, and in many cases probably for those belonging to any E
  93. STATE_MANAGER you assign (since to give them those powers you probably trust them sufficiently not to abuse them).
  94. My own regions' XEngine section includes the following lines to enable OSSL and allow scripts owned by myself
  95. or my estate managers to use functions that are either used by PMAC or are likely to be used by other common
  96. OSSL scripts you might wish to write/use (usually relating to NPC or animation):
  97. [XEngine]
  98. AllowOSFunctions = true
  99. OSFunctionThreatLevel = Low
  100. Allow_osMessageAttachments = true
  101. Allow_osGetGridName = ESTATE_OWNER, ESTATE_MANAGER
  102. Allow_osGetGridNick = ESTATE_OWNER, ESTATE_MANAGER
  103. Allow_osOwnerSaveAppearance = ESTATE_OWNER, ESTATE_MANAGER
  104. Allow_osGetLinkPrimitiveParams = ESTATE_OWNER, ESTATE_MANAGER
  105. Allow_osGetPrimitiveParams = ESTATE_OWNER, ESTATE_MANAGER
  106. Allow_osMakeNotecard = ESTATE_OWNER, ESTATE_MANAGER
  107. Allow_osNpcCreate = ESTATE_OWNER, ESTATE_MANAGER
  108. Allow_osNpcGetPos = ESTATE_OWNER, ESTATE_MANAGER
  109. Allow_osNpcGetRot = ESTATE_OWNER, ESTATE_MANAGER
  110. Allow_osNpcLoadAppearance = ESTATE_OWNER, ESTATE_MANAGER
  111. Allow_osNpcMoveTo = ESTATE_OWNER, ESTATE_MANAGER
  112. Allow_osNpcMoveToTarget = ESTATE_OWNER, ESTATE_MANAGER
  113. Allow_osNpcPlayAnimation = ESTATE_OWNER, ESTATE_MANAGER
  114. Allow_osNpcRemove = ESTATE_OWNER, ESTATE_MANAGER
  115. Allow_osNpcSaveAppearance = ESTATE_OWNER, ESTATE_MANAGER
  116. Allow_osNpcSay = ESTATE_OWNER, ESTATE_MANAGER
  117. Allow_osNpcSetRot = ESTATE_OWNER, ESTATE_MANAGER
  118. Allow_osNpcShout = ESTATE_OWNER, ESTATE_MANAGER
  119. Allow_osNpcSit = ESTATE_OWNER, ESTATE_MANAGER
  120. Allow_osNpcStand = ESTATE_OWNER, ESTATE_MANAGER
  121. Allow_osNpcStopAnimation = ESTATE_OWNER, ESTATE_MANAGER
  122. Allow_osNpcTouch = ESTATE_OWNER, ESTATE_MANAGER
  123. Allow_osNpcWhisper = ESTATE_OWNER, ESTATE_MANAGER
  124. Allow_osSetPrimitiveParams = ESTATE_OWNER, ESTATE_MANAGER
  125. Allow_osSetProjectionParams = ESTATE_OWNER, ESTATE_MANAGER
  126. Allow_osSetRegionWaterHeight = ESTATE_OWNER, ESTATE_MANAGER
  127. Allow_osSetTerrainHeight = ESTATE_OWNER, ESTATE_MANAGER
  128. Allow_osAvatarPlayAnimation = ESTATE_OWNER, ESTATE_MANAGER
  129. Allow_osAvatarStopAnimation = ESTATE_OWNER, ESTATE_MANAGER
  130. Allow_osForceOtherSit = ESTATE_OWNER, ESTATE_MANAGER
  131. Allow_osGetNotecard = ESTATE_OWNER, ESTATE_MANAGER
  132. Allow_osGetNotecardLine = ESTATE_OWNER, ESTATE_MANAGER
  133. Allow_osGetNumberOfNotecardLines = ESTATE_OWNER, ESTATE_MANAGER
  134. Allow_osRegionNotice = ESTATE_OWNER, ESTATE_MANAGER
  135. Allow_osAgentSaveAppearance = ESTATE_OWNER, ESTATE_MANAGER
  136. There are many other OSSL functions but the above will suffice for most people and includes the ones
  137. necessary to allow PMAC to work correctly. After making your changes you will need to save the
  138. opensim.ini file, then restart the simulator (restarting just the region will not suffice).
  139. ******************
  140. 3. Rez the Object
  141. ******************
  142. Not much to say here...just rez it to ground and position it wherever you want it to be.
  143. *******************************************
  144. 4. Reset or Recompile Scripts if Necessary
  145. *******************************************
  146. Exactly what will be required here depends on your main server configuration, your region
  147. configuration, and where you obtained the PMAC object. In many cases you won't need to do
  148. anything...simply rezzing the object will automatically cause the script to reset and initialize.
  149. After a second or two, you'll see a message in general chat telling you that initialization is
  150. complete and the object is ready to use.
  151. If this doesn't happen, you may simply be able to right-click on the object and use the radial
  152. menu to reset the script.
  153. In some regions and/or grids, it is necessary to "recompile" a script -- particularly when the
  154. object was obtained from a different grid while hypergridding -- before it will work. Although
  155. a little tedious, if you don't know how to recompile a script here is a set of steps to take to
  156. be absolutely sure that everything is running properly:
  157. 1. Select the object while in edit mode in your viewer
  158. 2. Take a copy of the PMAC Core script into your own inventory
  159. 3. If the object contains any add-on scripts, take copies of those too
  160. 4. Look for an object in inventory called "~~~positioner" and take a copy of it as well
  161. 5. Wear the ~~~positioner object (on your left hand), then edit it and open the script inside it
  162. 6. Make a tiny change to this script by adding a space at the end of one of the red comment lines
  163. (or add an empty blank line at the very end)
  164. 7. Now "Save" this. You should simply see a "Save complete" notice and no errors...this has forced
  165. that script to recompile.
  166. 8. Now unwear the ~~~positioner
  167. 9. Delete the original ~~~positioner from the main object's inventory
  168. 10. Now place your newly recompiled ~~~positioner from your inventory into the original object
  169. 11. Delete each of the scripts that you took copies of from the original object
  170. 12. If you have any add-on scripts, put the copies of these back into the original object first.
  171. They will automatically recompile when you do this.
  172. 13. And finally, place the copy of the PMAC Core script back into the original object and it will
  173. recompile as well.
  174. You should now see the message telling you that initialization is complete and the object is ready to use.
  175. ***********************************************
  176. 5. Adjust User Settings According to Preference
  177. ***********************************************
  178. In most cases this is entirely optional because the object will come pre-configured to be suitable
  179. for the average user. If you want to look at the settings or change any, open the PMAC Core script
  180. and you will see a section at the top where you can do this -- it's divided into a "general user
  181. section" and an "advanced/builder" section.
  182. I'll give detailed information for the basic ones, and assume that anyone using the advanced/builder
  183. ones will have enough scripting knowledge to need a little less detail.
  184. ***** General User Settings: *****
  185. Name: defaultGroup
  186. Type : string
  187. Use: Identify the animation group to load when the PMAC object initializes.
  188. Details:
  189. The name you supply here is just the simple group name, not the full notecard name, and must be
  190. enclosed in quotation marks (with a semi-colon after the last one). If your animation group's
  191. notecard name is ".menu123A Groupname" then the value you'd enter just "Groupname" for this variable.
  192. It will always be loaded initially, even if its permission settings wouldn't normally allow the user to do so.
  193. ********
  194. Name: resetOnQuit
  195. Type : integer (boolean) TRUE or FALSE
  196. Use: Indicate whether the script should reset and re-initialize the object when you stop using it.
  197. Details:
  198. If you set this to TRUE (no quotation marks!) then after you finish using the object and everyone
  199. stands up, the object will completely reset itself and reload all of its default values. This is useful
  200. for furniture items where you might want them to have a specific set of animations active whenever
  201. someone new sits down and you don't want to have to remember to reset it back to these when you finish using it.
  202. If you set this to FALSE it will simply leave everything the way it's currently set and when someone
  203. sits down again it will resume with whatever animation was most recently loaded. If it was in auto mode
  204. when you stopped using it, it will resume auto mode when the next person sits.
  205. **********
  206. Name: ownerUseReq
  207. Type : integer (boolean) TRUE or FALSE
  208. Use: Indicate whether the owner must be sitting on the object before anyone else is allowed to sit
  209. Details:
  210. If set to TRUE, the object will refuse to allow anyone other than the owner to sit on it. Once the owner
  211. is seated, other people will then be allowed to sit as well. If the owner then stands, the existing users
  212. will be allowed to remain there but no new user (other than the owner) will be allowed to sit. Normally
  213. you'd only set this to TRUE for an object that you wish to reserve for your own private use.
  214. If set to FALSE, anyone can sit down and start using the object even if the owner is offline or in another region.
  215. **********
  216. Name: ownerOnlyMenus
  217. Type : integer (boolean) TRUE or FALSE
  218. Use: Indicate whether only the owner is allowed to access the dialog menus
  219. Details:
  220. If set to TRUE, only the owner can ever touch the object to access the dialogs. Anyone else who sits will
  221. simply play whatever the current animation is and continue to do so until the owner uses the menu to change it.
  222. If auto mode is enabled then it will change animations based on its timer setting so you could use this as a
  223. sort of "multi-person AO" for a furniture item.
  224. If set to FALSE, anyone can touch the object and ask to be the controller in charge of the dialogs. The menu
  225. options they see will depend on the permission settings of the individual group notecards and NPC notecards.
  226. Only the owner ever sees the top line of the OPTIONS menu.
  227. ***********
  228. Name: ownerUseUnlocksPerms
  229. Type : integer (boolean) TRUE or FALSE
  230. Use: Indicate whether other users temporarily gain "owner" permissions for groups and NPCs if the owner seated
  231. Details:
  232. If set to TRUE, when the owner is one of the users currently seated on the object, all users can then access
  233. animation groups and NPCs that are normally restricted to the owner. This is a setting you might use for a bed
  234. where you want a different (larger) set of animations available when you're there, but want to restrict them otherwise.
  235. If set to FALSE, only the owner will ever be able to see or load notecards where the permission is set to
  236. owner-only; and only group members with the group currently active will see or be able to access notecards where
  237. the permission is set to group.
  238. *************
  239. Name: autoOn
  240. Type : integer (boolean) TRUE or FALSE
  241. Use: Indicate whether the PMAC Auto mode should be turned on by default
  242. Details:
  243. Auto mode automatically cycles through the animations in the currently-loaded animation group, advancing based
  244. on the time set for autoTimer (see below). If you set this to TRUE, this will automatically be enabled any time
  245. the script is reset so it would be particularly useful if you're using the ownerOnlyMenus=TRUE setting above.
  246. If set to FALSE, the object will be in manual mode when the script resets.
  247. Regardless of this setting, when you stop using the object it will remember and whatever its last setting was
  248. and use it when someone sits down to start using it again. If you don't want that to happen you would need to
  249. set the resetOnScript=TRUE (see above) which will cause the script to reset after you stop using it and then
  250. pick up and use the default value again.
  251. *************
  252. Name: autoTimer
  253. Type : float
  254. Use: Set a default time to use for the auto mode's timer
  255. Details:
  256. The value set here is a number larger than 0.0 and determines the default number of seconds to wait before
  257. advancing to the next animation when PMAC is in auto mode. You can use the OPTIONS menu to change this
  258. during use, too. When you stop using the object it will remember whatever value was most recently used and won't
  259. pick up and use this default value again until the script is reset.
  260. *************
  261. Name: showGroupsMenuFirst
  262. Type : integer (boolean) TRUE or FALSE
  263. Use: determines which menu level to show first when initiating dialog
  264. Details:
  265. When FALSE, initiating the dialog will display the current group's animation selection menu (PMAC 1.01 and MLP
  266. normal behavour). When TRUE, the groups menu will be shown instead. Default is FALSE.
  267. *************
  268. Name: allowSoloNPC
  269. Type : integer (boolean) TRUE or FALSE
  270. Use: Determines whether an NPC can occupy a PMAC object when no avatars are currently using it
  271. Details:
  272. When FALSE, PMAC will not allow a NPC to sit on a PMAC object unless an avatar user is already seated. When
  273. there are no remaining "real" users, any remaining NPC are removed. When TRUE, NPCs are allowed to occupy the
  274. object but it becomes your responsibility to later unseat them and remove them from the scene. DO NOT manually
  275. reset the core script until you've removed any NPCs it is controlling or they will become stranded. NOTE: using
  276. the dialog option "QUIT" will still remove all NPCs regardless of this setting.
  277. ***** Advanced/Builder Settings: *****
  278. There are five variables in this section, three of which are simply convenience/preference tweaks
  279. that change the appearance of the "positioner" handles when you are in edit mode.
  280. handleName is the object name in inventory for the positioning handle. If you want to use a different
  281. handle than the one I supply by default, simply put it in inventory and enter its name for this
  282. variable to have it be rezzed instead.
  283. handleColours is a list of nine LSL vector colours to use for the positioning handles in edit mode.
  284. You must supply exactly 9 vectors and they are rezzed in the order supplied in the list for each position.
  285. handleSize is the vector dimension to set for each of the positioning handles. All handles will use this same size.
  286. handleAlpha is the (float) alpha value that will be used for all of the positioning handles.
  287. And finally, baseAn is the name of a priority 1 animation in inventory that should be used for synch.
  288. I supply one in almost all animation products I use that is just a generic standing pose but if you
  289. want to use a different one then drop it into inventory and change this variable to that animation's
  290. name. This is a work-around method for the "fix" that was made to Opensim in 2012 that broke the old
  291. behaviour of stopping and starting animations. While there are various ways to make synch work, in my
  292. view this is the most reliable one for this sort of application. In normal use, you will never see it
  293. or even be aware that it's running underneath the other animations. When a user stands it is
  294. automatically released along with the currently playing animation.
  295. After making any changes to any of the above, save and your changes will be applied.
  296. *********************************
  297. 6. Optional Configuration Notecard
  298. *********************************
  299. Instead of manually setting configurations in the script directly, you can include a configuration
  300. notecard in PMAC's inventory instead. Bu default it must have the name ".PMAC-CONFIG" although
  301. you can change this in the script's user settings. Each line of the notecard can contain a parameter
  302. name, followed by an equals sign followed by the desired value. Any that are included will override
  303. the values set in the script directly, and any that omitted will use the script's current default
  304. values. Commands recognized:
  305. - defaultGroup or DefaultGroup
  306. - resetOnQuit or ResetOnQuit
  307. - ownerUseReq or OwnerUseReq
  308. - ownerOnlyMenus or OwnerOnlyMenus
  309. - ownerUseUnlocksPerms or OwnerUseUnlockPerms
  310. - autoTimer or AutoTimerValue
  311. - baseAn or BaseAnimation
  312. -showGroupsMenuFirst or ShowGroupsMenuFirst
  313. - allowSoloNPC or AllowSoloNPC
  314. Example: this would change the default menu to load on startup to "Cuddles", changes the behaviour to
  315. reset the script on quit, and changes the system to allow solo NPCs.
  316. defaultGroup = Cuddles
  317. ResetOnQuit = TRUE
  318. allowSoloNPC = TRUE
  319. ***************************
  320. 7. Other
  321. ***************************
  322. In most cases you'll now be up and ready to go and you will probably not have had to do many of the above steps.
  323. If you use add-ons to the PMAC system, they should supply any necessary instructions for how to set them.
  324. Add-ons are optional and do not need to be included in an object unless your set-up specifically uses them.
  325. If a notecard supplies commands for one but the add-on script isn't present, the command is ignored but it
  326. will in no way impair the operation of the core script.
  327. Unless you are a very advanced scripter I would strongly suggest you never change anything in the script
  328. other than these settings at the top (up to the place where it warns you not to change anything below it).