reformatted and improved README.md
This commit is contained in:
		
							parent
							
								
									6626273867
								
							
						
					
					
						commit
						31d86bc058
					
				
							
								
								
									
										130
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										130
									
								
								README.md
									
									
									
									
									
								
							| @ -12,7 +12,7 @@ Massive rewrite/extension: Sokomine | ||||
| 1. [Tutorial](#tutorial) | ||||
| 2. [Chat Commands](#chat-commands) | ||||
| 3. [Terminology] (#terminology) | ||||
| 4. [Special dialogs] (#special-dialogs") | ||||
| 4. [Special dialogs] (#special-dialogs) | ||||
| 5. [How to configure NPC and add dialogs] (#how-to-configure) | ||||
| 6. [The privs] (#privs) | ||||
| 7. [Tools] (#tools) | ||||
| @ -42,99 +42,81 @@ Massive rewrite/extension: Sokomine | ||||
| <a name="tutorial"></a> | ||||
| 
 | ||||
| There is an NPC that explains a few things and adds as a tutuor. | ||||
| His savefile is: `n_1.json` | ||||
| Copy that file to the folder | ||||
| 	<your wold folder>/yl_speak_up_dialogs/n_1.json | ||||
| (replace the 1 with a higher number if you already have some NPC defined) | ||||
| The first NPC in your world will become a tutor (after you spawned it | ||||
| <br>The savefile is: `n_1.json` | ||||
| <br>Copy that file to the folder | ||||
| 	`<your wold folder>/yl_speak_up_dialogs/n_1.json` | ||||
| (replace the 1 with a higher number if you already have some NPC defined). | ||||
| <br>The first NPC in your world will now become a tutor (after you spawned it | ||||
| and set its name). | ||||
| 
 | ||||
| 
 | ||||
| ### 2. Chat commands | ||||
| ### 2. Chat Commands | ||||
| <a name="chat-commands"></a> | ||||
| 
 | ||||
| #### `/npc_talk style` Allows to select the formspec version: | ||||
| * 1: Very rudamentary. Not recommended. | ||||
| * 2: Shows additional buttons for up and down. | ||||
| * 3: Default (recommended) version. Scroll via mouse wheel. | ||||
| In general, chat commands used by this mod have the form `/npc_talk <command> [<optional parameters>]`. | ||||
| 
 | ||||
| #### `/npc_talk list`   Shows a list of all your NPC and where they are. | ||||
|  | Command | Description | | ||||
|  | ------- | ----------- | | ||||
|  | `style <nr>`       | Allows to select the formspec version with `<nr>` beeing 1, 2 or 3. Important for very old clients.| | ||||
|  | `list`             | Shows a list of all your NPC and where they are.| | ||||
|  | `debug [<npc_id>]` | Toggle debug mode for NPC `<npc_id>`. Warning: May scroll a lot.| | ||||
|  | `debug off`        | Turn debug mode off again.| | ||||
|  | `force_edit`       | Toggles edit mode for you.<br> From now on (until you issue this command again), all NPC you talk to will be in edit mode (provided you are allowed to edit them). This is useful if something's wrong with your NPC like i.e. you made it select a dialog automaticly and let that dialog lead to `d_end`. | | ||||
|  | `privs list`                    | List the privs of all NPC. NPC need privs for some dangerous things like executing lua code.| | ||||
|  | `privs grant <npc_id> <priv>`   | grant NPC `<npc_id>` the priv `<priv>`|` | ||||
|  | `privs revoke <npc_id> <priv>`  | revoke priv `<priv>` for NPC `<npc_id>`| | ||||
|  | `force_restore_npc <id> [<copy_from_id>]` | Restore an NPC that got lost. Only for emergencies.| | ||||
|  | `generic list`                 | list all NPC that provide generic dialogs| | ||||
|  | `generic add <npc_id>`         | add NPC `<npc_id>` as a new provider of generic dialogs| | ||||
|  | `generic remove <npc_id>`      | remove NPC `<npc_id>` as a provider of generic dialogs| | ||||
|  | `generic reload`               | reload data regarding generic dialogs| | ||||
|   | ||||
|             | ||||
| * Most commands need extra privs. Only `style <nr>`, `list`, `debug [<npc_id>]` and `force_edit` are available to all players. | ||||
| 
 | ||||
| #### `/npc_talk debug`  Allows to debug dialogs. | ||||
| * `/npc_talk_reload` Reload almost all of the code of this mod. <br>When you add custom new functions to this mod or change a custom function - or even code of the mod itself! -, you can reload this mod without having to restart the server. If you made an error and the files can't load then your server will crash - so please test on a test server first!<br>Requires the privs priv. | ||||
| 
 | ||||
| #### `/npc_talk force_edit`	Toggles edit mode. | ||||
| 		From now on (until you issue this command again), all NPC you | ||||
| 		talk to will be in edit mode (provided you are allowed to | ||||
| 		edit them). This is useful if something's wrong with your NPC | ||||
| 		like i.e. you made it select a dialog automaticly and let | ||||
| 		that dialog lead to d_end. | ||||
| * The diffrent npc talk styles are: | ||||
|  | Style      | Useful for  | | ||||
|  | ---------- | ----------- |  | ||||
|  | `/npc_talk style 1` | Very rudamentary. Not recommended. Only use with really ancient clients.| | ||||
|  | `/npc_talk style 2` | Shows additional buttons for up and down. Might help users of mobile clients. If they report problems, recommend them this option.| | ||||
|  | `/npc_talk style 3` | Default (recommended) version. Scroll via mouse wheel between the options. | | ||||
| 
 | ||||
| #### `/npc_talk privs`  grant, revoke or list the privs of NPC. NPC need privs for | ||||
|                  some dangerous things like executing lua code. Examples: | ||||
|                  `/npc_talk privs list`     lists the privs of all NPC | ||||
|                  `/npc_talk privs grant n_3 effect_exec_lua` | ||||
|                                            grants NPC n_3 the right to execute | ||||
|                                            lua code as an effect/result | ||||
|                  Note: If a precondition or effect originates from a generic | ||||
|                        NPC, the priv will be considered granted if either the | ||||
|                        executing NPC or the the generic NPC has the priv. | ||||
| * NPC need privs for some dangerous things like executing lua code. | ||||
| <br>Example: `/npc_talk privs grant n_3 effect_exec_lua` | ||||
| <br>grants NPC n_3 the right to execute lua code as an effect/result. | ||||
| <br>Note: If a precondition or effect originates from a generic NPC, the priv will be considered granted if either the executing NPC or the the generic NPC has the priv. | ||||
| 
 | ||||
| #### `/npc_talk force_restore_npc <id> [<copy_from_id>]`  Restore an NPC that got lost. | ||||
|                 It may have got lost due to someone having misplaced its egg. | ||||
|                 Or it might have been killed somehow. | ||||
|                 The optional parameter `<copy_from_id>` is only used when the NPC | ||||
|                 is *not* listed in `/npc_talk list`. You won't need it. It's for legacy NPC. | ||||
|                 WARNING: If the egg or the NPC turns up elsewhere, be sure to have only | ||||
|                          *ONE* NPC with that ID standing around! Else you'll get chaos. | ||||
| * The `force_restore_npc` is rarely needed. You only need it if the NPC entity and its spawn egg got lost. It may have got lost due to someone having misplaced its egg. Or it might have been killed somehow. | ||||
| <br>The optional parameter `<copy_from_id>` is only used when the NPC is *not* listed in `/npc_talk list`. You won't need it. It's for legacy NPC. | ||||
| <br>WARNING: If the egg or the NPC turns up elsewhere, be sure to have only *one* NPC with that ID standing around! Else you'll get chaos. | ||||
| 
 | ||||
| #### `/npc_talk generic`  Add or remove NPC from the list of generic dialog providers. | ||||
|                  `/npc_talk generic list`      Lists all generic NPC | ||||
|                  `/npc_talk generic add n_3`   Adds the dialog from NPC as a | ||||
|                                                generic dialog. | ||||
|                  `/npc_talk generic add n_3`   Removes the dialog from NPC as a | ||||
|                                                generic dialog. | ||||
| 		   Requires the npc_talk_admin priv. | ||||
| 
 | ||||
| #### `/npc_talk_reload`   Reload almost all of the code of this mod. | ||||
| 		When you add custom new functions to this mod or change a | ||||
| 		custom function - or even code of the mod itself! -, you can | ||||
| 		reload this mod without having to restart the server. | ||||
| 		If you made an error and the files can't load then your | ||||
| 		server will crash - so please test on a test server first! | ||||
| 		   Requires the privs priv. | ||||
| 
 | ||||
| ### 3. Terminology | ||||
| <a name="terminology"></a> | ||||
| ### 3. Terminology | ||||
| 
 | ||||
| dialog           A text said by the NPC, with diffrent replys the player can | ||||
|                  select from. | ||||
| 
 | ||||
| option           A reply/answer to the text the NPC said. | ||||
| 
 | ||||
| precondition/    All listed preconditions have to be true in order for the NPC | ||||
| prerequirement   to offer this option. | ||||
| 
 | ||||
| action           An action the player may (or may not) take, i.e. trading, | ||||
|                  taking an item from the NPC, giving the NPC something, entering | ||||
|                  the right password etc. | ||||
| 
 | ||||
| effect/result    Further effects (like setting variables, handing out items) | ||||
|                  that take place after the action was successful. | ||||
| 
 | ||||
| alternate text   Text shown instead of the normal dialog text. This is useful | ||||
|                  when you have a dialog with a lot of questions and want the | ||||
|                  player to be able to easily select the next question without | ||||
|                  having to create a new dialog for each option. | ||||
|  | Word used      | What it means | | ||||
|  | -------------- | ------------- | | ||||
|  | dialog         | A text said by the NPC, with diffrent replys the player can select from.| | ||||
|  | option         | A reply/answer to the text the NPC said. The player selects one by clicking on it.| | ||||
|  | precondition/<br>prerequirement | All listed preconditions have to be true in order for the NPC to offer an option.| | ||||
|  | action         | An action the player may (or may not) take, i.e. trading, taking an item from the NPC, giving the NPC something, entering the right password etc. The action happens after the option is selected by the player.| | ||||
|  | effect/result  | Further effects (like setting variables, handing out items) that take place after the action was successful. If there was no action, the effects/results will be executed directly after selecting the option.| | ||||
|  | alternate text | Text shown instead of the normal dialog text. This is useful when you have a dialog with a lot of questions and want the player to be able to easily select the next question without having to create a new dialog for each option.| | ||||
| 
 | ||||
| 
 | ||||
| ### 4. Special dialogs | ||||
| <a name="special-dialogs"></a> | ||||
| 
 | ||||
| In general, dialogs follow the naming schem "d_<nr>". However, some few have a | ||||
| In general, dialogs follow the naming schem `d_<Nr>`. However, some few have a | ||||
| special meaning: | ||||
| 
 | ||||
| `d_end`            End the conversation (i.e. after teleporting the player). | ||||
| `d_got_item`       The NPC got something and is trying to decide what to do with it. | ||||
|  | Dialog           | Meaning | | ||||
|  | ---------------- | ------- | | ||||
|  | `d_<Nr>`         | Normal dialog. They are automaticly numbered. | | ||||
|  | `d_end`          | End the conversation (i.e. after teleporting the player). | | ||||
|  | `d_got_item`     | The NPC got something and is trying to decide what to do with it. | | ||||
|  | `d_trade`        | Trade-specific options. I.e. crafting new items when stock is low.| | ||||
| 
 | ||||
| 
 | ||||
| ### 5. How to configure NPC and add dialogs | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user