L2JMobius

Free Users => Shares/Contributions => Topic started by: mrk on January 29, 2022, 02:25:47 AM

Title: Autopilot Engine
Post by: mrk on January 29, 2022, 02:25:47 AM
Autopilot engine ported to L2J Frost Lord 5.2

https://bitbucket.org/l2-mods/autopilot-frostlord-mobius/src/master/

Based on:

https://github.com/danielbarion/HighFive (https://github.com/danielbarion/HighFive)

https://l2jmobius.org/forum/index.php?topic=3644.0 (https://l2jmobius.org/forum/index.php?topic=3644.0)
Title: Re: Autopilot Engine
Post by: bctey on January 29, 2022, 07:04:12 PM
GameServer error....

Code: [Select]
[30/01 00:53:19] Handlers Loaded...
[30/01 00:53:23] GameServer: Failed to execute script list!
java.lang.NullPointerException: Cannot invoke "javax.tools.JavaFileObject.getName()" because the return value of "javax.tools.Diagnostic.getSource()" is null
at org.l2jmobius.gameserver.scripting.java.JavaExecutionContext.executeScripts(JavaExecutionContext.java:166)
at org.l2jmobius.gameserver.scripting.ScriptEngineManager.executeScriptList(ScriptEngineManager.java:181)
at org.l2jmobius.gameserver.GameServer.<init>(GameServer.java:416)
at org.l2jmobius.gameserver.GameServer.main(GameServer.java:538)

[30/01 00:53:23] SpawnData: Initializing spawns...
Title: Re: Autopilot Engine
Post by: mrk on January 30, 2022, 02:04:54 PM
Hi. Thanks for issue the error.
I tried to reproduce this error but everything has worked. Im not saying the this is the problem, but are you using JDK 17?

Im also added 2 missing instructions in the installation guide. They are not related to this problem.
Title: Re: Autopilot Engine
Post by: borinet on January 30, 2022, 11:11:24 PM
Please convert to the classic version.
Title: Re: Autopilot Engine
Post by: KachambA on January 31, 2022, 03:21:50 PM
Hi. Thanks for issue the error.
I tried to reproduce this error but everything has worked. Im not saying the this is the problem, but are you using JDK 17?

Im also added 2 missing instructions in the installation guide. They are not related to this problem.

i have the same error and i use 17 java

Code: [Select]
янв. 31, 2022 1:19:40 PM org.l2jmobius.gameserver.GameServer <init>
WARNING: GameServer: Failed to execute script list!
java.lang.NullPointerException: Cannot invoke "javax.tools.JavaFileObject.getName()" because the return value of "javax.tools.Diagnostic.getSource()" is null
at org.l2jmobius.gameserver.scripting.java.JavaExecutionContext.executeScripts(JavaExecutionContext.java:166)
at org.l2jmobius.gameserver.scripting.java.JavaExecutionContext.executeScript(JavaExecutionContext.java:239)
at org.l2jmobius.gameserver.scripting.ScriptEngineManager.executeScript(ScriptEngineManager.java:164)
at org.l2jmobius.gameserver.GameServer.<init>(GameServer.java:390)
at org.l2jmobius.gameserver.GameServer.main(GameServer.java:532)
Title: Re: Autopilot Engine
Post by: mrk on January 31, 2022, 06:08:01 PM
Please convert to the classic version.

I'll take a look. I keep you informed. Any specific version?
Title: Re: Autopilot Engine
Post by: mrk on January 31, 2022, 06:09:23 PM
Hi. Thanks for issue the error.
I tried to reproduce this error but everything has worked. Im not saying the this is the problem, but are you using JDK 17?

Im also added 2 missing instructions in the installation guide. They are not related to this problem.

i have the same error and i use 17 java

