Loading...
 

PogamutUT2004


Turning back to old location/rotation.

Hi all,

Does anyone know how to after issuing Shoot command revert the bot back to the old orientation. Let say the bot runs in a straight line and the enemy is on his left, what it does then is to shoot left at the enemy and continue with his previous direction. My current approach is to save the old location & rotation just before shoot is done and then issue turnTo but the effect is completely not what I want. The bot simply goes back to strange direction spinning in circles or going in zigzag way.

Cheers,

P.
Hi!

Seems strange - how do you issue TurnTo command exactly?
We will try it at our side than.

Cheers!
Jakub
Hi Jakub!

Yes, it's me again and my problems :-) Well, the command is along the lines of
oldRotation = bot.getRotation
act(new TurnTo(null, oldRotation, null)
at it's simplest. The bot after running straight for some time and then shooting makes a turn by 90 degrees after calling turnto command. Is there a way to send rotation or even only yaw directly to gamebots as a string?

Thanks,

P.
Hi!

We're glad you're reporting them - at least it makes us better in helping others in similar situations ;-) it also points to common pitfalls that should be documented.

We will look at the command you've written.

Regarding custom commands - you may always create anonymous CommandMessage object and stuff it into act, e.g.

act.act(new CommandMessage() {
public String toString() {
return "custom command WITHOUT \n";
}
});

Cheers!
Jakub
Usually the bot has to focus on an opponent to fire on it. If you tell the bot to move from x to y, and along the way you tell it to focus on and shoot at an opponent, it will turn. If after the opponent is gone, you reissue a "move to y" command with the focus explicitly set to null, it should resume looking where it is going. The same can be done if you're using the pathExecutor, whose focus target and location can both be set to null.

-Jacob

> Hi all,
>
> Does anyone know how to after issuing Shoot command revert the bot back to the old orientation. Let say the bot runs in a straight line and the enemy is on his left, what it does then is to shoot left at the enemy and continue with his previous direction. My current approach is to save the old location & rotation just before shoot is done and then issue turnTo but the effect is completely not what I want. The bot simply goes back to strange direction spinning in circles or going in zigzag way.
>
> Cheers,
>
> P.
Thanks Jacob, much appreciated. It is a very good idea indeed. However, the way my actions are executed they do not specifically rely on moving from location to location with given coordinates. But rather at given time intervals a command is issued. I think I have solved the problem in a rather crude way (btw the code to TurnTo is buggy, it works on global coordinates which explains weird behaviour) using rotate command and by storing history of previous rotations and recalculating the angle between them. Seems to work fine so far though is not perfect.

P.
TurnTo command should work on global coordinates. In TurnTo command user specifies absolute rotation he wants to turn to (hence the name of the command). It is also in the Javadoc help to TurnTo command. (Maybe it is not 100% clear? - If it is the case, we'll stress it out a bit more.)

If you want relative rotation, use Rotate command.

Best,
Michal
 

News

News RSS RSS feed for News link



Pogamut

Quarterly RSS RSS feed for quarterly reports

Acknowledgement

This work is supported by GA UK 1053/2007/A-INF/MFF (2007-8), GA UK 351/2006/A-INF/MFF (2006-8), the Ministry of Education of the Czech Republic (grant MSM0021620838) (2008-9), by the Program "Information Society" under project 1ET100300517 (2006-9), and the project Integration of IT Tools into Education of Humanities (2006-8) and by the project CZ.2.17/3.1.00/31162, which are financed by the European Social Fund, the state budget of the Czech Republic, and by the budget of Municipal House Prague.