[Mod] Alive AI V4.8 [aliveai]

User avatar
ErrorNull
Member
 
Posts: 94
Joined: Thu Mar 03, 2016 00:43

Re: [Mod] Alive AI V2.9 [aliveai]

by ErrorNull » Fri Feb 17, 2017 07:48

i also think this is a very important mob. i'm looking for a good villagers and traders mob and i'm keeping close eye on this one. a github is a great idea for this!
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3 [aliveai]

by AiTechEye » Fri Feb 17, 2017 08:38

that good!, and you're right, and its even addictive to work with it :-)
here are some needed changes V3

+help each other by give stuff = bigger chance to build houses (function in event.lua [need_helper])
i was a bit skeptical to this, but need to be tested, its basilicly what villagers does.

+go to members ("friends")
+less sticking with blocked paths (like when they are tring to walk under blocks)
fixed drowning over water
+limited creating paths per second (5), or making the the game freeze some times
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

Diamond knight
Member
 
Posts: 262
Joined: Sun Apr 19, 2015 19:50
In-game: Diamondknight or diamond_knight

Re: [Mod] Alive AI V3 [aliveai]

by Diamond knight » Fri Feb 17, 2017 15:54

In the wield view update the wield view was not working for some reason, only the armor was.
I can never get enough MESE!!!!!!!!!

my subgame: https://forum.minetest.net/viewtopic.php?f=50&t=11901
 

User avatar
lordfingle
Member
 
Posts: 65
Joined: Sat Apr 04, 2015 09:21
GitHub: eidy
IRC: lordfingle
In-game: lordfingle

Re: [Mod] Alive AI V3 [aliveai]

by lordfingle » Sun Feb 19, 2017 00:14

AiTechEye : I'm glad to see you like the idea of having this on github.

If you'd like me to keep this up to date you I recommend you continue to keep posting your zip files to the main post like you were before.

Also people can still get the very latest without waiting for github to be uploaded.
----------------------------------------------------------------------------------------------
Team Lead on "eidy- Love learning"
I like reading, walks on the beach and building edutech experiences in lua (Find out more in this post)
"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford
 

User avatar
TheReaperKing
Member
 
Posts: 493
Joined: Sun Nov 22, 2015 21:36

Re: [Mod] Alive AI V3 [aliveai]

by TheReaperKing » Sun Feb 19, 2017 00:31

Thanks for maintaining the repo for this lordfingle! AiEdwin, hehe, great work as always!! I can't wait to mess with this at work/school.
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com

Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com

Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3 [aliveai]

by AiTechEye » Sun Feb 19, 2017 08:07

its nice that you added it :-)
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

Diamond knight
Member
 
Posts: 262
Joined: Sun Apr 19, 2015 19:50
In-game: Diamondknight or diamond_knight

Re: [Mod] Alive AI V3 [aliveai]

by Diamond knight » Sun Feb 19, 2017 15:40

This mod shall be unstoppable! Now it can be literally developed 24/7 due to different time zones.
I can never get enough MESE!!!!!!!!!

my subgame: https://forum.minetest.net/viewtopic.php?f=50&t=11901
 

nuxed
New member
 
Posts: 8
Joined: Wed Feb 15, 2017 16:20

Re: [Mod] Alive AI V3 [aliveai]

by nuxed » Sun Feb 19, 2017 17:22

could you add EXP/ranks/classes/job system?
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3 [aliveai]

by AiTechEye » Sun Feb 19, 2017 19:08

explain more
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

nuxed
New member
 
Posts: 8
Joined: Wed Feb 15, 2017 16:20

Re: [Mod] Alive AI V3 [aliveai]

by nuxed » Sun Feb 19, 2017 21:52

[bot/player] gained %EXP for killing [bot/player/mob]!
[bot/player] is now %level!
[bot/player] can now upgrade to [rank] of [class/job], allow Y/N? [Y = upgrade/N = do not upgrade/auto = random pick]
[bot/player] got items for [class/job]!
 

Diamond knight
Member
 
Posts: 262
Joined: Sun Apr 19, 2015 19:50
In-game: Diamondknight or diamond_knight

Re: [Mod] Alive AI V3 [aliveai]

by Diamond knight » Sun Feb 19, 2017 22:04

I want a setting to turn that stuff off for bot player functionality if so
I can never get enough MESE!!!!!!!!!

my subgame: https://forum.minetest.net/viewtopic.php?f=50&t=11901
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3 [aliveai]

by AiTechEye » Mon Feb 20, 2017 08:35

a question is, in v3 i added a function, that makes bots give there stuff (not tools) to a bot that have more stuff, to make more chance to someone build a house. (teamwork)

so if you make a bunch of bots by same team will you see that, they works like ants.
Im thinking of, make the folk14 (the robot kind) only have the function (+ add a helpwork group)

and make the other give stuff to someone that asks for it.

what do you think?

could you add EXP/ranks/classes/job system?


we can make special battle bots for that, checkout this
its easy to make bots for aliveai, just to disable stuff you dont want and let it do the stuff by self.
you can also make 99% control over the bots
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
aliveai.create_bot({
      attack_players=1,
      name="battle_bot1",
      team="battle1",
      texture="aliveai_skin2.png",
      attacking=1,
      talking=0,
      escape=0,
      hp=20,
      dmg=0,
      building=0,
   on_spawn=function(self)
      self.exp=0
      self.damage=4
      self.battle=true
   end,
   on_punching=function(self,target)

-- killing someone

      if aliveai.gethp(target)<1 then
         self.exp=self.exp+1
         self.damage=self.damage+2
-- get steel sword
         if self.exp==4 then
            aliveai.invadd(self,"default:sword_steel",1)
         end
-- get bronze sword
         if self.exp==8 then
            aliveai.invadd(self,"default:sword_bronze",1)
         end
-- can build
         if self.exp==10 then
            self.building=1
         end
      else
-- punching
         target:punch(self.object,1,{full_punch_interval=1,damage_groups={fleshy=self.damage}},nil)
      end
   end,

-- add bonus exp to the killer, if its a bottle bot

   on_death=function(self,puncher,pos)
      local en=puncher:get_luaentity()
      if en and en.aliveai and en.battle then
         local exp1=math.floor(self.exp4)
         local exp2=puncher:get_luaentity().exp
         puncher:get_luaentity().exp=exp2+exp1
      end
   end,
})
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

nuxed
New member
 
Posts: 8
Joined: Wed Feb 15, 2017 16:20

Re: [Mod] Alive AI V3 [aliveai]

by nuxed » Mon Feb 20, 2017 16:33

can you make a guide on what to do with that code and where to put it and label it?

all my NPCs just dig holes.
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3 [aliveai]

by AiTechEye » Mon Feb 20, 2017 17:53

There are a lot of description in the readme file.
and just to copy code from the aliveai mod to test and try (i learnt programing in that way)
It doesnt mather what you call the mod folder.
Attachments
aliveai_battle.zip
(829 Bytes) Downloaded 195 times
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Alive AI V3 [aliveai]

by azekill_DIABLO » Tue Feb 21, 2017 11:17

this mod is purely awesome!
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

jimy
Member
 
Posts: 16
Joined: Mon Mar 12, 2012 22:15

Re: [Mod] Alive AI V3 [aliveai]

by jimy » Wed Feb 22, 2017 15:36

This mod seems amazing, and is a revolution for every mobs mods !
I tried it but I encoutered some problems.

It's probably a stupid note, but It seems that this mod doesn't work on the latest minetest: I tried it with minetest 0.4.15-dev.
first I need to replace all "ï" from items.lua by UTF-8 "i", else minetest is not able to load the mod.
Then when I start the game and I see bots starting (beginning to search what to do), there is a crash on one of the "for i, v in pairs(relist)" near line 527 of file items.lua
minetest raises the following kind of backtrace:
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
2017-02-22 16:24:07: WARNING[Main]: Couldn't find a locale directory!
2017-02-22 16:24:07: [Main]: Automatically selecting world at [/home/jimy/minetest-master/bin/../worlds/truc]
Loaded texture: /home/jimy/minetest-master/textures/base/pack/menu_header.png
2017-02-22 16:24:25: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
[aliveai] default/character.b3d is used as default model
[aliveai] api Loaded
[aliveai] loaded: aliveai:bot
[aliveai] loaded: aliveai:bot2
[aliveai] loaded: aliveai_trader:trader
[aliveai] loaded: aliveai_threats:nitrogen
[aliveai] loaded: aliveai_threats:gassman
[aliveai] loaded: aliveai_threats:nitrogenblow
[aliveai] loaded: aliveai_threats:terminator
[aliveai] loaded: aliveai_threats:pull_monster
[aliveai] loaded: aliveai_threats:cockroach
[aliveai] loaded: aliveai_threats:ninja
[aliveai] loaded: aliveai_threats:quantum_monster
[aliveai] loaded: aliveai_folk:folk1
[aliveai] loaded: aliveai_folk:folk2
[aliveai] loaded: aliveai_folk:folk3
[aliveai] loaded: aliveai_folk:folk4
[aliveai] loaded: aliveai_folk:folk5
[aliveai] loaded: aliveai_folk:folk6
[aliveai] loaded: aliveai_folk:folk7
[aliveai] loaded: aliveai_folk:folk8
[aliveai] loaded: aliveai_folk:folk9
[aliveai] loaded: aliveai_folk:folk10
[aliveai] loaded: aliveai_folk:folk11
[aliveai] loaded: aliveai_folk:folk12
[aliveai] loaded: aliveai_folk:folk13
[aliveai] loaded: aliveai_folk:folk14
[aliveai] loaded: aliveai_folk:folk15
2017-02-22 16:24:25: ACTION[Main]:         .__               __                   __   
2017-02-22 16:24:25: ACTION[Main]:   _____ |__| ____   _____/  |_  ____   _______/  |_
2017-02-22 16:24:25: ACTION[Main]:  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
2017-02-22 16:24:25: ACTION[Main]: |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  | 
2017-02-22 16:24:25: ACTION[Main]: |__|_|  /__|___|  /\___  >__|  \___  >____  > |__| 
2017-02-22 16:24:25: ACTION[Main]:       \/        \/     \/          \/     \/       
2017-02-22 16:24:25: ACTION[Main]: World at [/home/jimy/minetest-master/bin/../worlds/truc]
2017-02-22 16:24:25: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:30000.
2017-02-22 16:24:26: ACTION[Server]: machin [127.0.0.1] joins game.
2017-02-22 16:24:26: ACTION[Server]: machin joins game. List of players: machin
C3I1EFIU4C: loaded
C3I1EFIU4C: bot loaded
2QPGW6Tu76147g: loaded
2QPGW6Tu76147g: bot loaded
2QPGW6Tu76147g: mine
2QPGW6Tu76147g: check neartarget
2QPGW6Tu76147g: tower path
2QPGW6Tu76147g: bridge path
2QPGW6Tu76147g: mine
C3I1EFIU4C: search objects
2QPGW6Tu76147g: search objects
C3I1EFIU4C: drop all items
C3I1EFIU4C: drop dead body
2017-02-22 16:24:44: ACTION[Server]: LuaEntitySAO at (-610,23.8,1614) punched by LuaEntitySAO at (-610,23.8,1614), damage 160 hp, health now 0 hp
2QPGW6Tu76147g: search objects
2QPGW6Tu76147g: searching
2QPGW6Tu76147g: find node
2QPGW6Tu76147g: need: default:chest 1 search default:chest have: 0 time: 5
2QPGW6Tu76147g: need: default:chest 1 search default:chest have: 0 time: 5
2QPGW6Tu76147g: find node
2QPGW6Tu76147g: check neartarget
2QPGW6Tu76147g: check neartarget
2QPGW6Tu76147g: tower path
2QPGW6Tu76147g: check neartarget
2QPGW6Tu76147g: need: default:dirt 156 search group:soil have: 3 time: 5
2QPGW6Tu76147g: need: default:dirt 156 search group:soil have: 3 time: 5
2017-02-22 16:24:48: ACTION[Server]:  digs default:dirt_with_dry_grass at (-622,15,1625)
2QPGW6Tu76147g: dig default:dirt_with_dry_grass
2017-02-22 16:24:48: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'xpanes' in callback luaentity_Step(): invalid key to 'next'
2017-02-22 16:24:48: ERROR[Main]: stack traceback:
2017-02-22 16:24:48: ERROR[Main]:       [C]: in function '(for generator)'
2017-02-22 16:24:48: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/items.lua:532: in function 'crafting'
2017-02-22 16:24:48: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/items.lua:285: in function 'haveneed'
2017-02-22 16:24:48: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/items.lua:203: in function 'invadd'
2017-02-22 16:24:48: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/items.lua:356: in function 'dig'
2017-02-22 16:24:48: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/event.lua:972: in function 'mine'
2017-02-22 16:24:48: ERROR[Main]:       .../minetest-master/bin/../mods/aliveai/aliveai/bot.lua:28: in function <.../minetest-master/bin/../mods/aliveai/aliveai/bot.lua:2>
2017-02-22 16:24:48: ACTION[Server]: machin leaves game. List of players:
AL lib: (WW) FreeContext: (0x232c880) Deleting 1 Source(s)
AL lib: (WW) FreeDevice: (0x21818f0) Deleting 84 Buffer(s)
Loaded texture: /home/jimy/minetest-master/textures/base/pack/menu_header.png
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3 [aliveai]

