[Mod] Carts [carts]

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Jul 24, 2012 09:56

Has anyone some ideas for further mesecon functions?
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Tue Jul 24, 2012 10:48

Change Switches with Mesecons
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Jul 24, 2012 10:58

sfan5 wrote:Change Switches with Mesecons

See Version 16.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Tue Jul 24, 2012 15:42

The latest Version doesn't work for me:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
17:40:34: ERROR[main]: ========== ERROR FROM LUA ===========
17:40:34: ERROR[main]: Failed to load and run script from
17:40:34: ERROR[main]: /home/stefan/minetest/bin/../mods/minetest/carts/init.lua:
17:40:34: ERROR[main]: ...fan/minetest/bin/../mods/minetest/carts/mesecons.lua:2: attempt to index global 'mesecon' (a nil value)
17:40:34: ERROR[main]: stack traceback:
17:40:34: ERROR[main]:     ...fan/minetest/bin/../mods/minetest/carts/mesecons.lua:2: in main chunk
17:40:34: ERROR[main]:     [C]: in function 'dofile'
17:40:34: ERROR[main]:     .../stefan/minetest/bin/../mods/minetest/carts/init.lua:731: in main chunk
17:40:34: ERROR[main]: =======END OF ERROR FROM LUA ========
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Jul 24, 2012 15:44

sfan5 wrote:The latest Version doesn't work for me:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
17:40:34: ERROR[main]: ========== ERROR FROM LUA ===========
17:40:34: ERROR[main]: Failed to load and run script from
17:40:34: ERROR[main]: /home/stefan/minetest/bin/../mods/minetest/carts/init.lua:
17:40:34: ERROR[main]: ...fan/minetest/bin/../mods/minetest/carts/mesecons.lua:2: attempt to index global 'mesecon' (a nil value)
17:40:34: ERROR[main]: stack traceback:
17:40:34: ERROR[main]:     ...fan/minetest/bin/../mods/minetest/carts/mesecons.lua:2: in main chunk
17:40:34: ERROR[main]:     [C]: in function 'dofile'
17:40:34: ERROR[main]:     .../stefan/minetest/bin/../mods/minetest/carts/init.lua:731: in main chunk
17:40:34: ERROR[main]: =======END OF ERROR FROM LUA ========

Do you have latest mesecons installed. If it still dont work try it without mesecons and it will work.
 

User avatar
mrtux
Member
 
Posts: 141
Joined: Mon Jun 25, 2012 02:41

by mrtux » Wed Jul 25, 2012 00:49

I am going to give this mod a try, it might be useful for making a timer in mesecons, as the cart can go over special mesecon rails every few seconds or so depending on the size of the rail link.
+100
Last edited by mrtux on Wed Jul 25, 2012 04:40, edited 1 time in total.
thanks doge
 

tee-jay
New member
 
Posts: 1
Joined: Wed Jul 25, 2012 20:52

by tee-jay » Wed Jul 25, 2012 21:11

Looks like a great mod.

Do you have latest mesecons installed. If it still dont work try it without mesecons and it will work.


I have the latest mesecons version from github (7568182) and have the exact same problem sfan5 has.
Yes it does work without mesecons.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu Jul 26, 2012 07:39

tee-jay wrote:I have the latest mesecons version from github (7568182) and have the exact same problem sfan5 has.
Yes it does work without mesecons.

Maybe it helps when you add "mesecons" to depends.txt
When this dont fix it I have no idea what to do. I dont have this bug.
 

User avatar
Ragnarok
Member
 
Posts: 213
Joined: Thu Mar 22, 2012 12:56

by Ragnarok » Thu Jul 26, 2012 22:25

What do you think about this sound:

http://speedy.sh/M2h8K/loco.wav

License: CC0
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Jul 27, 2012 10:24

Ragnarok wrote:What do you think about this sound:

http://speedy.sh/M2h8K/loco.wav

License: CC0

First of all thank you that you help me with the sound.
But this sound seems like there are "many" carts driving not just one.
So it would be realy great if you can create another sound (remember its just one little cart driving).
Last edited by PilzAdam on Fri Jul 27, 2012 10:25, edited 1 time in total.
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Fri Jul 27, 2012 10:33

Suggestion: turn your cart declarations into functions so people can setup carts with different textures, possibly even nodeboxes :-)
"Fuck the hat." - Paulie Gualtieri
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Jul 27, 2012 12:30

