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.
[07:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
Please log in to shout.


Members Online: Ultraviolet, Roy