Staredit Network > Forums > Modding Assistance > Topic: Siege Mode ability for 3+ unit types
Siege Mode ability for 3+ unit types
Jul 17 2020, 10:18 am
By: Netbek  

Jul 17 2020, 10:18 am Netbek Post #1



In my mod I want ~5 unit types to be able to switch between using a sword and a bow. The weapon switching should be an ability, similar to "bearform" in WC3.

Siege Mode-based abilities seem like the best option here. But how can I add more than the default 2? (=normal tank+duke)
Firegraft only let's me edit 2 fields: screenshot
I just downloaded the "general-plugin-template-project-master", but in it, I only found the files for editing zerg morph abilites so far. I don't want to use morph, because it has a progress bar that seems unavoidable.




Jul 17 2020, 1:27 pm Voyager7456 Post #2

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

What I ended up doing in my mod was faking it using the replaceUnitWithType function and some iscripting tricks:

Code
void doAPCSiegeBehavior(CUnit* unit) {
    if(unit->mainOrderId == OrderId::CarrierStop) {
                    unit->sprite->playIscriptAnim(IscriptAnimation::LiftOff, true);
                }
                if(unit->sprite->mainGraphic->animation == IscriptAnimation::LiftOff) {
                    if(unit->sprite->mainGraphic->frameIndex == 0) {
                        s32 oldShields = unit->shields;
                        replaceUnitWithType(unit, UnitId::apc_mobile);
                        unit->orderToIdle();
                        unit->shields = oldShields;
                    }
                }
                else if(unit->orderSignal & 0x04)
                {
                    unit->orderSignal = 0;                
                }
}


Code
void doAPCMobileBehavior(CUnit* unit) {
    if(unit->mainOrderId == OrderId::CarrierStop) {
        s32 oldShields = unit->shields;
        replaceUnitWithType(unit, UnitId::apc_sieged);
        unit->orderToIdle();
        unit->shields = oldShields;
       
    }
}


Code
APCSiegedInit:
    imgul               255 0 0     # PsiDisruptorShad (neutral\tpdShad.grp)
    playsnd             319     # Terran\TANK\TTaTra01.WAV
    playfram           0
    wait               5
    playfram           1
    wait               5
    playfram           2
    wait               5
    playfram           3
    wait               5
    playfram           4
    wait               5
    playfram           5
    sigorder         4
   
APCSiegedBuilt:
    wait             1    
    goto               APCSiegedIsWorking
   
APCSiegedLiftOff:
    playsnd             319     # Terran\TANK\TTaTra01.WAV
    playfram           4
    wait               5
    playfram           3
    wait               5
    playfram           2
    wait               5
    playfram           1
    wait               5
    playfram           0
    wait               5
    goto             APCSiegedIsWorking




EDIT: If you're just looking to switch weapons without an animation, then replaceUnitWithType() by itself should be good enough.

Code
    if(unit->mainOrderId == OrderId::CarrierStop) {
        s32 oldShields = unit->shields;
        replaceUnitWithType(unit, UnitId::apc_mobile);
        unit->orderToIdle();
        unit->shields = oldShields;
}


Post has been edited 1 time(s), last time on Jul 17 2020, 1:35 pm by Voyager7456.



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]


Jul 19 2020, 4:05 pm Netbek Post #3



How do I compile a plugin? So far I've only worked with PythonModdingSuite + Firegraft.
I've got all these .cpp files in "general-plugin-template-project-master"... but how do I make them into a .qdp that can be integrated via Firegraft like this?

Post has been edited 5 time(s), last time on Jul 19 2020, 5:02 pm by Netbek.




Jul 19 2020, 10:19 pm Lagi Post #4



go to /debug/patch/ there you should find some .gdp file

my start:
http://www.staredit.net/topic/17683/



None.

Jul 30 2020, 6:41 pm Netbek Post #5



I have zero experience with C++ and compiling/decomiling plugins. I know other languages, so C++ is not the main problem, but the compiling.
My questions:
1) I need sth like Visual Studio in order to compile plugins, correct?
2) When compiling stuff from "general-plugin-template-project-master", what exactly do I need to compile? All? Just files I changed/added? Just the GPTP-Folder?
3) I need to compile to .gdp, correct?
4) Is there a good tutorial for plugin creation?

Quote from Lagi
go to /debug/patch/ [...]
there is no such directory in the "general-plugin-template-project-master".




Jul 31 2020, 6:31 pm UndeadStar Post #6



Even if you're using a very old version, there should be .sln or .vcproj or .vcxproj files, that you open with Visual C++ 2010, Visual Studio 2008 (for another version), or just a more recent version of Visual Studio (some changes may be needed to make old versions projects work).
If all goes well, you should be able to compile immediately after opening the project, thus creating the debug/patch folder.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:36 am]
O)FaRTy1billion[MM] -- u
[04:26 am]
RexyRex -- me
[04:47 pm]
NudeRaider -- F1 2018 currently for free: https://www.humblebundle.com/store/f1-2018-free-game
[10:55 am]
NudeRaider -- the :wob: ? I'm in! :wob:
[08:29 am]
UndeadStar -- Tried magic boxes again, lost :thumbdown: , so back to where I was before trying. Only thing left to do, the ˸wob˸ :wob:
[2020-8-07. : 5:38 pm]
MTiger156 -- :wob: wob n' bob :wob:
[2020-8-07. : 12:43 am]
Wing Zero -- u
[2020-8-06. : 10:34 pm]
RIVE -- :wob:
[2020-8-06. : 9:42 pm]
lil-Inferno -- :wob:
Please log in to shout.


Members Online: bamper459584, Roy, NudeRaider