mauvebic wrote:Suggestion: turn your cart declarations into functions so people can setup carts with different textures, possibly even nodeboxes :-)

You can not use nodeboxes for carts.
But I will have a look at it.
 

User avatar
Ragnarok
Member
 
Posts: 213
Joined: Thu Mar 22, 2012 12:56

by Ragnarok » Fri Jul 27, 2012 13:40

I created fully synthetic simple loco sound. What do you think?

http://speedy.sh/mUvnk/loco-syntetic.wav

License: WTFPL
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Jul 27, 2012 14:30

Ragnarok wrote:I created fully synthetic simple loco sound. What do you think?

http://speedy.sh/mUvnk/loco-syntetic.wav

License: WTFPL

Thank you!
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Fri Jul 27, 2012 23:24

this is the best thing i've ever seen
If you can think it, you can make it.
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11

by Josh » Sat Jul 28, 2012 03:25

Nice PilzAdam! but as minetest develops we should be able to ride the carts!
 

jin_xi
Member
 
Posts: 165
Joined: Mon Jul 02, 2012 18:19

by jin_xi » Sat Jul 28, 2012 09:34

hey pilz adam

really nice work. i had this idea: FAHRPLAN! would it make sense to be able to put a timetable next to a track so that a train would run automatically? like some simple format for times and "stations" (other such tables)?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jul 28, 2012 09:39

jin_xi wrote:hey pilz adam

really nice work. i had this idea: FAHRPLAN! would it make sense to be able to put a timetable next to a track so that a train would run automatically? like some simple format for times and "stations" (other such tables)?

You can maybe make this with the mesecon functions that are already implmented.
 

graphics boy
Member
 
Posts: 19
Joined: Fri Jul 27, 2012 08:57
GitHub: Cg-boy

by graphics boy » Sun Jul 29, 2012 08:52

When I add the cart then rightclick on it I get this:

ServerError: Lua: error running 'on_rightclick':
...v-20120606-win32\bin\..\mods\minetest\carts\init.Lua:390: attemp to call method 'is_player' (a nil value)

can somebody help?
I like 3d graphics
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Jul 29, 2012 09:02

graphics boy wrote:When I add the cart then rightclick on it I get this:

ServerError: Lua: error running 'on_rightclick':
...v-20120606-win32\bin\..\mods\minetest\carts\init.Lua:390: attemp to call method 'is_player' (a nil value)

can somebody help?

Wich Minetest version do you have?
 

graphics boy
Member
 
Posts: 19
Joined: Fri Jul 27, 2012 08:57
GitHub: Cg-boy

by graphics boy » Sun Jul 29, 2012 09:07

0.4
I like 3d graphics
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Jul 29, 2012 09:09

Wich 0.4? (please write everything that is written in the upper left corner of minetest)
Wich version of carts do you have?
 

graphics boy
Member
 
Posts: 19
Joined: Fri Jul 27, 2012 08:57
GitHub: Cg-boy

by graphics boy » Sun Jul 29, 2012 09:13

Minetest-c55 0.4.dev-20120606

carts 23
Last edited by graphics boy on Sun Jul 29, 2012 09:14, edited 1 time in total.
I like 3d graphics
 

graphics boy
Member
 
Posts: 19
Joined: Fri Jul 27, 2012 08:57
GitHub: Cg-boy

by graphics boy » Sun Jul 29, 2012 09:15

version 23 of carts
I like 3d graphics
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Jul 29, 2012 09:19

This is realy strange because in line 390 if init.lua the method is_player() is not used. Try redownload.
 

Tggtt
New member
 
Posts: 5
Joined: Sat Jul 28, 2012 00:30

by Tggtt » Sun Jul 29, 2012 23:11

PilzAdam wrote:
tee-jay wrote:I have the latest mesecons version from github (7568182) and have the exact same problem sfan5 has.
Yes it does work without mesecons.

Maybe it helps when you add "mesecons" to depends.txt
When this dont fix it I have no idea what to do. I dont have this bug.

I had that problem too and adding mesecons to depends.txt of carts fixed it.

It's working great, thank you very much.


Also, does it have a box that the cart takes its contents too? I only find one that the cart drops the content, not for taking.

If it's possible, I would be able to create closed circuit tracks that carts take contents from one side and drop on the other.
Last edited by Tggtt on Sun Jul 29, 2012 23:14, edited 1 time in total.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Jul 30, 2012 09:22

Tggtt wrote:I had that problem too and adding mesecons to depends.txt of carts fixed it.

