Owner set up an exhange [e.g. 1 gravel for 1 stone], and put in gravel for trading, another person tries to trade by putting in the stone and clicking accept, and this error is shown.stu wrote:Can you reproduce this error? If so then please describle the steps taken to do so, thanks.
[Modpack] NPC Framework [minetest-npcf] [WIP]
- fishyWET
- Member
- Posts: 162
- Joined: Tue Jan 01, 2013 07:43
- GitHub: neinwhal
- IRC: neinwhal
- In-game: neinwhal
- Location: Nowhere
Last edited by fishyWET on Sat Nov 30, 2013 09:10, edited 1 time in total.
- AMMOnym
- Member
- Posts: 682
- Joined: Tue Sep 10, 2013 14:18
- IRC: AMMOnym
- In-game: AMMOnym
- Location: Slovakia
Mummyies: pyramids:mummy , Sandmonster: mobs:sandmonster ..... as first mod name(mobs,pyramids) and second monster name(mummy,sandmonster)viv100 wrote:how it's done for the warriors attacking mobs like vombies
Last edited by AMMOnym on Thu Dec 05, 2013 18:29, edited 1 time in total.
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Sorry about the delay, turns out this was largely caused by changes in the minetest formspec since this mod was written.fishyWET wrote:Owner set up an exhange [e.g. 1 gravel for 1 stone], and put in gravel for trading, another person tries to trade by putting in the stone and clicking accept, and this error is shown.stu wrote:Can you reproduce this error? If so then please describle the steps taken to do so, thanks.
There were also a couple of other minor issues which are hopefully now resolved.
Last edited by stu on Fri Dec 06, 2013 20:17, edited 1 time in total.
-
- Member
- Posts: 160
- Joined: Tue Sep 18, 2012 22:11
Is there a reason this is not implemented as an mobf mob?
Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
These are npcs not mobs, there is no good reason to add such a huge dependency.Iqualfragile wrote:Is there a reason this is not implemented as an mobf mob?
Also, I believe mobf has it's own npcs which behave more like mobs. My npcs are aimed more at
servers (think more like the sort you find in rpg's) they have names, they have owners and persist
even after a server restart. The framework itself is extemely lightweight compared to mobf which
many servers would be reluctant install.
- LuxAtheris
- Member
- Posts: 169
- Joined: Fri Oct 25, 2013 00:54
- Location: Aether
-
- Member
- Posts: 158
- Joined: Sat Aug 03, 2013 15:16
- In-game: naro
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
There are no bugs I am currently aware of, at least none that are within my control (lua wise).LuxAtheris wrote:So hows the bug fixing?
Work on this mod is pretty much on hold until entities are properly fixed in minetest.
For this sort of thing you should look at Simple Mobs or Mob Framework.jenova99sephiros wrote:Please battler mob!
Get the goods when you win them!
- LuxAtheris
- Member
- Posts: 169
- Joined: Fri Oct 25, 2013 00:54
- Location: Aether
@stu you might be interested in my g-ode interpreter code for your builder npc:
it allows reading a gcode file, generated from cad models, like a virtul 3d printer (reprap)
Code: Select all
reprap = {}
-- adds <material> to each node in a line from <from_position> to <to_position>
function reprap.drawline3d(from_position, to_position, material)
--modified from https://github.com/ryanramage/bresenham3d/blob/master/index.js
--lua port by jin_xi
local temp
local x0 = math.floor(from_position.x)
local y0 = math.floor(from_position.y)
local z0 = math.floor(from_position.z)
local x1 = math.floor(to_position.x)
local y1 = math.floor(to_position.y)
local z1 = math.floor(to_position.z)
--'steep' xy Line, make longest delta x plane
local swap_xy = math.abs(y1 - y0) > math.abs(x1 - x0)
if swap_xy then
temp = x0; x0 = y0; y0 = temp --swap(x0, y0);
temp = x1; x1 = y1; y1 = temp --swap(x1, y1);
end
local swap_xz = math.abs(z1 - z0) > math.abs(x1 - x0)
if swap_xz then
temp = x0; x0 = z0; z0 = temp --swap(x0, z0);
temp = x1; x1 = z1; z1 = temp --swap(x1, z1);
end
--delta is Length in each plane
local delta_x = math.abs(x1 - x0)
local delta_y = math.abs(y1 - y0)
local delta_z = math.abs(z1 - z0)
--drift controls when to step in 'shallow' planes
--starting value keeps Line centred
local drift_xy = (delta_x / 2)
local drift_xz = (delta_x / 2)
--direction of line
local step_x = 1
if x0 > x1 then step_x = -1 end
local step_y = 1
if y0 > y1 then step_y = -1 end
local step_z = 1
if z0 > z1 then step_z = -1 end
--starting point
local y = y0
local z = z0
--step through longest delta (which we have swapped to x)
local cx, cy, cz
for x = x0, x1, step_x do
--copy position
cx = x; cy = y; cz = z
--unswap (in reverse)
if swap_xz then
temp = cx; cx = cz; cz = temp --swap(cx, cz)
end
if swap_xy then
temp = cx; cx = cy; cy = temp --swap(cx, cy)
end
print("drawing dot: "..cx..', '..cy..', '..cz)
minetest.env:add_node({ x = cx, y = cy, z = cz }, { name=material, param2=2 })
--update progress in other planes
drift_xy = drift_xy - delta_y
drift_xz = drift_xz - delta_z
--step in y plane
if drift_xy < 0 then
y = y + step_y
drift_xy = drift_xy + delta_x
end
--same in z
if (drift_xz < 0) then
z = z + step_z
drift_xz = drift_xz + delta_x
end
end
end
-- process a gcode file <filename> placing <material> on each point touched by the machine
function reprap.process_gcode(filename, material, center)
local path = minetest.get_modpath("reprap").."/"..filename
local f = io.open(path)
local line
local cmd, param = "", ""
local lastx, lasty, lastz
local cmdx, cmdy, cmdz
lastx = 0
lasty = 0
lastz = 0
for line in f:lines() do
if (line ~= "") and (line:sub(1,1) ~= ";") then
if string.find(line, "G1 ") then
cmdx = lastx
cmdy = lasty
cmdz = lastz
for cmd, param in string.gmatch(line, "(%w)([0-9.-]+)") do
param = tonumber(param)
if cmd == "X" then
cmdx = param
elseif cmd == "Y" then
cmdz = param
elseif cmd == "Z" then
cmdy = param
end
end
reprap.drawline3d(
{ x = center.x + lastx, y = center.y + lasty, z = center.z + lastz },
{ x = center.x + cmdx, y = center.y + cmdy, z = center.z + cmdz },
material
)
lastx = cmdx
lasty = cmdy
lastz = cmdz
end
end
end
end
minetest.register_chatcommand("reprap", {
params = "<gcodefilename>,<material>,<x>,<y>,<z>",
description = "start printing a gcode file",
privs = {},
func = function(name, param)
local paramlist
print(param)
paramlist = string.split(param, ",")
print(paramlist[1])
print(paramlist[2])
print(paramlist[3])
print(paramlist[4])
print(paramlist[5])
filename = paramlist[1]
material = paramlist[2]
drawx = tonumber(paramlist[3])
drawy = tonumber(paramlist[4])
drawz = tonumber(paramlist[5])
reprap.process_gcode(filename, material, { x=drawx, y=drawy, z=drawz })
-- reprap.process_gcode("column.gcode", "default:mese", { x=-65, y=0, z=77 })
end
}
)
it allows reading a gcode file, generated from cad models, like a virtul 3d printer (reprap)
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
This is a very interenting piece of code. I actually work in mechanical engineering so I'm no stranger to gcode and cadaldobr wrote:@stu you might be interested in my g-ode interpreter code for your builder npc:
Code: Select all
reprap = {} -- adds <material> to each node in a line from <from_position> to <to_position> function reprap.drawline3d(from_position, to_position, material) --modified from https://github.com/ryanramage/bresenham3d/blob/master/index.js --lua port by jin_xi local temp local x0 = math.floor(from_position.x) local y0 = math.floor(from_position.y) local z0 = math.floor(from_position.z) local x1 = math.floor(to_position.x) local y1 = math.floor(to_position.y) local z1 = math.floor(to_position.z) --'steep' xy Line, make longest delta x plane local swap_xy = math.abs(y1 - y0) > math.abs(x1 - x0) if swap_xy then temp = x0; x0 = y0; y0 = temp --swap(x0, y0); temp = x1; x1 = y1; y1 = temp --swap(x1, y1); end local swap_xz = math.abs(z1 - z0) > math.abs(x1 - x0) if swap_xz then temp = x0; x0 = z0; z0 = temp --swap(x0, z0); temp = x1; x1 = z1; z1 = temp --swap(x1, z1); end --delta is Length in each plane local delta_x = math.abs(x1 - x0) local delta_y = math.abs(y1 - y0) local delta_z = math.abs(z1 - z0) --drift controls when to step in 'shallow' planes --starting value keeps Line centred local drift_xy = (delta_x / 2) local drift_xz = (delta_x / 2) --direction of line local step_x = 1 if x0 > x1 then step_x = -1 end local step_y = 1 if y0 > y1 then step_y = -1 end local step_z = 1 if z0 > z1 then step_z = -1 end --starting point local y = y0 local z = z0 --step through longest delta (which we have swapped to x) local cx, cy, cz for x = x0, x1, step_x do --copy position cx = x; cy = y; cz = z --unswap (in reverse) if swap_xz then temp = cx; cx = cz; cz = temp --swap(cx, cz) end if swap_xy then temp = cx; cx = cy; cy = temp --swap(cx, cy) end print("drawing dot: "..cx..', '..cy..', '..cz) minetest.env:add_node({ x = cx, y = cy, z = cz }, { name=material, param2=2 }) --update progress in other planes drift_xy = drift_xy - delta_y drift_xz = drift_xz - delta_z --step in y plane if drift_xy < 0 then y = y + step_y drift_xy = drift_xy + delta_x end --same in z if (drift_xz < 0) then z = z + step_z drift_xz = drift_xz + delta_x end end end -- process a gcode file <filename> placing <material> on each point touched by the machine function reprap.process_gcode(filename, material, center) local path = minetest.get_modpath("reprap").."/"..filename local f = io.open(path) local line local cmd, param = "", "" local lastx, lasty, lastz local cmdx, cmdy, cmdz lastx = 0 lasty = 0 lastz = 0 for line in f:lines() do if (line ~= "") and (line:sub(1,1) ~= ";") then if string.find(line, "G1 ") then cmdx = lastx cmdy = lasty cmdz = lastz for cmd, param in string.gmatch(line, "(%w)([0-9.-]+)") do param = tonumber(param) if cmd == "X" then cmdx = param elseif cmd == "Y" then cmdz = param elseif cmd == "Z" then cmdy = param end end reprap.drawline3d( { x = center.x + lastx, y = center.y + lasty, z = center.z + lastz }, { x = center.x + cmdx, y = center.y + cmdy, z = center.z + cmdz }, material ) lastx = cmdx lasty = cmdy lastz = cmdz end end end end minetest.register_chatcommand("reprap", { params = "<gcodefilename>,<material>,<x>,<y>,<z>", description = "start printing a gcode file", privs = {}, func = function(name, param) local paramlist print(param) paramlist = string.split(param, ",") print(paramlist[1]) print(paramlist[2]) print(paramlist[3]) print(paramlist[4]) print(paramlist[5]) filename = paramlist[1] material = paramlist[2] drawx = tonumber(paramlist[3]) drawy = tonumber(paramlist[4]) drawz = tonumber(paramlist[5]) reprap.process_gcode(filename, material, { x=drawx, y=drawy, z=drawz }) -- reprap.process_gcode("column.gcode", "default:mese", { x=-65, y=0, z=77 }) end } )
it allows reading a gcode file, generated from cad models, like a virtul 3d printer (reprap)
I will maybe try this with the builder NPC at some stage or even use it for something else, thank you for sharing it.
-
- Member
- Posts: 158
- Joined: Sat Aug 03, 2013 15:16
- In-game: naro
I want to make the arena!stu wrote:There are no bugs I am currently aware of, at least none that are within my control (lua wise).LuxAtheris wrote:So hows the bug fixing?
Work on this mod is pretty much on hold until entities are properly fixed in minetest.
For this sort of thing you should look at Simple Mobs or Mob Framework.jenova99sephiros wrote:Please battler mob!
Get the goods when you win them!
This works ok, I just had an issue and now have a guard spawner that duplicates itself. I placed the spawner right clicked it and named the guard. Out pops th guard but the spawner was still there. Now if I click on it to get rid of it or pick it up it duplicates itself. Any idea how to remove it? The spawner.
-
- Member
- Posts: 158
- Joined: Sat Aug 03, 2013 15:16
- In-game: naro
CheerfulCherub started a topic in the forums and posted this in it. Would anyone care to explain what needs to be done?CheerfulCherub wrote:Can anyone help me set up the 3d or class Characters, I download it to my mod folder and extracted and name the right name but I don't exactly know how to put the character in 3d and I tried the command for class but no luck either, I know it's not the mod it's me. Please any help in greatly appreciated. I am using 0.49minetest, love this game, making a big castle in singleplayer.
Cheerful Cherub
[BitChute: https://www.bitchute.com/channel/fCcBQxrYQjNX/] [Rumble: https://rumble.com/user/HPoorHMagentaHChildH]
- hoodedice
- Member
- Posts: 1374
- Joined: Sat Jul 06, 2013 06:33
- GitHub: hoodedice
- IRC: hoodedice
- In-game: hoodedice
- Location: world
- Contact:
A player crashed my server using this mod. Here are the last lines before the crash:
Weird. I left the game befor the server died? LOL.
Code: Select all
14:45:28: ACTION[ServerThread]: kinkinkijkin digs base:grass at (-389,42,207)
14:45:36: ACTION[ServerThread]: CHAT: <hoodedice> And because we have >10 players, there might be rarely any lag
14:45:44: ACTION[ServerThread]: Zen places node npcf:guard_npc_spawner at (-459,22,-97)
14:45:44: ACTION[ServerThread]: facedir: 3
14:45:49: ACTION[ServerThread]: hoodedice leaves game. List of players: Zen kinkinkijkin
14:45:49: ERROR[main]: ServerError: .../../games/nodetopia/mods/minetest-npcf/npcf/npcf.lua:108: attempt to index local 'npc_name' (a nil value)
14:45:49: ERROR[main]: stack traceback:
14:45:49: ERROR[main]: .../../games/nodetopia/mods/minetest-npcf/npcf/npcf.lua:108: in function 'get_valid_npc_name'
14:45:49: ERROR[main]: .../../games/nodetopia/mods/minetest-npcf/npcf/npcf.lua:334: in function <.../../games/nodetopia/mods/minetest-npcf/npcf/npcf.lua:326>
AL lib: FreeContext: (0x2c86420) Deleting 3 Source(s)
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
Re: [Modpack] NPC Framework [minetest-npcf] [WIP]
Stu I wonder that Is it possible to remove the name feature and checking? If so, could you please tell me what should I remove.
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Re: [Modpack] NPC Framework [minetest-npcf] [WIP]
Unfortunately the naming system is pretty fundamental to how this mod works soEsteban wrote:Stu I wonder that Is it possible to remove the name feature and checking? If so, could you please tell me what should I remove.
I don't see an easy way it can be removed. You might be better off with sapier's mobf npcs
To be honest, I have not really worked on this for some time, it was written at
a time when my understanding of the minetest entity system (and the Lua language itself)
were a little bit naive, at best.
I have just pushed a couple of changes which should fix that bug reported in January (sorry I missed that)
and removed the duplicate entity checking as it should not be needed anymore and didn't work that well anyway.
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: [Modpack] NPC Framework [minetest-npcf] [WIP]
Your npcf mod has been an inspiration and a great help when I wrote my mobf_trader mod. Especially regarding the naming system.
I'm currently facing the problem of wishing for personalized mobs (inhabitants of a village) that wander around and return to their homes at night. That may be quite difficult as it's pretty likely that only part of the village will be loaded and/or have active mobs.
[Edit] Plus the system the npcf mobs use might also work quite well for farm animals.
I'm currently facing the problem of wishing for personalized mobs (inhabitants of a village) that wander around and return to their homes at night. That may be quite difficult as it's pretty likely that only part of the village will be loaded and/or have active mobs.
[Edit] Plus the system the npcf mobs use might also work quite well for farm animals.
A list of my mods can be found here.
Re: [Modpack] NPC Framework [minetest-npcf] [WIP]
Thanks for your reply!stu wrote:
Unfortunately the naming system is pretty fundamental to how this mod works so
I don't see an easy way it can be removed. You might be better off with sapier's mobf npcs
To be honest, I have not really worked on this for some time, it was written at
a time when my understanding of the minetest entity system (and the Lua language itself)
were a little bit naive, at best.
I have just pushed a couple of changes which should fix that bug reported in January (sorry I missed that)
and removed the duplicate entity checking as it should not be needed anymore and didn't work that well anyway.
Re: [Modpack] NPC Framework [minetest-npcf] [WIP]
Looks great, cant wait to get it, got a few questions:
1) Is this thing still in development? (Not that it matters unless it's deleted online)
2) Can you please make female deco NPCs? And make it so that if a male NPC touches a Female NPC a child NPC.
3) Do NPCs spawn by themselves? I had trouble getting stuff to spawn with Animals Modpack.
1) Is this thing still in development? (Not that it matters unless it's deleted online)
2) Can you please make female deco NPCs? And make it so that if a male NPC touches a Female NPC a child NPC.
3) Do NPCs spawn by themselves? I had trouble getting stuff to spawn with Animals Modpack.
I test mines.
Re: [Modpack] NPC Framework [minetest-npcf] [WIP]
Good Work. Nice mod.
My brother said a trader was going to give him like 20 peices of wood for like 5 obsidian. ;) Hey, there are unfair traders today! (Just not in the US. Here they call it being overpriced.)
*EDIT* Also my lil bro claims that if you place an NPC it may crash Minetest.
My brother said a trader was going to give him like 20 peices of wood for like 5 obsidian. ;) Hey, there are unfair traders today! (Just not in the US. Here they call it being overpriced.)
*EDIT* Also my lil bro claims that if you place an NPC it may crash Minetest.
I test mines.
Who is online
Users browsing this forum: No registered users and 5 guests