Staredit Network > Forums > Modding Assistance > Topic: Creating a summon ability
Creating a summon ability
Aug 2 2021, 5:36 pm
By: Netbek  

Aug 2 2021, 5:36 pm Netbek Post #1



I want to create a summon ability. Like this:
1) costs energy
2) unit plays animation
3) at certain point in animation, summoned unit appears

What is a good dummy ability to base this on? I experimented with burrow, but ran into issues.
Step 3) is NOT the issue, I know how to do this with GPTP.




Aug 2 2021, 7:56 pm Voyager7456 Post #2

Responsible for my own happiness? I can't even be responsible for my own breakfast

Rather than basing it on an ability at all, I'd recommend using the "Carrier Stop" or "Reaver Stop" orders. These are pretty useful for actions where you just want the player to press a button and have something happen.

Here's a skeleton of what that might look like:

Code
if(unit->mainOrderId == OrderId::CarrierStop) {
        unit->orderToIdle();
        if(unit->energy < 25600) {
            scbw::showErrorMessageWithSfx(unit->playerId, 864, 158);
        }
        else {
            //do stuff here
        }
    }


You will need to make sure that you edit the requirements for the Carrier Stop order so that your unit can use it.

As far as playing an animation goes, you can use unit->sprite->playIscriptAnim() to do that, and the sigorder iscript opcode to communicate back to GPTP. So perhaps our code might look something like this:

Code
if(unit->mainOrderId == OrderId::CarrierStop) {
        unit->orderToIdle();
        if(unit->energy < 25600) {
            scbw::showErrorMessageWithSfx(unit->playerId, 864, 158);
        }
        else {
            unit->sprite->playIscriptAnim(IscriptAnim::CastSpell, true);
        }
    }
else if (unit->orderSignal == 16) {
       //summon the unit here
    }


And our iscript something along these lines:

Code
    playfram               0x11     # Frame set 12
    wait                   1
    playfram               0x22     # Frame set 2
    sigorder                16
    wait                    1
    playfram                0x33
       wait                    1


to ensure that we summon the unit at the appropriate point in the animation.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:27 am]
m.0.n.3.y -- Maybe because it's an EUD map?
[03:27 am]
m.0.n.3.y -- Can't upload maps to the DB. Error says "The action you have performed caused an Error". Any word?
[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
Please log in to shout.


Members Online: Roy