Code: [Select]
янв. 31, 2022 1:19:40 PM org.l2jmobius.gameserver.GameServer <init>
WARNING: GameServer: Failed to execute script list!
java.lang.NullPointerException: Cannot invoke "javax.tools.JavaFileObject.getName()" because the return value of "javax.tools.Diagnostic.getSource()" is null
at org.l2jmobius.gameserver.scripting.java.JavaExecutionContext.executeScripts(JavaExecutionContext.java:166)
at org.l2jmobius.gameserver.scripting.java.JavaExecutionContext.executeScript(JavaExecutionContext.java:239)
at org.l2jmobius.gameserver.scripting.ScriptEngineManager.executeScript(ScriptEngineManager.java:164)
at org.l2jmobius.gameserver.GameServer.<init>(GameServer.java:390)
at org.l2jmobius.gameserver.GameServer.main(GameServer.java:532)

Thanks for the information. I'll take a closer look.
Title: Re: Autopilot Engine
Post by: borinet on February 01, 2022, 01:00:37 AM
Please convert to the classic version.

I'll take a look. I keep you informed. Any specific version?

Thank you!
Classic 2.3 SevenSigns version.
Title: Re: Autopilot Engine
Post by: Xorus on February 05, 2022, 11:52:27 PM
I have the same problem as a user above


