Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fixing AI after the last update
Author Message
gianluca280395 Offline
Starved from coding
***

Posts: 183
Joined: Apr 2015
Post: #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 all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Fixing AI after the last update - gianluca280395 - 10-14-2015 07:22 PM

Forum Jump: