[Mod] ds_rowboat [0.1] [ds_rowboat]

User avatar
deasanta
Member
 
Posts: 20
Joined: Tue May 28, 2013 03:15
Location: New Zealand
GitHub: deasanta
IRC: deasanta
In-game: deasanta

[Mod] ds_rowboat [0.1] [ds_rowboat]

by deasanta » Sat Sep 27, 2014 12:35

Subject: [Mod] ds_rowboat [140927] [ds_rowboat]

Mod to add a Row Boat to MineTest

Picture - https://sites.google.com/site/dsminetes ... ds_rowboat

Image

GitHub: https://github.com/deasanta/minetest-deasanta
Download: https://github.com/deasanta/minetest-de ... master.zip

License: see README.txt or below
Models: WTFPL
Textures: WTFPL

Features:
- Row Boat de-spawn after 7 seconds if not used
- Boat on_step executes every 10 steps instead of eve
- Other players can disengage a player
- uses default_wood texture

Compatibility:
This mod should work with on MineTest 0.4.10

Installation: extract ds_rowboat folder to mods folder

Recipes
Row Boat = {
{"", "", ""},
{"", "", ""},
{"boats:boat", "boats:boat", ""},
},

Image

Notes:
- bug as of 30/6/13 with player position not updating on other player screens in certain situations.
- can be used on land - no plan to fix at the moment as it would require more code on the on_step function

Please report any bugs in github or forum

-------
License
-------
This work by PilzAdam, NeXt, deasanta is free of known copyright restrictions.

See also:
http://minetest.net/
See README.txt in each mod directory for information about other authors.
Last edited by deasanta on Sun Sep 28, 2014 10:04, edited 1 time in total.
 

User avatar
Inocudom
Member
 
Posts: 3018
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: [Mod] ds_rowboat [0.1] [ds_rowboat]

by Inocudom » Sat Sep 27, 2014 13:27

A simple, but cute addition to Minetest. I hope this gets used in Calinou's Carbone sub-game.
Recovering from the abomination I am. Clocking time for Garry's Mod I am too.
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
Location: On earth
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun
 

User avatar
deasanta
Member
 
Posts: 20
Joined: Tue May 28, 2013 03:15
Location: New Zealand
GitHub: deasanta
IRC: deasanta
In-game: deasanta

Re: [Mod] ds_rowboat [0.1] [ds_rowboat]

by deasanta » Sat Sep 27, 2014 13:45

It's based on PilzAdam's code. Changes: The model, tried to make it lighter, uses wood from whichever texture pack the player uses, currently depends on boat which is in default as it's the recipe and a few multi-player fixes to default boat code.
 

User avatar
TenPlus1
Member
 
Posts: 2422
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] ds_rowboat [0.1] [ds_rowboat]

by TenPlus1 » Tue Sep 30, 2014 15:59

Great mod although a few things missing like gravity and stopping boat travelling on top of dirt/sand... I've added a few changes that makes boat fall from heights and stop when sitting on top of anything other than water:

Code: Select all
function ds_rowboat.on_step(self, dtime)

   self.stepcount=self.stepcount+1

   if self.stepcount>5 then -- was 9

      self.stepcount=0

      if self.driver then

         self.unattended=0

         local kbd = self.driver:get_player_control()
         local yaw = self.object:getyaw()

         if kbd.up and self.v<3 then
            self.v = self.v + 1
         end

         if kbd.down and self.v>=-1 then
            self.v = self.v - 1
         end   

         if kbd.left then
            if kbd.down then
               self.object:setyaw(yaw-math.pi/12-dtime*math.pi/12)
            else
               self.object:setyaw(yaw+math.pi/12+dtime*math.pi/12)
            end
         end
         if kbd.right then
            if kbd.down then
               self.object:setyaw(yaw+math.pi/12+dtime*math.pi/12)
            else
               self.object:setyaw(yaw-math.pi/12-dtime*math.pi/12)
            end
         end
      else
         -- remove unattended ds_rowboats after n counts
         self.unattended=self.unattended+1
         if self.unattended>100 then -- was 20
            ds_rowboat.schedule_removal(self)
         end
      end

      local tmp_velocity = get_velocity(self.v, self.object:getyaw(), 0)

      local tmp_pos = self.object:getpos()

      tmp_velocity.y=0

      if is_water(tmp_pos) then
         tmp_velocity.y=1
      end

      tmp_pos.y=tmp_pos.y-0.5

      if minetest.get_node(tmp_pos).name=="air" then
         tmp_velocity.y=-9 -- 2
      end

      if not is_water(tmp_pos) then
         tmp_velocity.x = 0
         tmp_velocity.z = 0
      end

      self.object:setvelocity(tmp_velocity)

   end

end
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 6 guests