(https://i.ibb.co/0hJHTT2/Captura-de-pantalla-2022-02-05-185106.png) (https://ibb.co/hD83bb9)
Title: Re: Autopilot Engine
Post by: Esmerald on February 11, 2022, 04:20:43 PM
Can somebody help to install this ? I have the same problem like people before =(
Title: Re: Autopilot Engine
Post by: jorfan on February 11, 2022, 11:35:17 PM
Can you do it for the latest version of Mobius ? Essense ?
Title: Re: Autopilot Engine
Post by: mrk on March 02, 2022, 02:15:00 AM
I apologize for the delay in giving an answer. I was unable to reproduce this error. I ask you to add the following snippet in the file gameserver/scripting/java/JavaExecutionContext.java just above line 166:

Code: [Select]

if (diagnostic.getSource() == null) {
   throw new AssertionError(diagnostic);
}

will look like this:

Code: [Select]
for (Diagnostic<? extends JavaFileObject> diagnostic : compilationDiagnostics.getDiagnostics())
{
if (diagnostic.getSource() == null) {
throw new AssertionError(diagnostic);
}
out.println("\t" + diagnostic.getKind() + ": " + diagnostic.getSource().getName() + ", Line " + diagnostic.getLineNumber() + ", Column " + diagnostic.getColumnNumber());
out.println("\t\tcode: " + diagnostic.getCode());
out.println("\t\tmessage: " + diagnostic.getMessage(null));
}

I ask you to send the error returned in this snippet.
Title: Re: Autopilot Engine
Post by: KachambA on March 02, 2022, 12:38:55 PM
I apologize for the delay in giving an answer. I was unable to reproduce this error. I ask you to add the following snippet in the file gameserver/scripting/java/JavaExecutionContext.java just above line 166:

Code: [Select]

if (diagnostic.getSource() == null) {
   throw new AssertionError(diagnostic);
}

will look like this:

Code: [Select]
for (Diagnostic<? extends JavaFileObject> diagnostic : compilationDiagnostics.getDiagnostics())
{
if (diagnostic.getSource() == null) {
throw new AssertionError(diagnostic);
}
out.println("\t" + diagnostic.getKind() + ": " + diagnostic.getSource().getName() + ", Line " + diagnostic.getLineNumber() + ", Column " + diagnostic.getColumnNumber());
out.println("\t\tcode: " + diagnostic.getCode());
out.println("\t\tmessage: " + diagnostic.getMessage(null));
}

I ask you to send the error returned in this snippet.


Here is what is written in the console with the application of your patch:

Code: [Select]
[02/03 13:37:06] GameServer: Loading server scripts:
Exception in thread "main" java.lang.AssertionError: Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
at org.l2jmobius.gameserver.scripting.java.JavaExecutionContext.executeScripts(JavaExecutionContext.java:168)
at org.l2jmobius.gameserver.scripting.java.JavaExecutionContext.executeScript(JavaExecutionContext.java:243)
at org.l2jmobius.gameserver.scripting.ScriptEngineManager.executeScript(ScriptEngineManager.java:164)
at org.l2jmobius.gameserver.GameServer.<init>(GameServer.java:390)
at org.l2jmobius.gameserver.GameServer.main(GameServer.java:532)

Title: Re: Autopilot Engine
Post by: KachambA on March 02, 2022, 03:38:36 PM
The system started to boot, but when you put an artificial character, it gives an error:
Code: [Select]
java.lang.NullPointerException: Cannot invoke "String.hashCode()" because "<local3>" is null
at custom.autopilot.helpers.FakeHelpers.getFakeSelectedClass(FakeHelpers.java:75)
at custom.autopilot.ai.CombatAI.checkOccupation(CombatAI.java:137)
at custom.autopilot.ai.CombatAI.thinkAndAct(CombatAI.java:119)
at custom.autopilot.ai.occupations.third.GhostSentinelAI.thinkAndAct(GhostSentinelAI.java:30)
at custom.autopilot.tasks.AITask.lambda$aiThinkAndAct$2(AITask.java:51)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at custom.autopilot.tasks.AITask.aiThinkAndAct(AITask.java:51)
at custom.autopilot.tasks.AITask.run(AITask.java:27)
at org.l2jmobius.commons.concurrent.RunnableWrapper.run(RunnableWrapper.java:38)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Title: Re: Autopilot Engine
Post by: mrk on March 02, 2022, 03:57:14 PM
I am happy to hear. Did you do anything in particular to get it to boot?
Title: Re: Autopilot Engine
Post by: KachambA on March 02, 2022, 04:50:54 PM
I am happy to hear. Did you do anything in particular to get it to boot?

yes i did this:
Code: [Select]
diff --git a/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 62bce62..06cbf44 100644
--- a/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -1219,7 +1219,7 @@
  * @param accountName The name of the account including this PlayerInstance
  * @param app
  */
- private PlayerInstance(int objectId, PlayerTemplate template, String accountName, PlayerAppearance app)
+ public PlayerInstance(int objectId, PlayerTemplate template, String accountName, PlayerAppearance app)
  {
  super(objectId, template);
  setInstanceType(InstanceType.PlayerInstance);
diff --git a/java/org/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java b/java/org/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java
index 97a8e1d..4378d66 100644
--- a/java/org/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java
+++ b/java/org/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java
@@ -163,6 +163,11 @@
  out.println("-----------------------");
  for (Diagnostic<? extends JavaFileObject> diagnostic : compilationDiagnostics.getDiagnostics())
  {
+ if (diagnostic.getSource() == null)
+ {
+ throw new AssertionError(diagnostic);
+ }
+
  out.println("\t" + diagnostic.getKind() + ": " + diagnostic.getSource().getName() + ", Line " + diagnostic.getLineNumber() + ", Column " + diagnostic.getColumnNumber());
  out.println("\t\tcode: " + diagnostic.getCode());
  out.println("\t\tmessage: " + diagnostic.getMessage(null));
Title: Re: Autopilot Engine
Post by: mrk on March 02, 2022, 05:00:45 PM
As it was one of the first things I did, I forgot to include this (PlayerInstance visibility change) in the readme. Thank you very much.

As for the errors in using Autopilot, some are already expected. I will make the corrections and post the updates here. Thank you again.

Title: Re: Autopilot Engine
Post by: KachambA on March 02, 2022, 06:54:20 PM
As it was one of the first things I did, I forgot to include this (PlayerInstance visibility change) in the readme. Thank you very much.

As for the errors in using Autopilot, some are already expected. I will make the corrections and post the updates here. Thank you again.

Thanks for your great work.
Title: Re: Autopilot Engine
Post by: dabmvbnm on March 31, 2022, 04:49:33 PM
Thanks for your
L2J_Mobius_Essence_6.1_BattleChronicle great work.
Title: Re: Autopilot Engine
Post by: mrk on March 31, 2022, 04:59:00 PM
This is very nice of you, but thanks must go to Mobius and the core developement team.
Title: Re: Autopilot Engine
Post by: nnlyy520 on April 01, 2022, 05:48:10 AM
This is very nice of you, but thanks must go to Mobius and the core developement team.


Is this project still going on? Has there been an update?