Skip to content

Conversation

CrosRoad95
Copy link

@CrosRoad95 CrosRoad95 commented Sep 16, 2018

Event: onClientWaterCannonHit
Arguments: x, y, z, normalx, normaly, normalz, materialid

Pr including hack, that allow to hit water cannon to hit water cannon custom objects created by createObject function.

image

Test resource: testv2.zip

Test https://www.youtube.com/watch?v=jPCnYIqQJoY&feature=youtu.be

and 4 reasons for marge
Fire cannon https://www.youtube.com/watch?v=um7A9IThtDU&feature=youtu.be
Grenade cannon https://www.youtube.com/watch?v=f2M-180uMZk&feature=youtu.be
Teleport cannon https://www.youtube.com/watch?v=0AmnWL5RsYY&feature=youtu.be
Paint cannon https://www.youtube.com/watch?v=u5eaHl_SGZQ&feature=youtu.be

Thanks for Saml1er and Botder for helping with hook.

Arguments.PushNumber(pColPoint.Normal.fY);
Arguments.PushNumber(pColPoint.Normal.fZ);
Arguments.PushNumber(pColPoint.ucSurfaceTypeB);
/*if (&pEntity != nullptr) // seems to not work
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comment block.

@@ -6866,3 +6874,24 @@ void CClientGame::RemoveAnimationAssociationFromMap(CAnimBlendAssociationSAInter
{
m_mapOfCustomAnimationAssociations.erase(pAnimAssociation);
}

void CClientGame::WaterCannonHitWorldHandler(CColPointSAInterface& pColPoint, CEntitySAInterface& pEntity)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the use of CEntitySAInterface& pEntity? you don't seem to access it.

settings.sScanSizeY = 0x50;
settings.usRenderSizeX = 0x50;
settings.usRenderSizeY = 0x55;
se
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you have two asm blocks? you can simply put this code after popad in first asm block.

@botder botder assigned ghost Sep 16, 2018
@botder botder added the enhancement New feature or request label Sep 16, 2018
@CrosRoad95
Copy link
Author

fixed along Saml1er tips.
Removed conflicts
new test resource
and video with visualization how this working https://www.youtube.com/watch?v=jPCnYIqQJoY&feature=youtu.be

I think is ready to marge

@gatno
Copy link

gatno commented Sep 24, 2018

Great work!

@@ -300,6 +300,9 @@ DWORD dwFUNC_CAEVehicleAudioEntity__ProcessAIProp = FUNC_CAEVehicleAudioEntity__
#define HOOKPOS_CTaskSimpleSwim_ProcessSwimmingResistance 0x68A4EF
DWORD RETURN_CTaskSimpleSwim_ProcessSwimmingResistance = 0x68A50E;

#define HOOKPOS_WatterCannonHitWorld 0x72932A
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watter should be Water

@botder botder self-assigned this Sep 27, 2018
@botder
Copy link
Member

botder commented Sep 30, 2018

Last commit renames event to onClientElementHitByWaterCannon with the following parameters:

  • vehicle The vehicle with the mounted water cannon
  • hitX, hitY, hitZ World-space hit position
  • normalX, normalY, normalZ Surface normal
  • model Model of the hit surface
  • materialID Hit surface id

The source element is either the hit element or the root element for static world objects (you use model to identify it)

@botder botder merged commit cee63da into multitheftauto:master Sep 30, 2018
@botder botder added this to the 1.5.7 milestone Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants