[Modpack] NPC Framework [minetest-npcf] [WIP]

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Sun Oct 20, 2013 10:31

Ikishida wrote:thanks! it works great! but how can I remove an NPC?


See README.md in the first post. It gives a list of possible commands.


Edit: Typo.
Last edited by Topywo on Sun Oct 20, 2013 10:32, edited 1 time in total.
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Sun Oct 20, 2013 10:55

I got this error:

12:53:44: ERROR[main]: ServerError: LuaError: error running function on_activate: ...n/../mods/minetest-npcf-master/npcf/npcs/builder_npc.lua:40: attempt to concatenate global 'NPCF_PATH' (a nil value)


This solved the problem:

line 40: input = io.open(NPCF_PATH.."/schems/"..filename, "r") -->
line 40: input = io.open(NPCF_MODPATH.."/schems/"..filename, "r")
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Oct 20, 2013 14:47

Topywo wrote:I got this error:

12:53:44: ERROR[main]: ServerError: LuaError: error running function on_activate: ...n/../mods/minetest-npcf-master/npcf/npcs/builder_npc.lua:40: attempt to concatenate global 'NPCF_PATH' (a nil value)


This solved the problem:

line 40: input = io.open(NPCF_PATH.."/schems/"..filename, "r") -->
line 40: input = io.open(NPCF_MODPATH.."/schems/"..filename, "r")


Thanks for reporting this Topywo, this has now been corrected in current-git
 

User avatar
qwrwed
Member
 
Posts: 323
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Sun Oct 20, 2013 15:18

Mcc457 wrote:Like above, the mod is installed, I get an error saying:

ServerError: LuaError: error:
...es\mods\minetest-npcf-master\npcf/npcf.lua:459: attempt to concatenate


After that, I go back in the NPC I put is either there, or it says:

ServerError: LuaError: error running function 'on_step'
...game\mods\minetest-npcf-master\npcs/builder_npc.lua:260: attempt to index global
'vector' (a nil value)

(I am aware this has to do with the builder.)

Exactly like that above, any suggestions?

I get the same error as this.
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
16:13:38: ACTION[ServerThread]: singleplayer places node npcf:guard_npc_spawner at (-55,6,-94)
16:13:38: ACTION[ServerThread]: facedir: 1
16:14:11: ACTION[ServerThread]:  digs npcf:guard_npc_spawner at (-55,6,-94)
16:14:11: ACTION[ServerThread]: singleplayer leaves game. List of players:
16:14:11: ERROR[main]: ServerError: LuaError: error: ...4.7-a924409-win32\bin\..\mods\npcf-modpack\npcf/npcf.lua:459: attempt to concatenate global 'npc_name' (a nil value)
16:14:11: ERROR[main]: stack traceback:

This happens after I name the NPC using the block, but when I re-enter the game, the NPC is there as normal.
Last edited by qwrwed on Sun Oct 20, 2013 16:09, edited 1 time in total.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Oct 20, 2013 16:01

qwrwed wrote:
Mcc457 wrote:Like above, the mod is installed, I get an error saying:

ServerError: LuaError: error:
...es\mods\minetest-npcf-master\npcf/npcf.lua:459: attempt to concatenate


After that, I go back in the NPC I put is either there, or it says:

ServerError: LuaError: error running function 'on_step'
...game\mods\minetest-npcf-master\npcs/builder_npc.lua:260: attempt to index global
'vector' (a nil value)

(I am aware this has to do with the builder.)

Exactly like that above, any suggestions?

I get the same error as this:
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
16:13:38: ACTION[ServerThread]: singleplayer places node npcf:guard_npc_spawner at (-55,6,-94)
16:13:38: ACTION[ServerThread]: facedir: 1
16:14:11: ACTION[ServerThread]:  digs npcf:guard_npc_spawner at (-55,6,-94)
16:14:11: ACTION[ServerThread]: singleplayer leaves game. List of players:
16:14:11: ERROR[main]: ServerError: LuaError: error: ...4.7-a924409-win32\bin\..\mods\npcf-modpack\npcf/npcf.lua:459: attempt to concatenate global 'npc_name' (a nil value)
16:14:11: ERROR[main]: stack traceback:

This happens after I name the NPC using the block, but when I re-enter the game, the NPC is there as normal.


This was caused by a bug in the error logging system. The crash should now be fixed however there must have been a problem saving the backup file to trigger that in the first place. This may be due to an os directory path or permissions error, I am not able to test this on windows myself.

The first error you mention is not related and sounds more like an incompatible version of minetest, unless something has changed very recently.
Last edited by stu on Sun Oct 20, 2013 16:04, edited 1 time in total.
 

