midspace / Space-Engineers-Admin-script-mod

Modding script for Space Engineers with dozens of Admin commands for creating game scenarios or supporting servers.
45 stars 13 forks source link

Improve handtool detection for antigrinding #181

Open midspace opened 6 years ago

midspace commented 6 years ago

There were changes put through for API improvements which need to be implemented for handtool checks.

https://forum.keenswh.com/threads/modapi-changes-jan-26.7392280/ Hand tools now have an OwnerID property which gives you the EntityId of the owning character. Also an OwnerIdentityId that tells you which player has the tool. IMyCharacter.EquippedWeapon gives you the EntityId of the equipped tool/weapon.

Also look into IMyCubeBuilder.FindClosestGrid() for cubeplacer improvements

Spcemarine commented 6 years ago

OwnerID for handtools sounds neat.

When I checked the last time (which was very long ago) IMyCubeBuilder.FindClosestGrid() did the same calculations as the method currently used in protection areas, thus it had issues with grids that have wheels.

midspace commented 6 years ago

Wheels, because they aren't owned. Sigh. I suppose there are some alternatives for that now.

I currently have the new code running in my dev mod for testing: http://steamcommunity.com/sharedfiles/filedetails/?id=387257948

midspace commented 6 years ago

I had a request to enhance the PA, to be able to prevent building anything.