Jump to content

Problem with a mod attempting to modify pathingpawn snapping


kdm2k6

Recommended Posts

I am currently attempting to create a small mod which moves the gamepad cursor (XComPathingPawn I believe) around smoothly (rather than in a semi-snapping fashion which it currently does) - this was the original behaviour in Xcom EU and in Xcom EW until, I believe, the second patch.


Since I was having a bit of a problem - I decided I would first try to modify the mouse cursor instead to make it move around smoothly, rather than snapping to the grid.


I managed to accomplish this rather easily in XCom EU by turning:

if(GetAdjustedMousePickPoint(kPickPoint, GetActiveUnit().m_bIsFlying, true)) into if(GetAdjustedMousePickPoint(kPickPoint, GetActiveUnit().m_bIsFlying, false)) within XComTacticalInput.ActiveUnit_Moving.Mouse_CheckForPathing


For EW I created an almost identical mod to the one for EU:


UPK_FILE=XComGame.upk

OBJECT=XComTacticalInput.ActiveUnit_Moving.Mouse_CheckForPathing

[FIND_HEX]

//if(GetAdjustedMousePickPoint(kPickPoint, GetActiveUnit().m_bIsFlying, true))

07 8C 02 1B 5C 37 00 00 00 00 00 00 00 EB 82 00 00 19 1B 4D 37 00 00 00 00 00 00 16 0A 00 44 3A 00 00 00 2D 01 44 3A 00 00 27 16

[MODDED_HEX]

//if(GetAdjustedMousePickPoint(kPickPoint, GetActiveUnit().m_bIsFlying, false))

07 8C 02 1B 5C 37 00 00 00 00 00 00 00 EB 82 00 00 19 1B 4D 37 00 00 00 00 00 00 16 0A 00 44 3A 00 00 00 2D 01 44 3A 00 00 28 16


This makes it so the mouse cursor doesn't snap to the grid; however, it acts in a rather strange fashion whereby it won't update unless you move the cursor outside the tile in which it currently resides - so it still has kind of a strange snapping/jerking feeling.


I noticed within XComTacticalInput.uc there were some new EW functions: one such function is isCursorChanged, which looks like it may be of interest (and, perhaps, keeps the XComPathingPawn from being updating unless the cursor moved outside of the current tile). However, I couldn't find a call to this function (isCursorChanged) anywhere. Could this function be called from within native functions (is there any way to look into native functions? I'm assuming there isn't) or do you think it is a function which they added in, but simply never used?


Another interesting variable is bPathDirty within XComPathingPawn, which I would guess, tells the system: the path is dirty - please update me and show these changes. However, once again, I can only find one mention of it being set, and it is never set to false (which doesn't make sense - since these types of flags, you would assume, are constantly set false then true then false ... etc.).


If anyone has any ideas as to where the movement path marker is updated, I would be greatly appreciative.

Thanks

Link to comment
Share on other sites

This is the correct forum for such a question, but it has very little activity from the fellow "code divers" who might be able to assist you. The vast majority of them moved on to XCOM2 years ago. (I never saw anyone else look into the mouse movement code in the heydays of EU, EW, and LW.) If no one else replies, you might want to ask there or in the "Long War" forum.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...