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.
[01:36 am]
Moose -- Thinking on it more, I vaguely remember it being annoying because it kept repeating some short loop of the Super Mario World theme LMAO
[12:57 am]
Oh_Man -- I thought i remembered an old mario map but i searched super mario starcraft on utube and i couldnt see anything cept UMS
[11:40 pm]
lil-Inferno -- Blizzard forgot about SC so it's okay
[07:04 pm]
Symmetry -- malware maps for everyone
[07:03 pm]
Moose -- probs lmao
[06:57 pm]
Symmetry -- (and will be patched)
[06:56 pm]
Symmetry -- The old stuff would've gotten patched no? this is current
[06:55 pm]
Moose -- Just made? I thought we had that years ago
[05:23 pm]
Oh_Man -- so someone just made super mario in brood war https://www.youtube.com/watch?v=DmrUcKU65oQ
[2026-8-06. : 2:41 am]
Oh_Man -- i used to play TF2 competitive in that clan, and also was PR manager (ie: i wrote all the website posts)
Please log in to shout.


Members Online: DarkenedFantasies