Staredit Network > Forums > Modding Discussion > Topic: [idea/wish] Battlecruiser crash instead getting destroyed
[idea/wish] Battlecruiser crash instead getting destroyed
Nov 18 2018, 5:31 pm
By: Lagi  

Nov 18 2018, 5:31 pm Lagi Post #1





From campaign, the infestation of Command Center by Queen, have slip through into the melee games. Its very rare gambit to do, but it add a very nice flavor to the game (and ignites thoughts: "what if queen can infest also Barracks? or Protoss structure? what if there can be more infected units trained or hybrid?").

===============

Similar to above gimmick, could be idea (also borrow from campaign) of Battlecruiser, which when destroyed (= 0 HP) above ground (land-able terrain), is transform into ground structure "crashed battlecruiser" with 30% of health.

If "crashed battlecruiser" is repair to 100%, he become again a flying Battlecruiser unit.

===============

it dont fit for Protoss [nor Zerg]. Even if Carrier crashed like this, Protoss could not repair it.



None.

Dec 1 2018, 10:45 pm Voyager7456 Post #2

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

game_hooks.cpp
namespace hooks {
const u32 Func_ReplaceUnitWithType = 0x0049FED0;
void replaceUnitWithType(CUnit* unit, u16 newUnitId) {
    u32 newUnitId_ = newUnitId;
 __asm {
   PUSHAD
   PUSH newUnitId_
   MOV EAX, unit
   CALL Func_ReplaceUnitWithType
   POPAD
 }

};

...

for (CUnit *unit = *firstVisibleUnit; unit; unit = unit->link.next) {
if(unit->id == UnitId::scv && unit->mainOrderId == OrderId::Repair1) {
                CUnit* orderTarget = unit->orderTarget.unit;
                if(orderTarget && orderTarget->id == UnitId::Special_CrashedNoradII &&
                    ((orderTarget->hitPoints + 255) / 256) == orderTarget->getMaxHpInGame()) {
                        replaceUnitWithType(orderTarget, UnitId::battlecruiser);
                }
            }
...
}


Also made some changes in die_order, too much to quote properly, so I've attached my file below.

Attachments:
die_order.cpp
Hits: 3 Size: 7.2kb



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]


Dec 2 2018, 2:52 pm Lagi Post #3



:w00t:

that was the least thing I expected, you're the best.

edit::
so conversion double into s32 with hp - but its compiler bitching

1>die_order.obj : error LNK2005: "struct CUnit * __cdecl CreateUnit(unsigned int,int,int,unsigned int)" (?CreateUnit@@YAPAUCUnit@@IHHI@Z) already defined in use_tech.obj


maybe i do something wrong

edit:
i rename CreateUnit => CreateUnitB , compile succesfuly.



edit2:
sometimes the BC dont want to fly back after crash. Maybe the damages were to severe to be fix during field repairs?



edit3:
nah... SCV just make bungling again. I damage bc again, and repair back :lol:



Post has been edited 4 time(s), last time on Dec 2 2018, 6:31 pm by Lagi.



None.

Dec 2 2018, 6:48 pm KYSXD Post #4



Quote from Lagi
:w00t:

edit2:
sometimes the BC dont want to fly back after crash. Maybe the damages were to severe to be fix during field repairs?


The bug may be a desync between the repair order and the frame when the unit actually reaches full health.

Another approach could be replacing the unit when the CBC reaches full health rather than checking for SCV's target.




Dec 2 2018, 6:52 pm Voyager7456 Post #5

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

Quote from KYSXD
Quote from Lagi
:w00t:

edit2:
sometimes the BC dont want to fly back after crash. Maybe the damages were to severe to be fix during field repairs?


The bug may be a desync between the repair order and the frame when the unit actually reaches full health.

Another approach could be replacing the unit when the CBC reaches full health rather than checking for SCV's target.

Yeah, this seems to be the case. Assuming you don't have any need for full health crashed BCs anywhere else, just take this approach - it's much simpler. :P



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]


Dec 2 2018, 9:54 pm Lagi Post #6



Code
if(unit->id == UnitId::Special_CrashedNoradII && unit->hitPoints == unit->getMaxHpInGame()) {
                       replaceUnitWithType(unit, UnitId::battlecruiser);
               }


strange thing
with voyager code the repair take much more time (its very slow)

using above, the repair is as fast as with normal repairing building (very fast)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06: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?
[2024-4-20. : 7:56 pm]
Oh_Man -- lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
Please log in to shout.


Members Online: Roy