Updated What are Scenarios? (markdown => textile)
parent
c4d7775f54
commit
44c787f929
2 changed files with 65 additions and 17 deletions
|
@ -1,17 +0,0 @@
|
||||||
# Scenarios
|
|
||||||
Scenarios for UHC are like plugins for server.
|
|
||||||
Download them then put them in your scenarios folder to add them.
|
|
||||||
To add a scenario to your UHC game, you need to be in waiting for more players, then type "/uhc scenarios add <****Scenario name>"
|
|
||||||
|
|
||||||
## How to create a scenario?
|
|
||||||
**Requirements**:
|
|
||||||
- PHP knowledges. You can learn it on [CodeAcademy](https://www.codecademy.com/en/learn/php)
|
|
||||||
- Some pocketmine API knowledeges that are essentials to know how to code it.
|
|
||||||
|
|
||||||
If you know all those, let's start:
|
|
||||||
First, create a new File that will be your scenario code named **"YOUR_SCENARIO_NAME.php"**.
|
|
||||||
Then, you'll need to add the class that will be your main class. So to do that, add some code inside:
|
|
||||||
<?php
|
|
||||||
# This is an example !
|
|
||||||
class YOUR_SCENARIO_NAME extends \Ad5001\UHC\scenario\Scenario {
|
|
||||||
}
|
|
65
What-are-Scenarios?.textile
Normal file
65
What-are-Scenarios?.textile
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<h1> Scenarios </h1>
|
||||||
|
Scenarios for UHC are like plugins for server.
|
||||||
|
Download them then put them in your scenarios folder to add them.
|
||||||
|
To add a scenario to your UHC game, you need to be in waiting for more players, then type "/uhc scenarios add <****Scenario name>"
|
||||||
|
|
||||||
|
<h2> How to create a scenario?</h2>
|
||||||
|
**Requirements**:
|
||||||
|
- PHP knowledges. You can learn it on "CodeAcademy":https://www.codecademy.com/en/learn/php
|
||||||
|
- Some pocketmine API knowledeges that are essentials to know how to code it.
|
||||||
|
|
||||||
|
If you know all those, let's start:
|
||||||
|
First, create a new File that will be your scenario code named **"YOUR_SCENARIO_NAME.php"**.
|
||||||
|
Then, you'll need to add the class that will be your main class. So to do that, add some code inside:
|
||||||
|
|
||||||
|
<pre><code><?php
|
||||||
|
# This is an example !
|
||||||
|
class YOUR_SCENARIO_NAME extends \Ad5001\UHC\scenario\Scenario {
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
Great ! Now you know that, let's learn a bit about the functions of the API:
|
||||||
|
<table style='border-width:0 0 1px;border-bottom:1px solid #cbcbcb'>
|
||||||
|
<tr>
|
||||||
|
<td> Function name </td>
|
||||||
|
<td> Function parameters </td>
|
||||||
|
<td> Description </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> onEnable </td>
|
||||||
|
<td> none </td>
|
||||||
|
<td> Execute the code when the game start ! </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> onStop </td>
|
||||||
|
<td> none </td>
|
||||||
|
<td> Execute the code when the game finish </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> getConfig </td>
|
||||||
|
<td> none </td>
|
||||||
|
<td> Return you the params of the scenario's config </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> getServer </td>
|
||||||
|
<td> none </td>
|
||||||
|
<td> Return you the Server instance </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> reloadConfig </td>
|
||||||
|
<td> none </td>
|
||||||
|
<td> Reload the config </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> saveConfig </td>
|
||||||
|
<td> config </td>
|
||||||
|
<td> Save all the args you want in the config </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> getScenarioFolder </td>
|
||||||
|
<td> none </td>
|
||||||
|
<td> Get the path/folder of the scenarios. </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Hope you will play around with those !
|
||||||
|
You can publish your scenario here on the scenario resources/scenarios by clicking the "Fork" button, adding your scenario, then make a "Pull request" to merge your changes</h3>
|
Loading…
Reference in a new issue