Staredit Network > Forums > Modding Assistance > Topic: Let Restoration self-target
Let Restoration self-target
Oct 8 2020, 10:20 am
By: Netbek  

Oct 8 2020, 10:20 am Netbek Post #1



I know it's possilbe to make ALL orders able to self-target via Firegraft's Exe Edits. But that solution also allows self-targeting Yamato Gun etc. I just want self-targeting for the Restoration spell. Is it possible, through coding in GPTP maybe?




Oct 8 2020, 12:47 pm UndeadStar Post #2



Maybe in hooks/recv_commands/receive_command.cpp ?
There's a CanTargetSelf, maybe skipping it (making it as if it returned true) if the mainOrderId is Restoration would be enough?




Oct 8 2020, 3:42 pm Netbek Post #3



Excellent, it now works: Restoration can self-target, but Yamato etc. can't! Thank you very much!
Here's the modified beginning of the CanTargetSelf function in receive_command.cpp:
Code
bool CanTargetSelf(CUnit* unit, u8 orderId) {

    bool return_value;

    /////// OWN // -------
    if (orderId == OrderId::Restoration)
        return_value = true;
    else
    /////// OWN Ende -------
    if(
        unit->status & UnitStatus::GroundedBuilding &&
      [...]

^^Additional note for future beginner searchers: I had to use orderID instead of MainOrderID

I also attached the modified receive_command.cpp (& modified game_hooks.cpp that makes Restoration heal hp) for future visitors.

Attachments:
receive_command.cpp
Hits: 0 Size: 9.83kb
game_hooks.cpp
Hits: 0 Size: 2.47kb




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[08:46 pm]
RIVE -- :wob:
[09:13 am]
NudeRaider -- :wob:
[2024-6-21. : 3:59 am]
Ultraviolet -- :wob:
[2024-6-19. : 6:26 pm]
Ultraviolet -- :wob:
[2024-6-18. : 8:38 am]
Zycorax -- :wob:
[2024-6-18. : 3:14 am]
O)FaRTy1billion[MM] -- :wob:
[2024-6-15. : 11:09 pm]
Ultraviolet -- :wob:
[2024-6-12. : 6:23 am]
Ultraviolet -- got some light recalls behind too
[2024-6-12. : 12:07 am]
O)FaRTy1billion[MM] -- 🦗
[2024-6-11. : 9:53 pm]
Wing Zero -- I wonder how he knew I was in the market for a good cricket bat
Please log in to shout.


Members Online: Wing Zero