by AiTechEye » Wed Feb 22, 2017 16:55

which download are you using? github or the forum?
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

jimy
Member
 
Posts: 16
Joined: Mon Mar 12, 2012 22:15

Re: [Mod] Alive AI V3 [aliveai]

by jimy » Wed Feb 22, 2017 17:17

AiTechEye wrote:which download are you using? github or the forum?

Well, this backtrace is from the version posted on the forum, But I tried both, and there is also a problem with the github version.
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3.1 [aliveai]

by AiTechEye » Wed Feb 22, 2017 17:27

try v3.1 if there is any difference

https://forum.minetest.net/download/file.php?id=9159
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

jimy
Member
 
Posts: 16
Joined: Mon Mar 12, 2012 22:15

Re: [Mod] Alive AI V3.1 [aliveai]

by jimy » Wed Feb 22, 2017 17:39

After replaced "self.fínvist" by "self.finvist" into aliveai_threats/init.lua (it was this file and not items.lua)
I get the same kind of 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
2017-02-22 18:34:34: WARNING[Main]: Couldn't find a locale directory!
2017-02-22 18:34:34: [Main]: Automatically selecting world at [/home/jimy/minetest-master/bin/../worlds/truc]
Loaded texture: /home/jimy/minetest-master/textures/base/pack/menu_header.png
2017-02-22 18:34:49: ERROR[Main]: The following mods could not be found: "aliveai_status"
2017-02-22 18:34:49: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
[aliveai] default/character.b3d is used as default model
[aliveai] api Loaded
[aliveai] loaded: aliveai:bot
[aliveai] loaded: aliveai:bot2
[aliveai] loaded: aliveai_trader:trader
[aliveai] loaded: aliveai_threats:nitrogen
[aliveai] loaded: aliveai_threats:gassman
[aliveai] loaded: aliveai_threats:nitrogenblow
[aliveai] loaded: aliveai_threats:terminator
[aliveai] loaded: aliveai_threats:pull_monster
[aliveai] loaded: aliveai_threats:cockroach
[aliveai] loaded: aliveai_threats:ninja
[aliveai] loaded: aliveai_threats:quantum_monster
[aliveai] loaded: aliveai_folk:folk1
[aliveai] loaded: aliveai_folk:folk2
[aliveai] loaded: aliveai_folk:folk3
[aliveai] loaded: aliveai_folk:folk4
[aliveai] loaded: aliveai_folk:folk5
[aliveai] loaded: aliveai_folk:folk6
[aliveai] loaded: aliveai_folk:folk7
[aliveai] loaded: aliveai_folk:folk8
[aliveai] loaded: aliveai_folk:folk9
[aliveai] loaded: aliveai_folk:folk10
[aliveai] loaded: aliveai_folk:folk11
[aliveai] loaded: aliveai_folk:folk12
[aliveai] loaded: aliveai_folk:folk13
[aliveai] loaded: aliveai_folk:folk14
[aliveai] loaded: aliveai_folk:folk15
2017-02-22 18:34:49: ACTION[Main]:         .__               __                   __   
2017-02-22 18:34:49: ACTION[Main]:   _____ |__| ____   _____/  |_  ____   _______/  |_
2017-02-22 18:34:49: ACTION[Main]:  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
2017-02-22 18:34:49: ACTION[Main]: |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  | 
2017-02-22 18:34:49: ACTION[Main]: |__|_|  /__|___|  /\___  >__|  \___  >____  > |__| 
2017-02-22 18:34:49: ACTION[Main]:       \/        \/     \/          \/     \/       
2017-02-22 18:34:49: ACTION[Main]: World at [/home/jimy/minetest-master/bin/../worlds/truc]
2017-02-22 18:34:49: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:30000.
2017-02-22 18:34:49: ACTION[Server]: jimy [127.0.0.1] joins game.
2017-02-22 18:34:49: ACTION[Server]: jimy joins game. List of players: jimy
2017-02-22 18:35:00: ACTION[Server]:  digs default:stone at (-29,12,10)
2017-02-22 18:35:00: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'xpanes' in callback luaentity_Step(): invalid key to 'next'
2017-02-22 18:35:00: ERROR[Main]: stack traceback:
2017-02-22 18:35:00: ERROR[Main]:       [C]: in function '(for generator)'
2017-02-22 18:35:00: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/items.lua:532: in function 'crafting'
2017-02-22 18:35:00: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/items.lua:285: in function 'haveneed'
2017-02-22 18:35:00: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/items.lua:203: in function 'invadd'
2017-02-22 18:35:00: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/items.lua:356: in function 'dig'
2017-02-22 18:35:00: ERROR[Main]:       ...inetest-master/bin/../mods/aliveai/aliveai/event.lua:993: in function 'mine'
2017-02-22 18:35:00: ERROR[Main]:       .../minetest-master/bin/../mods/aliveai/aliveai/bot.lua:27: in function <.../minetest-master/bin/../mods/aliveai/aliveai/bot.lua:1>
2017-02-22 18:35:00: ACTION[Server]: jimy leaves game. List of players:
AL lib: (WW) FreeDevice: (0x305dd20) Deleting 84 Buffer(s)
Quit message received.
Loaded texture: /home/jimy/minetest-master/textures/base/pack/menu_header.png
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3.1 [aliveai]

