There are currently 56 players online.
 
Warsow


 
 

backBots via gametype and angle/velocity question

Forum index
Modifications / Coding
Bots via gametype and angle/velocity question
Posted by
Post Scroll to bottom
DrahtMaul
Member
(107 posts)

Hey guys,

I've some questions.
First the (I guess) easy one:
I have a cVec3 with an angle, and I want my entity to fly a certain speed into this angle.
How can I convert the anglevector into an velocityvector?

And my other question:
Is there a possibility to spawn bots on a map even if there's no navigationfile for a map?
I simply want my bot to walk over some points I give them via addAIGoal() and I think that should work alot better if there's no confusing nav-file.

jal

master of the universe
(10599 posts)

cVec3::angleVectors makes the conversion. The result you want is in the "forward" vector. It's a unit vector, so you then just multiply it by the speed you want to create a velocity vector.

The nagivation file is needed. The bot can't walk to the goals you create if there are no nodes, because it can't find the path to them. The navigation file doesn't include the map items, those are linked on map load just like the goals you add. If you want to make the bot ignore items (or whatever) just assign them 0 weight at updating the bot status.

DrahtMaul
Member
(107 posts)

Thank you for your help with my bot problem.

Do you mean something like this?
           cVec3 dir;
newAngles.angleVectors(dir, null, null);
dir *= 400;
this.ent.setVelocity(dir);

I am not completly sure if this is working, there has to be another error in my angel calculation... But this part is correct?

jal

master of the universe
(10599 posts)


Scroll to top



RSSRSSRSSRSS

Copyright © 2013 Chasseur De Bots

Warsow in social media



Warsow is an indie game developed by group of hobbyists. Please consider giving us a small donation: