Blockland Forums > Modification Help

Autoturret on vehicle

Pages: << < (3/5) > >>

Treynolds416:

Well then how did Space get his to work?

Greek2me:


--- Quote from: Space Guy on March 09, 2011, 03:33:02 PM ---They'll aim at weird offsets if the vehicle points anywhere but north.

--- End quote ---
Couldn't you offset the aim then to counteract the offset mentioned above?

lordician:


--- Quote from: Treynolds416 on March 12, 2011, 07:56:07 AM ---Well then how did Space get his to work?

--- End quote ---
Well i have to ask Space Guy for permission to post what he sended me as information when i asked about it...

--- Quote from: Greek2me on March 12, 2011, 08:29:10 PM ---Couldn't you offset the aim then to counteract the offset mentioned above?

--- End quote ---
That is an idea but...

--- Quote from: Destiny/Zack0Wack0 on March 12, 2011, 01:01:58 AM ---But I'm going to guess the offset is random and something is broken :S

--- End quote ---
Most likely.

phflack:

i'm thinking that the aiming command for the bots is offset by the rotation of the vehicle
if that is true... then why not find the rotation of the vehicle and mix it with the aiming?
i'm probably so wrong :D

Space Guy:

For reference for everybody else:

--- Quote from: Space Guy on March 09, 2011, 01:16:23 PM ---Basically, the default "setMoveDestination" and "setAimLocation" do not work when in a vehicle. To make a bot look in the right directions, you have to create an AIConnection object and have it control the bot - this is a fake client which you can set instructions like "turn right" instead of "look at this point". Unfortunately to control this right you need to update it on a tick/schedule very quickly, and do trigonometry to find angles and such.

The problem with them driving is that you cannot get the current wheel direction of the vehicle. This means you cannot tell the difference between the wheels facing straight forwards and the wheels off to the side - trying to steer left and right depending on the main vehicle's rotation causes it to swing wildly.

My last implementation caused lag when more than 10-15 bots existed at a time, but that'd be fixable by making it only use the special aiming when in a vehicle, otherwise using the automatic functions/not having the AIConnection control it.

--- End quote ---


Pages: << < (3/5) > >>

Go to full version