midspace / Space-Engineers-Admin-script-mod

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

Owned Protection areas cannot be grinded #172

Closed midspace closed 8 years ago

midspace commented 8 years ago

It appears that you can no longer grind ships in the protection area, even when you own them outright.

midspace commented 8 years ago

It appears that the tool position is always Zero.

https://github.com/midspace/Space-Engineers-Admin-script-mod/blob/master/midspace%20admin%20helper/Data/Scripts/midspace.adminscripts/Protection/HandtoolCache.cs#L104

I'm going to look at changing the IEntity to IMyEngineerToolBase and see if we can leverage something new from the interface in terms of position or ownership.

Spcemarine commented 8 years ago

:weary: Such a pity that the API still lacks so much :/ For the record, Digi's hint on discord: getting the char's objectbuilder and comparing HandWeapon's entity id seems to be the only good way right now

midspace commented 8 years ago

The object builder is something we really want to avoid in this circumstance, especially if it's the player's object. That can loaded with a lot of information, so it takes a while to construct.

midspace commented 8 years ago

It looks like the weapon position is handled entirely by the MyCharacterWeaponPositionComponent now, which is why it has changed, and why our code is now broken. But this component is only referenced by the MyCharacter via MyCharacter.WeaponPosition.