It's working great, thank you very much.

Thanks for the feedback.
Tggtt wrote:Also, does it have a box that the cart takes its contents too? I only find one that the cart drops the content, not for taking.

If it's possible, I would be able to create closed circuit tracks that carts take contents from one side and drop on the other.

Good idea.
EDIT: Added.
Last edited by PilzAdam on Mon Jul 30, 2012 10:04, edited 1 time in total.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Jul 30, 2012 11:46

PilzAdam wrote:
tee-jay wrote:I have the latest mesecons version from github (7568182) and have the exact same problem sfan5 has.
Yes it does work without mesecons.

Maybe it helps when you add "mesecons" to depends.txt
When this dont fix it I have no idea what to do. I dont have this bug.

You dont have add mesecons to depends.txt with version 25.
 

Tggtt
New member
 
Posts: 5
Joined: Sat Jul 28, 2012 00:30

by Tggtt » Mon Jul 30, 2012 21:45

Thanks a lot. I think you forgot to add the recipe for pickup_plate in the first post.

Image
[EDIT] sorry, I saw it now.

I had to open the code to find it.
While reading the code for the pickup_plate, I came across your "fors" to search for the boxes and plates. I think you should try merging the "fors" because they are exactly the same, only the "if" changes. Merging them would improve performance for the same result.

[EDIT]
This is what I meant by merging the "fors". I believe it has the exact same result.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
    --search for pickup plates and take items
    -- and
    -- search for boxes and place all items (except players) in it
    for x=-1,1 do
        local pos = {x=self.object:getpos().x+x, y=self.object:getpos().y, z=self.object:getpos().z}
        local name = minetest.env:get_node(pos).name
        if name == "carts:pickup_plate" then
            pos.x = math.floor(0.5+pos.x)
            pos.y = math.floor(0.5+pos.y)
            pos.z = math.floor(0.5+pos.z)
            local items = minetest.env:get_objects_inside_radius(pos, 1)
            for i,item in ipairs(items) do
                if not item:is_player() then
                    table.insert(self.items, item)
                elseif TRANSPORT_PLAYER then
                    table.insert(self.items, item)
                end
            end
        end
        if name == "carts:chest" and self.items ~= {} then
            local items_tmp = {}
            for i,item in ipairs(self.items) do
                if not item:is_player() then
                    item:setpos({x=math.floor(0.5+pos.x), y=math.floor(0.5+pos.y)+0.2,

z=math.floor(0.5+pos.z)})
                else
                    table.insert(items_tmp, item)
                end
            end
            self.items = items_tmp
        end
    end
    for z=-1,1 do
        local pos = {x=self.object:getpos().x, y=self.object:getpos().y, z=self.object:getpos().z+z}
        local name = minetest.env:get_node(pos).name
        if name == "carts:pickup_plate" then
            pos.x = math.floor(0.5+pos.x)
            pos.y = math.floor(0.5+pos.y)
            pos.z = math.floor(0.5+pos.z)
            local items = minetest.env:get_objects_inside_radius(pos, 1)
            for i,item in ipairs(items) do
                if not item:is_player() then
                    table.insert(self.items, item)
                elseif TRANSPORT_PLAYER then
                    table.insert(self.items, item)
                end
            end
        end
        if name == "carts:chest" and self.items ~= {} then
            local items_tmp = {}
            for i,item in ipairs(self.items) do
                if not item:is_player() then
                    item:setpos({x=math.floor(0.5+pos.x), y=math.floor(0.5+pos.y)+0.2,

z=math.floor(0.5+pos.z)})
                else
                    table.insert(items_tmp, item)
                end
            end
            self.items = items_tmp
        end
    end


However, it could cause the cart to deliver itens to a box that is too near to the plate. You may want to invert the order of the "ifs".

When the server is laggy, the "cart missing the rail" problem happens more often. I have reduced the MAX_SPEED as a work around.
Last edited by Tggtt on Tue Jul 31, 2012 05:41, edited 1 time in total.
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Tue Jul 31, 2012 08:35

Mine would stop if i made a stair-like slope into my mine. I got it working really nicely (havent seen it crash) with a really small change:


Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
        -- downhill
        local vel = self.object:getvelocity()
        vel.y = -3*MAX_SPEED -- used to be -2*MAX_SPEED



edit: no it still crashes sometimes
Last edited by cornernote on Tue Jul 31, 2012 08:36, edited 1 time in total.
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 46 guests

cron