Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fixing AI after the last update
gianluca280395 Offline
Starved from coding
***

Posts: 183
Threads: 14
Joined: Apr 2015
#1
Fixing AI after the last update
Good night all
Since the last update this week (october 2015) mostly AI stopped working and crashed, making it unnable to play with homuns.

Not too long I posted here (Default AI) a default AI used on test server, so you can at least log in with your alchemist.

Analyzing the errors messages when the client crashes it has found that some commands on the old AIs doesnt work anymore for the new client. I've found 3 types of errors that il try to show how to fix:

Cannot open "file"
This happens because the client runs the AI.lua first and this one "calls" other files.
The error happens because of two things:
- The old AI uses a command called "require "file"", which may seem to be not working anymore. To fix this, change the
PHP Code:
require "./AI/USER_AI/Const.lua" 
to
PHP Code:
dofile("./AI/USER_AI/Const.lua"
for example, you will need to search on all files from your USER_AI folder for those lines and change this. do not forget to close the () before any --
-- means that line is a comment and the client will not recognize anything after it, for example

PHP Code:
require "./AI/USER_AI/Config.lua" -- configuration file 
change to
PHP Code:
dofile("./AI/USER_AI/Config.lua") -- configuration file 
instead of
PHP Code:
dofile("./AI/USER_AI/Config.lua" -- configuration file

-The second part of this error is that now the client will only recognize the files from AI_sakray folder instead of AI folder, so, you will need to create another folder called AI_sakray and put all files on it.
After that you will need to correct the way the command dofile calls those files from, all of them should be "./AI/USER_AI/file", you will need to change to "./AI_sakray/USER_AI/file", for example:

PHP Code:
dofile("./AI/USER_AI/Const.lua"
change to
PHP Code:
dofile("./AI_sakray/USER_AI/Const.lua"

again, do this TO ALL FILES ON YOUR AI FOLDER.

attempt to call a table value
This is another error I found, but I cant just explain how it works, if you are curious you can read this (Tables Tutorial - LUA), basically it tries to check a value from a table, but the syntax is not recognized by the new client.

to fix this you will need to log into your char and crash it, it will show a error message with a number, which is the number of the line with the error on the code.
go to this line and you will find something like this:

PHP Code:
for i,v in NoAggroMobList do 
the name can vary but the important is to change it to something like this:
PHP Code:
for iv in pairs(NoAggroMobList) do 

again, do it on all lines like this on your code. If you miss any line the client will crash again and say which is the line with the error.

I hope you guys understand this.

Good luck
Gianluca

@edit: One more thing. You should expect some crashes even after those corrections, which means that you probably forgot to correct some lines of the code or this is a new error (which I doubt but is possible). In this case, please send the screenshot with the error log.
chars:
Crazy Bandit - Stalker
Nurelion - Creator
(with his amistr Gobball :3)
Sarcedos Signat - High Priest
Rulindil - Star Gladiator
[Image: code_monkey_coffee_mug-ref73810428c94d21...pe=content]
(This post was last modified: 10-16-2015, 03:31 PM by gianluca280395.)
10-14-2015, 07:22 PM
Find Reply
GM-Pandora Offline
Admin Extraordinaire
*******

Posts: 14,774
Threads: 703
Joined: Sep 2005
#2
RE: Fixing AI after the last update
Much thanks for this Icon_smile
10-14-2015, 08:21 PM
Find Reply
Summerstream Offline
Yggdrasil Scholar
****

Posts: 580
Threads: 11
Joined: Sep 2010
#3
RE: Fixing AI after the last update
I'll do the code changes to my own AI, then post the resulting files, as not everyone is extremely tech savvy.

Edit:

Here's the link to the file download. Let me know if the link is bad. Was apparently too big to be uploaded on the forums :/

Fixed Files

[Image: b425bfefffd1a7c468a5ca464d77b353.png]
[Image: .gif]
Test & Dev | Wiki
The taste of our wine is as divine as the stars
Summerstream | Amelia Newman
Ithilethiel | Aquaris Harmoni
.Pavan. | Sheena Archer
~Saya~ | +Aurora+
Wine Brewing Society
(This post was last modified: 10-14-2015, 11:30 PM by Summerstream.)
10-14-2015, 10:20 PM
Find Reply
demishock Offline
Natural Selection
*****

Posts: 444
Threads: 16
Joined: May 2009
#4
RE: Fixing AI after the last update
Thanks a TON for all of this! I edited the bejeezus out of my own files and now it appears to be fully functioning again. \o/ Including ALT+T making my Amistr go attack things.

Also, if anyone wants to add the new custom monsters from Poporing Island to their CustomMonsters.lua file (tutorial here for those who don't have it yet):

CustomMonsters[2576] = true -- Cupcakering
CustomMonsters[2581] = true -- Deviruchiring
CustomMonsters[2863] = true -- Foxring
CustomMonsters[2865] = true -- Jailring
CustomMonsters[2864] = true -- Orcring
10-16-2015, 12:20 AM
Find Reply
Rei Ayanami 18 Offline
Agility Addict! \( 'ヮ' )/
***

Posts: 204
Threads: 6
Joined: Jun 2007
#5
RE: Fixing AI after the last update
I am totally lost.. overall... (How do you name all the files? Not sure I'm understanding this... help please)
I log on my Alchemist, which the Homunc is already summoned...
I get the following two AI.lua errors:
"cannot open ./AI_sakray/AI.lua: No such file of directory"
&
"attempt to call a nil vale"
[Image: 851e24f8e3a3edd9a05a90179ce4dcfd--anime-...-girls.jpg] Nyuu!
10-17-2015, 06:47 PM
Find Reply
Summerstream Offline
Yggdrasil Scholar
****

Posts: 580
Threads: 11
Joined: Sep 2010
#6
RE: Fixing AI after the last update
Rei, I did the fixed files following sac's instructions so you didnt have to dig through lines of code. :x
[Image: .gif]
Test & Dev | Wiki
The taste of our wine is as divine as the stars
Summerstream | Amelia Newman
Ithilethiel | Aquaris Harmoni
.Pavan. | Sheena Archer
~Saya~ | +Aurora+
Wine Brewing Society
10-17-2015, 07:15 PM
Find Reply
gianluca280395 Offline
Starved from coding
***

Posts: 183
Threads: 14
Joined: Apr 2015
#7
RE: Fixing AI after the last update
Hmm, you should create a new folder named AI_sakray on RO folder, then put the files from old AI inside this one. After you will have 2 folders with the same files, AI and AI_sakray. I dont know why or if AI is still needed, I just leaved mine there.
Of course you can download the files summer uploaded, I believe she uses mirAI too, but you will need to reconfig it, probably.
chars:
Crazy Bandit - Stalker
Nurelion - Creator
(with his amistr Gobball :3)
Sarcedos Signat - High Priest
Rulindil - Star Gladiator
[Image: code_monkey_coffee_mug-ref73810428c94d21...pe=content]
10-17-2015, 08:02 PM
Find Reply
Summerstream Offline
Yggdrasil Scholar
****

Posts: 580
Threads: 11
Joined: Sep 2010
#8
RE: Fixing AI after the last update
Yeah, I use MirAI, Sac. Its the AI provided by the server.
From doing the code, you still need both folders actually. I had errors in both directories when I was working. Once I figured out how to fix things at least.
[Image: .gif]
Test & Dev | Wiki
The taste of our wine is as divine as the stars
Summerstream | Amelia Newman
Ithilethiel | Aquaris Harmoni
.Pavan. | Sheena Archer
~Saya~ | +Aurora+
Wine Brewing Society
(This post was last modified: 10-18-2015, 04:23 PM by Summerstream.)
10-17-2015, 08:05 PM
Find Reply
Rei Ayanami 18 Offline
Agility Addict! \( 'ヮ' )/
***

Posts: 204
Threads: 6
Joined: Jun 2007
#9
RE: Fixing AI after the last update
I am having no luck with the files you provided.. Is there someway I can start with a new AI folder? I have a custom one already and I doubt it's MirAI, and seems like something else isn't working... Sorry to bother you all more about this, I just want to get on my alchemist. I appreciate your help and patience, now and in advance Icon_biggrin
Dx
[Image: 851e24f8e3a3edd9a05a90179ce4dcfd--anime-...-girls.jpg] Nyuu!
10-20-2015, 11:29 PM
Find Reply
Summerstream Offline
Yggdrasil Scholar
****

Posts: 580
Threads: 11
Joined: Sep 2010
#10
RE: Fixing AI after the last update
Its perfectly fine!

Can you tell me exactly how you are moving the files into your RO folder? If you can, rename your old AI folders as old.AI and old.AI_sakray before moving the files. This way we can determine if its the files, or something in your old AI.

There is also going to be a patch released tomorrow, as posted by GM-Garr, for the homun AI.
[Image: .gif]
Test & Dev | Wiki
The taste of our wine is as divine as the stars
Summerstream | Amelia Newman
Ithilethiel | Aquaris Harmoni
.Pavan. | Sheena Archer
~Saya~ | +Aurora+
Wine Brewing Society
(This post was last modified: 10-21-2015, 12:35 AM by Summerstream.)
10-21-2015, 12:35 AM
Find Reply


Forum Jump: