Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

[Solved] Weird issue with destroying blocks on AI ships


NoFoodAfterMidnight
 Share

Recommended Posts

I made a script that destroys blocks when hit, but sometimes when an AI ship loses a block ALL it's turrets are destroyed.

 

I'm using:

 

onBlockDamaged(objectIndex, blockIndex, inflictorId, damage, damageType)

Plan():destroy(blockIndex)

 

blockindex returns an obj ID, it's not the BlockIndex, so it's not that

 

no that's not the whole script the whole thing is long, but i've isolated it to the destruction of the block and nothing else changes the issue.

 

Everything works correctly, but for some reason, sometimes, when an AI ship first loses a block from this script ALL of it's turrets are destroyed. I'm not really sure what causes it, it's really bizarre. It's linked to the specific ship and not the blocks being destroyed, it either happens immediately when a ship first loses a block or never. It seems to occur more often on larger ships. It never happens on player owned ships. Adding more turrets to the AI ship just makes those turrets be destroyed immediately when the next block is destroyed. I haven't been able to find a single thing that differs between ships that this happens to and ships it doesn't happen to.

 

Anyone have any clue why this might be happening? Is it just some issue with the hardcoded parts of the game?

 

Solved: AI ships are sometimes generated with turrets that are a higher level material than the blocks they're on, and when the ship's plan changes, I guess it checks the turret's compatibility with the blocks they're on and just destroys them.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...