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:
bool CanTargetSelf(CUnit* unit, u8 orderId) {

    bool return_value;

    /////// OWN // -------
    if (orderId == OrderId::Restoration)
        return_value = true;
    /////// OWN Ende -------
        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.

Hits: 0 Size: 9.83kb
Hits: 0 Size: 2.47kb

  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:59 pm]
Ultraviolet -- Ya I heard that watching the vid, too. Was considering submitting Impossible Ultraviolet, but it's only technically playable with one person.. in practice playing with one person would be terrible
[05:52 pm]
MTiger156 -- Oh, the full rules for submissions only appear in the Discord server. "Single Player Only" is a big oof since I'm only good at multiplayer concepts. However I will inquire about trying a multiplayer PvE concept that can be fully played and won alone.
[10:34 am]
C(a)HeK -- greetings all, test #7 is complete :)
[08:10 am]
Ultraviolet -- you all talk Tiger :P
[03:33 am]
MTiger156 -- Holy shit, this "Maporino! 2021" event that just got announced... this is something that takes place every year? Damn I wish I knew about it sooner, this can be my huge breakthrough in motivation :0_0:
[2021-2-26. : 7:23 am]
C(a)HeK -- thank you!
[2021-2-26. : 5:14 am]
C(a)HeK -- hello all, test 6 is complete - :)
[2021-2-26. : 3:09 am]
RdeRenato -- yes
[2021-2-25. : 2:55 pm]
MTiger156 -- General Kenobi
[2021-2-25. : 2:54 pm]
Voyager7456 -- hello there
Please log in to shout.

Members Online: jjf28, Roy, Nekron