User avatar
qwrwed
Member
 
Posts: 323
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Sun Oct 20, 2013 16:11

I did not get the first error, you may be right that it is an old version as I downloaded sfan5's latest build for Windows earlier today. I will redownload the mod and see what happens.
Edit: It no longer crashes, but it prints an error.
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:16:58: ACTION[ServerThread]: singleplayer places node npcf:guard_npc_spawner at (-43,3,-36)
17:16:58: ACTION[ServerThread]: facedir: 0
17:17:04: ACTION[ServerThread]:  digs npcf:guard_npc_spawner at (-43,3,-36)
17:17:04: ERROR[ServerThread]: Failed to save NPC Sam
17:17:04: ERROR[ServerThread]: Attempt to save invalid NPC
17:17:04: ERROR[ServerThread]: Failed to save NPC Sam

Now, the name does not appear above the NPC's head unless I log out and back in.

Looking at the code (Although I am not very experienced with it, so I may be wrong), it appears to log the error
( minetest.log("error", "Failed to load "..npc_name) ) without a condition - I would expect there to be something that says:
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
if (x) then
    minetest.log("error", "[...]")
end

As opposed to the "minetest.log" being placed where they are below.
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
function npcf:load(npc_name, pos)
    if get_valid_npc_name(npc_name) then
        [...]
        minetest.log("error", "Failed to load "..npc_name)
    end
    minetest.log("error", "Attempt to load invalid NPC")
end
Last edited by qwrwed on Sun Oct 20, 2013 16:32, edited 1 time in total.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Oct 20, 2013 17:03

qwrwed wrote:I did not get the first error, you may be right that it is an old version as I downloaded sfan5's latest build for Windows earlier today. I will redownload the mod and see what happens.
Edit: It no longer crashes, but it prints an error.
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:16:58: ACTION[ServerThread]: singleplayer places node npcf:guard_npc_spawner at (-43,3,-36)
17:16:58: ACTION[ServerThread]: facedir: 0
17:17:04: ACTION[ServerThread]:  digs npcf:guard_npc_spawner at (-43,3,-36)
17:17:04: ERROR[ServerThread]: Failed to save NPC Sam
17:17:04: ERROR[ServerThread]: Attempt to save invalid NPC
17:17:04: ERROR[ServerThread]: Failed to save NPC Sam

Now, the name does not appear above the NPC's head unless I log out and back in.

Looking at the code (Although I am not very experienced with it, so I may be wrong), it appears to log the error
( minetest.log("error", "Failed to load "..npc_name) ) without a condition - I would expect there to be something that says:
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
if (x) then
    minetest.log("error", "[...]")
end

As opposed to the "minetest.log" being placed where they are below.
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
function npcf:load(npc_name, pos)
    if get_valid_npc_name(npc_name) then
        [...]
        minetest.log("error", "Failed to load "..npc_name)
    end
    minetest.log("error", "Attempt to load invalid NPC")
end


Thank you for the update, I see that it's still not quite right, however the underlying problem here is that the NPC's are not being saved to the npc_data directory. I suspect that this either a file permssions issue or maybe a problem with the / directory path separator.

I will see if I can get this to run under wine and try to reproduce the error.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Oct 20, 2013 17:59

Well, it's nice to see that sfan5's build works better than expected under wine, however I have so far been unable to reproduce this error. Interestingly though the mod did not appear to load when put in the global mods directory, instead I had to put it under worldmods in the world directory. You could try to do the same and see if that helps. Also, it may be helpful to know what version of windows you are running.

Update: I read somewhere that windows will not accept / as path separator on the command line, perhaps the same is true with os.execute.
The latest commit uses package.config to determine the correct separator in this case, maybe it will help, if not then it's most likely permissions.
Last edited by stu on Sun Oct 20, 2013 19:30, edited 1 time in total.
 

User avatar
qwrwed
Member
 
Posts: 323
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Mon Oct 21, 2013 17:51

Using worldmods has the exact same result as before.
It loaded for me, after enabling the modpack in the "Configure" menu.
I use Windows XP, Version 2002, Service Pack 3.
Is there anything I can try on my computer that might make the modpack work?
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Mon Oct 21, 2013 18:27

qwrwed wrote:Using worldmods has the exact same result as before.
It loaded for me, after enabling the modpack in the "Configure" menu.
I use Windows XP, Version 2002, Service Pack 3.
Is there anything I can try on my computer that might make the modpack work?

