Modding:Advanced Blocks: Difference between revisions

From Vintage Story Wiki
m
Updated navbox to new code navbox.
m (Major changes to tutorial explanations and updated game version.)
m (Updated navbox to new code navbox.)
 
(One intermediate revision by one other user not shown)
Line 60: Line 60:
Now you need to override the <code>Start(ICoreAPI)</code> method and register the class.
Now you need to override the <code>Start(ICoreAPI)</code> method and register the class.


<!--T:37-->
The <code>RegisterBlockClass</code> function has two parameters: the first is our block class ID, noteably how we use this class in our blocktype json files. Ensure that this is identical to the class we specified in our earlier asset file. The second parameter is the type of our block class.
The <code>RegisterBlockClass</code> function has two parameters: the first is our block class ID, noteably how we use this class in our blocktype json files. Ensure that this is identical to the class we specified in our earlier asset file. The second parameter is the type of our block class.
</translate>
</translate>
Line 110: Line 111:
'''How can we make the entity bounce?'''
'''How can we make the entity bounce?'''


<!--T:38-->
In order to make an entity bounce, we need to change its direction. Therefore we can simply revert its motion. The faster the entity will be when during the collision the further it will be pushed away. But simply reverting the motion wouldn't be ideal. The entity would never lose its motion and bounce endless. So let's go for something smaller and make the entity lose 20% of its motion each bounce:
In order to make an entity bounce, we need to change its direction. Therefore we can simply revert its motion. The faster the entity will be when during the collision the further it will be pushed away. But simply reverting the motion wouldn't be ideal. The entity would never lose its motion and bounce endless. So let's go for something smaller and make the entity lose 20% of its motion each bounce:
</translate>
</translate>
Line 216: Line 218:
== <translate><!--T:30--> Distribution</translate> ==
== <translate><!--T:30--> Distribution</translate> ==


<translate><!--T:31-->
<translate>=== Using the new Mod Template === <!--T:31-->
=== Using the new Mod Template ===
If using the mod template setup, follow the instructions on [[Modding:Setting up your Development Environment#Packaging the Mod|Setting up your Development Environment]] to pack and distribute your mod.
If using the mod template setup, follow the instructions on [[Modding:Setting up your Development Environment#Packaging the Mod|Setting up your Development Environment]] to pack and distribute your mod.


=== Using the (old) Modtools ===
=== Using the (old) Modtools === <!--T:39-->
If using the modtools program, open the modtools and type in <code>pack <your mod id></code>. Now you can take the zip file and share it with other people. It will work in the same way as ordinary mods, you can install it by copying it into the <code>mods</code> folder.
If using the modtools program, open the modtools and type in <code>pack <your mod id></code>. Now you can take the zip file and share it with other people. It will work in the same way as ordinary mods, you can install it by copying it into the <code>mods</code> folder.
</translate>
</translate>
Line 243: Line 244:
</translate>
</translate>


{{Navbox/modding|Vintage Story}}
{{Navbox/codemodding}}
Confirmedusers
637

edits