Rinart73 Posted September 3, 2019 Share Posted September 3, 2019 Avorion: 0.26 1. Pirate ship is attacking me 2. I'm using "ShipAI(pirateShip):registerFriendEntity(myShipId)" 3. As a result, entity targeter is now green and "ShipAI(pirateShip):isEnemy(myShipId)" returns false. But pirate is still attacking me. Link to comment Share on other sites More sharing options...
Boxelware Team koonschi Posted September 3, 2019 Boxelware Team Share Posted September 3, 2019 Is he still attacking you even after setting its AI to Idle and then back to Aggressive? Link to comment Share on other sites More sharing options...
Rinart73 Posted September 3, 2019 Author Share Posted September 3, 2019 No, it stops. The problem is that when it comes to ShipAI commands like these setAggressive(var attackCivilShips, var canFinish) setFly(vec3 location, float arrivalRadius, var collisionException) and others, I can't just easilly reset them via "setIdle - setBackToOriginal", because I don't have a way to get their arguments. I don't know if certain ship was set to attack civil ships or not, which coordinates it's flying to etc. Link to comment Share on other sites More sharing options...
Boxelware Team koonschi Posted September 3, 2019 Boxelware Team Share Posted September 3, 2019 The "attack" order is a very simply-structured order that will attack the target until destroyed, and it's meant to be able to attack allies (for example if you order a ship via the strategy mode to attack an ally for some reason). If you want the attack order to stop attacking a ship because it was set to friendly, you have to stop/cancel the command by setting a new one (which is what happens internally as well). It won't stop by itself. Link to comment Share on other sites More sharing options...
Rinart73 Posted September 3, 2019 Author Share Posted September 3, 2019 Yeah I got it. I'm just trying to prevent AI ships from attacking invincible entities. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now