Have you tried it since the last commit I made? What does the error output look like now?
You could check the world directory to see if the npc_data directory has been created. If not then create it manully so the world directory should now contain three sub-dirs; npc_data, players & worldmods.
I think I have an old oem version of XP somewhere I can maybe setup on a virtualbox or a partition but this may take me some time.

Really speaking though this mod is in nowhere near a useable state at present so you are probably best waiting until things are in a bit better shape (with the mod and with the engine itself)
 

User avatar
qwrwed
Member
 
Posts: 323
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Mon Oct 21, 2013 20:00

Just redownloaded latest version and created the "npc_data" folder, the problem seems to have been fixed by this. Thanks for helping with this.
I did not need to create a worldmods folder, by the way.
One thing I have noticed though is that the decorative NPC's checkboxes don't save as the guard NPC's checkboxes do. I right-click the deco NPC, check "follow players", click "Ok", and when I right-click it again, the "follow players" box is unchecked. This does not happen with the guard NPC.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Mon Oct 21, 2013 20:04

Ok, I am now getting the same error(s)
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
A subdirectory or file C:\Documents already exists.
Error occurred while processing: C:\Documents.
A subdirectory or file and already exists.
Error occurred while processing: and.
A subdirectory or file Settings\Stuart\Desktop\minetest-0.4.7-a924409-win32\bin\
..\worlds\winworld\npc_data already exists.
Error occurred while processing: Settings\Stuart\Desktop\minetest-0.4.7-a924409-
win32\bin\..\worlds\winworld\npc_data.

I am guessing something to do with the spaces in the directory path (stupid windows, I remember why I stopped using this about 10yrs ago)
I am not really sure how to fix this, maybe someone more familiar with lua under windows can suggest something.

At least it does seem to work if one creates the npc_data directory manually for now. Meanwhile I'll see what I can find out.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Mon Oct 21, 2013 20:24

qwrwed wrote:One thing I have noticed though is that the decorative NPC's checkboxes don't save as the guard NPC's checkboxes do. I right-click the deco NPC, check "follow players", click "Ok", and when I right-click it again, the "follow players" box is unchecked. This does not happen with the guard NPC.

Thanks, though I had noticed that too, it's on my todo list which is quite long atm. I want to get the framework part itself fully debugged before i do much more with the NPCs. However, better formspecs are my main priority when I do get round to that.

Update: The problem with npc_data dir creation under Windows should now be fixed. (just needed quotes)
Checkout the recent commit history to see how I truly suck at git...
Last edited by stu on Tue Oct 22, 2013 19:16, edited 1 time in total.
 

davidforsure!!!
Member
 
Posts: 72
Joined: Fri Oct 25, 2013 09:02

by davidforsure!!! » Fri Oct 25, 2013 12:12

NICE +5
 

Michael Eh?
Member
 
Posts: 282
Joined: Sun Jan 01, 2012 17:21

by Michael Eh? » Mon Oct 28, 2013 20:26

there seems to be no way of picking up and returning to inventory a NPC once placed... just delete.

Wondering NPCs should have a limit like guards, after that limit is exceeded, it returns to placement or home point.

Guards and other NPC don't take damage. Bad if a player would use guards to attack other players by setting the up in their homes.
I was thinking of a waitress/waiter which would be able to sell several food items but remain in one area. Of course, that means they would have to have inventory and give an error msg when out.
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

by AMMOnym » Fri Nov 22, 2013 11:00

I build Minerim map With your npcs.
 

viv100
Member
 
Posts: 80
Joined: Sat Aug 10, 2013 16:36

by viv100 » Fri Nov 22, 2013 18:32

problem
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33

by hoodedice » Mon Nov 25, 2013 10:04

viv100 wrote:problem


That is?
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
 

User avatar
fishyWET
Member
 
Posts: 145
Joined: Tue Jan 01, 2013 07:43
GitHub: fishyWET

by fishyWET » Fri Nov 29, 2013 07:32

there is this particular error with the trader npc while trading
15:08:35: ERROR[main]: ServerError: LuaError: ...\minetest-0.4.8\bin\..\mods\npcf\npcf/npcs/trade_npc.lua:175: attempt to perform arithmetic on a nil value
15:08:35: ERROR[main]: stack traceback:
15:08:35: ERROR[main]: ...\minetest-0.4.8\bin\..\mods\npcf\npcf/npcs/trade_npc.lua:175: in function 'on_receive_fields'
15:08:35: ERROR[main]: ...er\Desktop\minetest-0.4.8\bin\..\mods\npcf\npcf/npcf.lua:548: in function <...er\Desktop\minetest-0.4.8\bin\..\mods\npcf\npcf/npcf.lua:535>

