Some problems in dev AI Java
Moderators: hoijui, Moderators
Some problems in dev AI Java
Hello, I'm new here, I am Brazilian, a student of computer science, I'm developing an AI in java for my course conclusion work, but i'm facing some problems regarding the options of the Java interface, for example, when trying to access the functions of the class through a MoveData UnitDef simply closes the game, I can only access this information if an instance of Unit already exists, for example the commander who already starts with the game through the transferred Unit UnitFinished I access MoveData, I'm doing something wrong or is it anyway?
Re: Some problems in dev AI Java
is there an error message in infolog.txt about it?
afaik units have to be in Line of Sight if you want to access unitdef data.
maybe http://springrts.com/wiki/AI:Developmen ... definition helps?
afaik units have to be in Line of Sight if you want to access unitdef data.
maybe http://springrts.com/wiki/AI:Developmen ... definition helps?
Re: Some problems in dev AI Java
nops, what i try to do is:
OOAICallback.getUnitDefs().get(x).getMoveData().getMoveType();
is to do a table of units, a build table...
OOAICallback.getUnitDefs().get(x).getMoveData().getMoveType();
is to do a table of units, a build table...
Re: Some problems in dev AI Java
man.. we have asked for infolog.txt two times now (he first asked me in PM), and you still did not manage to give it?
be a bit more attentive when asking for help, k?
that is part of the basic respect one should give when requesting (free) help.
be a bit more attentive when asking for help, k?
that is part of the basic respect one should give when requesting (free) help.
Re: Some problems in dev AI Java
sorry guys, i was no intention of desrespecting anyone, i was in no possession of the infolog at the time, i have work and studie duties too like yours and i thought I had made ÔÇïÔÇïa mistake in the code, anyway, now i can show the infolog.txt
http://pastebin.com/EB39K9Qw
http://pastebin.com/EB39K9Qw
Re: Some problems in dev AI Java
I came to the conclusion that I can only access information from MoveData after the units were instantiating / created in the game, but what I wanted was to catalog all the information from all units at the beginning of the game, a table unit as well as many AI `s already do, however MoveData has definitions that would be important to be accessed freely, as the type of movement (to know what kind of unity is, even a function "isSubmarine" and I can't use it) I believe this information is not accessible because they are regarded as cheats (in infolog.txt has a line that tells something similar) or because they are directly linked to instantiate class "Unit ", I'm wrong or completely wrong?
Re: Some problems in dev AI Java
hmm.. can you probably give the AI project? or something i can paste into NullJavaOOAI that generates the same error.
Re: Some problems in dev AI Java
the simple command of getting the OOAICallback of the class Factory and:int i = 0;
i = OOAICallback.getUnitDefs().get(0).getMoveData().getMoveType();
this will crash the game
(Obs: getMoveType return int.. in the Javadoc.. )
i = OOAICallback.getUnitDefs().get(0).getMoveData().getMoveType();
this will crash the game
(Obs: getMoveType return int.. in the Javadoc.. )
Re: Some problems in dev AI Java
Code: Select all
List<UnitDef> unitDefs = callback.getUnitDefs();
for (UnitDef unitDef : unitDefs) {
MoveData moveData = unitDef.getMoveData();
if (moveData != null) {
int moveType = moveData.getMoveType();
System.out.println("move-type of unit[" + unitDef.getName() + "]: " + moveType);
}
}
Old versions will not be patched anymore anyway. Make sure you do not get a NullPointerException, and if it is really an engine/AI Interface problem, it is solved already (proved by this code example).
Re: Some problems in dev AI Java
here the problem have persistence, i am using Spring 0.82.7.1, not the master version, maybe could be this...? =/ i will try ohter things.. thanks anyway
Re: Some problems in dev AI Java
yes, i am pretty sure that can make a difference.
as i can not roll out fixes for an already released version, and as there will not be an other bugfix release for this version (very very likely not, at least), it makes no sense to investigate this further. if you know a workaround, even if it is ugly, use it, and document it properly in your code, so you can remove it once there is a new spring release.
as i can not roll out fixes for an already released version, and as there will not be an other bugfix release for this version (very very likely not, at least), it makes no sense to investigate this further. if you know a workaround, even if it is ugly, use it, and document it properly in your code, so you can remove it once there is a new spring release.