Jump to content

[Question] Change Player's target and reload scripts


shulrak

Recommended Posts

Hello,

 

I am looking for a way to change the player's current target to an Entity. Like when pressing tab or the middle button.

Couldn' t find anything in the code nor in the documentation. (was mostly searching for the "target"  keyword)

 

EDIT : Also, is there a way to reload a script without quitting the game and rejoining it ?

 

Thanks

Link to comment
Share on other sites

I didn't find anything for targeting but you can order AI ships to target other Entity: ShipAI():setAttack(Entity), but I'm pretty sure it is not what you were looking for.

 

As of reloading scripts. Again, nothing that really reloads your script, but let you load certain script from file each time you want to use it: loadfile(filepath). Note that root directory of Avorion is also root directory of lua instance, so you will need to use data/scripts/ as prefix most of the time in filepath. This will load that certain ship each time you will want to execute it. It returns function. Body of this function is file content.

Link to comment
Share on other sites

Thanks for the reply.

 

Yeah I was looking for making a sector overview with the list of entity near you and when you click on one of them it will target it.

So the Entity: ShipAI():setAttack(Entity) doesn' t work unfortunately.

 

Can you maybe create the thread and ask to be pinned ? :)

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
×
×
  • Create New...