Btw, i was wondering if it is possible to add long range npc guards, throwing the item in their inventory, using the throwing method similar to how the dungeon master throw fireballs at it's target.
LOTR Subgame
Some days you flip the table, (ノಥ益ಥ)ノ ︵┻━┻,
Other days, the table flip you, ┳━┳︵(ₒ⁻ₒ).
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Fri Nov 29, 2013 18:54

fishyWET wrote:there is this particular error with the trader npc while trading
15:08:35: ERROR[main]: ServerError: LuaError: ...\minetest-0.4.8\bin\..\mods\npcf\npcf/npcs/trade_npc.lua:175: attempt to perform arithmetic on a nil value
15:08:35: ERROR[main]: stack traceback:
15:08:35: ERROR[main]: ...\minetest-0.4.8\bin\..\mods\npcf\npcf/npcs/trade_npc.lua:175: in function 'on_receive_fields'
15:08:35: ERROR[main]: ...er\Desktop\minetest-0.4.8\bin\..\mods\npcf\npcf/npcf.lua:548: in function <...er\Desktop\minetest-0.4.8\bin\..\mods\npcf\npcf/npcf.lua:535>

Btw, i was wondering if it is possible to add long range npc guards, throwing the item in their inventory, using the throwing method similar to how the dungeon master throw fireballs at it's target.


Can you reproduce this error? If so then please describle the steps taken to do so, thanks.
Last edited by stu on Fri Nov 29, 2013 18:54, edited 1 time in total.
 

User avatar
fishyWET
Member
 
Posts: 145
Joined: Tue Jan 01, 2013 07:43
GitHub: fishyWET

by fishyWET » Sat Nov 30, 2013 09:09

stu wrote:Can you reproduce this error? If so then please describle the steps taken to do so, thanks.

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.
Last edited by fishyWET on Sat Nov 30, 2013 09:10, edited 1 time in total.
LOTR Subgame
Some days you flip the table, (ノಥ益ಥ)ノ ︵┻━┻,
Other days, the table flip you, ┳━┳︵(ₒ⁻ₒ).
 

viv100
Member
 
Posts: 80
Joined: Sat Aug 10, 2013 16:36

by viv100 » Thu Dec 05, 2013 18:24

how it's done for the warriors attacking mobs like vombies
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

by AMMOnym » Thu Dec 05, 2013 18:28

viv100 wrote:how it's done for the warriors attacking mobs like vombies
Mummyies: pyramids:mummy , Sandmonster: mobs:sandmonster ..... as first mod name(mobs,pyramids) and second monster name(mummy,sandmonster)
Last edited by AMMOnym on Thu Dec 05, 2013 18:29, edited 1 time in total.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Fri Dec 06, 2013 20:15

fishyWET wrote:
stu wrote:Can you reproduce this error? If so then please describle the steps taken to do so, thanks.

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.


Sorry about the delay, turns out this was largely caused by changes in the minetest formspec since this mod was written.
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.
 

Iqualfragile
Member
 
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Sat Dec 07, 2013 12:54

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.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sat Dec 07, 2013 16:18

Iqualfragile wrote:Is there a reason this is not implemented as an mobf mob?

These are npcs not mobs, there is no good reason to add such a huge dependency.
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.
 

User avatar
LuxAtheris
Member
 
Posts: 169
Joined: Fri Oct 25, 2013 00:54

by LuxAtheris » Tue Dec 31, 2013 03:04

So hows the bug fixing?
Believe you can and you’re halfway there.
 

jenova99sephiros
Member
 
Posts: 158
Joined: Sat Aug 03, 2013 15:16
In-game: Jenova

by jenova99sephiros » Tue Dec 31, 2013 03:33

Please battler mob!
Get the goods when you win them!
I english google translator
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Tue Dec 31, 2013 15:36

LuxAtheris wrote:So hows the bug fixing?

There are no bugs I am currently aware of, at least none that are within my control (lua wise).
Work on this mod is pretty much on hold until entities are properly fixed in minetest.

jenova99sephiros wrote:Please battler mob!
Get the goods when you win them!

For this sort of thing you should look at Simple Mobs or Mob Framework.
 

User avatar
LuxAtheris
Member
 
Posts: 169
Joined: Fri Oct 25, 2013 00:54

by LuxAtheris » Tue Dec 31, 2013 16:03

Well there is one bug where i put the npc block kinda thingy and when i try to dig it it doesnt get dug
Believe you can and you’re halfway there.
 

PreviousNext

Return to Old Mods

Who is online

Users browsing this forum: No registered users and 9 guests

cron