Staredit Network > Forums > Modding Assistance > Topic: Eisetley's C++ and iscript questions festival.
Eisetley's C++ and iscript questions festival.
Dec 5 2015, 11:51 am
By: Eisetley  

Jan 29 2016, 7:28 pm UndeadStar Post #21



Instead of "unit->carrier.inHangarCount < 5" it should be "(unit->carrier.inHangarCount + unit->carrier.outHangarCount) < 5
The queue being stuck is perfectly logical without that, even if it's less obvious for a reaver than for a carrier.




Jan 29 2016, 7:38 pm Eisetley Post #22



Nope, the queue still gets stuck, the only difference is that reaver gets an order when the scarab explodes, not when it's fired.



None.

Jan 29 2016, 8:59 pm KYSXD Post #23



I know isn't a fix, but...

Quote
//Auto building scarabs and interceptors
if (unit->id == UnitId::reaver || unit->id == UnitId::warbringer)
{
if ((unit->carrier.inHangarCount + unit->carrier.outHangarCount) < 5)
unit->buildQueue[unit->buildQueueSlot] = UnitId::scarab;
if (unit->buildQueue[unit->buildQueueSlot] != UnitId::None)
unit->setSecondaryOrder(OrderId::TrainFighter);
}

In other things, have you tried with OrderTo?




Jan 30 2016, 10:09 am Eisetley Post #24



Yep, doesn't work.



None.

Jan 30 2016, 12:08 pm Neiv Post #25



Quote from Eisetley
@Neiv
That would require some reverse engineering, right? I'm not really familiar with this.

Well, that one's really simple, just add a functions like this to somewhere they would fit
(Look at the various hook/inject files for example or just place them in one of them)
Code
u32 __stdcall isUnselectable(int unit_id) {
 using namespace UnitId;
 switch (unit_id) {
   case nuclear_missile:
   case scarab:
   case Spell_DarkSwarm:
   case Spell_DisruptionWeb:
   case Special_UpperLevelDoor:
   case Special_RightUpperLevelDoor:
   case Special_PitDoor:
   case Special_RightPitDoor:
     return 1;
   default:
     return 0;
 }
}

u32 __declspec(naked) isUnselectableWrapper() {
 __asm {
   push ecx
   push edx
   movzx eax, ax
   push eax
   call isUnselectable
   pop edx
   pop ecx
   ret
 }
}



And add a hooking call somewhere there as well, so the new code will be run.
Code
 jmpPatch(isUnselectableWrapper, 0x0046ED80);


Post has been edited 3 time(s), last time on Jan 30 2016, 6:04 pm by Neiv.



None.

Jan 30 2016, 4:34 pm Eisetley Post #26



Neiv, it crashes the game when I select any unit (instantly or after a few seconds). Are you sure it's for 1.16.1?
I decided to sacrifice disruption web and give it collision, because that's probably the only way to make forcefields fully functional. This isn't that bad, because spells like scanner sweep or disruption web can be easily recreated using scbw::CreateUnit(). There are two minor issues when it goes to forcefields. Despite their elevation settings in units.dat they are always above other ground units and this looks weird when for example an archon stands near it. The other one is a little delay between you click and order execution. Maybe has something to do with orderTimer.

A few cool things going on here. All units entering Guardian Shield get an overlay, units hit by psistorm get the energy sparks overlay (need to do 3 variants of sparks overlay and randomize it to make it look cooler). Added a little block of code that pushes away units when a forcefield is placed (you can see a zergling get pushed back at about 0:18).



None.

Jan 30 2016, 5:17 pm Neiv Post #27



Oops, my bad. I didn't check if it worked with optimizations enabled and wasn't too familiar with the way GPTP generally does hooks. I edited the code with a version that should work.

Disruption webs have their elevation hardcoded to 11. The code that does that is located at 004F6AF0 but you can also just manually set sprite->elevation if that's easier.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:53 am]
Ultraviolet -- :lol:
[06:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[06:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[06:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[06:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[06:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
[06:48 pm]
Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
[06:47 pm]
Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
[06:45 pm]
NudeRaider -- Vrael
Vrael shouted: I've also recently becoming interested in Carpet Cleaning, but I'd like to find someone with a reputation for unparalleled quality and attention to detail.
beats me, but I'd make sure to pick the epitome of excellence and nothing less.
[06:41 pm]
Vrael -- It seems like I may need Introductions to multiple companies for the Topics that I care deeply about, even as early as Today, 6:03 am.
Please log in to shout.


Members Online: Ultraviolet