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.
[02:45 am]
Ultraviolet -- unless you're a euro weirdo
[02:45 am]
Ultraviolet -- "[08:55 pm] dumbducky -- real dad hours who up" better question, who's already down at 8:55pm?
[12:55 am]
dumbducky -- real dad hours who up
[07:17 pm]
NudeRaider -- why not both?
[07:09 pm]
Zoan -- sc1 or sc2
[02:06 pm]
lil-Inferno -- hi im new to this site how do i make maps
[09:06 am]
Zycorax -- :wob:
[2026-6-14. : 11:31 pm]
Ultraviolet -- :wob:
[2026-6-13. : 3:10 pm]
lil-Inferno -- :wob:
[2026-6-13. : 10:46 am]
UndeadStar -- :wob:
Please log in to shout.


Members Online: Roy, l)ark_ssj9kevin