by AiTechEye » Wed Feb 22, 2017 17:52

this kind of weird errors are hard for solve, because there is nothing to find :-)

self.fínvist will only be true or nil, to check if the variable exist

but try to set enable_build=false in init.lua, it will disable build and crafting for all bots
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

jimy
Member
 
Posts: 16
Joined: Mon Mar 12, 2012 22:15

Re: [Mod] Alive AI V3.12 [aliveai]

by jimy » Wed Feb 22, 2017 21:03

What version of lua are you using to compile minetest ? I think it can be due to my old version of the library, math.random from my library doesn't match with your usage of this function. When I change the parts of your code that is using math.random, there is no more problems with it. (I disabled crafting of course, so there is no more call to pairs())
 

jimy
Member
 
Posts: 16
Joined: Mon Mar 12, 2012 22:15

Re: [Mod] Alive AI V3.12 [aliveai]

by jimy » Wed Feb 22, 2017 21:25

http://lua-users.org/lists/lua-l/2009-05/msg00389.html
for the error with items.lua:
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
invalid key to 'next' ... in function '(for generator)'

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
> As stated in the Lua reference manual, this means that during the
> iteration you are assigning to a key that didn't exist prior to the
> iteration.  This was the case in Lua 5.0, however the error is not
> guaranteed to happen each and every time.

I compile minetest with liblua5.2 but the problem can still.

(When I replace all pairs() by ipairs() it works fine)
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3.12 [aliveai]

by AiTechEye » Thu Feb 23, 2017 16:41

Im using sfan5's builds (windows 64 bit)

https://forum.minetest.net/viewforum.php?f=42

i was by confused by the diference between pairs and ipairs, and got this answere:

pairs is "array-like" and ipairs "map-like"
and when i tested:

pairs can handle: "a","b","c",["a"],["b"],["c"]
ipairs only: "a","b","c"
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

bell07
Member
 
Posts: 140
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Alive AI V3.12 [aliveai]

by bell07 » Thu Feb 23, 2017 16:56

i was by confused by the diference between pairs and ipairs, and got this answere:

pairs is "array-like" and ipairs "map-like"
and when i tested:

ipairs is for indexed arrays
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
for index, value in ipairs( {a, b, c,}) do
   print(index, value)
end

1 a
2 b
3 c


pairs is for key/value arrays
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
[code]for key, value in pairs( {a=b, c=d, e=f,}) do
   print(key, value)
end

a b
c d
e f
 

jimy
Member
 
Posts: 16
Joined: Mon Mar 12, 2012 22:15

Re: [Mod] Alive AI V3.12 [aliveai]

by jimy » Thu Feb 23, 2017 18:13

ipairs is for indexed arrays
pairs is for key/value arrays

So using ipairs would avoid crash while iterating a list that is modified during the loop ?
 

bell07
Member
 
Posts: 140
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Alive AI V3.12 [aliveai]

by bell07 » Sun Feb 26, 2017 12:14

So using ipairs would avoid crash while iterating a list that is modified during the loop ?
There cannot be an answer in general that "ipairs" solves all problems. But what is exactly the problem? I do not know the code in detail..

An other problem. If I try your mod I get the 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
2017-02-26 13:11:34: ERROR[Main]: ModError: Failed to load and run script from ~/.minetest/mods/staging-aliveai-modpack/aliveai_threats/init.lua:
2017-02-26 13:11:34: ERROR[Main]: ~/.minetest/mods/staging-aliveai-modpack/aliveai_threats/init.lua:761: 'then' expected near '�'
2017-02-26 13:11:34: ERROR[Main]: Siehe debug.txt für Details.

It seems the source is not UTF-8. I tried to convert them but without luck. Can you please use UTF-8 encoding in Lua files? Please do not use "enhanced ASCII characters" like "äöü" in variable names also.
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3.13 [aliveai]

by AiTechEye » Sun Feb 26, 2017 18:45

all .lua and readme files are now saved in UTF-8, (ANSI is the standard in msnote + had no idea of the difference)
depends.txt are still using ANSI becaouse it wont work with UTF-8 by some reason.

i suspect the special characters "í" came from my webbrowser (weird that it worked at all)

hope you will this one :P
they spawns everywhere, and are shooting
Image
Attachments
screenshot_20170227_000305.png
screenshot_20170227_000305.png (239.41 KiB) Viewed 9817 times
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

User avatar
AiTechEye
Member
 
Posts: 409
Joined: Fri May 29, 2015 21:14

Re: [Mod] Alive AI V3.29 [aliveai]

by AiTechEye » Tue Feb 28, 2017 12:36

Mind controller, let you remote control aliveai bots + mobs_redo mobs

Controls: (or see in liveai_minecontroller/readme for controlls)
sneak = exit

w/up = walk
s/down = run
s/down + JUMP = JUMPx2
jump = jump

hold use/leftclick = use bot tool (if it have one)
hold use/leftclick with controller on block = bot dig
place/rightclick with controller on block = place block (if the bot have as you have, left side of the controller)

punch with controller = bot punch
punch with controller on item = bot picks up

d/right & s/left = toggle bot self control

Image
Attachments
screenshot_20170228_132450.png
screenshot_20170228_132450.png (677.2 KiB) Viewed 9817 times
Last edited by AiTechEye on Wed Mar 01, 2017 15:08, edited 1 time in total.
Alive AI Mine/Build AI NPC
Gravitygun HL2
Portalgun Portal
Marssurvive Survive on mars
Bows bows + arrows
SoundCloud (Music)
SoundCloud (Classic)
YouTube
 

bell07
Member
 
Posts: 140
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Alive AI V3.3 [aliveai]

by bell07 » Tue Feb 28, 2017 17:05

Can you pls. update github?
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 13 guests

cron