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.
[12:16 am]
Symmetry -- :wob:
[04:16 pm]
IskatuMesk -- :wob:
[2026-6-12. : 4:47 am]
lil-Inferno -- rive
[2026-6-12. : 3:48 am]
RIVE -- inferno
[2026-6-12. : 3:18 am]
lil-Inferno -- moose
[2026-6-11. : 8:35 pm]
Moose -- lil-Inferno
lil-Inferno shouted: sadjfjkasdhfijsadhmfcjhsdajkvfmjadslkfhjsdkahf
mad
[2026-6-11. : 3:11 pm]
lil-Inferno -- h
[2026-6-09. : 5:01 pm]
NudeRaider -- Vrael
Vrael shouted: because you perfectly guessed SEN's root password and we cant have that displayed all over the shoutbox
given Moose's post I don't think he had to guess. ^^
[2026-6-09. : 4:53 pm]
NudeRaider -- lil-Inferno
lil-Inferno shouted: Nude why'd you delete my shout
why not? :awesome:
[2026-6-09. : 4:26 pm]
Vrael -- because you perfectly guessed SEN's root password and we cant have that displayed all over the shoutbox
Please log in to shout.


Members Online: jun3hong