Staredit Network > Forums > Modding Assistance > Topic: Making right-click issue a rally point order
Making right-click issue a rally point order
Apr 18 2017, 2:57 am
By: Pr0nogo  

Apr 18 2017, 2:57 am Pr0nogo Post #1



In my current project, a structure (Cerebrate Daggoth) has been modified to be able to produce units. Thanks to EXE edits, I've gotten everything working, except issuing a right-click order doesn't do anything. Ideally, it would function like any other production structure, and update the rally point on right-click instead of the player having to press 'r' or click on the ability in order to accomplish this. I have messed with EXE edits regarding rally points but to no avail.

Hopefully solving this answers a second question: is there anything that would stop rally point functionality from being given to zerg eggs and cocoons? I would like them to overwrite hatchery/lair/hive rally points (which should be no different than 'updating' the rally point), so players are able to rally onto resources for their drones and manually rally their military units to a different area of the map.




Apr 19 2017, 1:42 am Corbo Post #2

ALL PRAISE YOUR SUPREME LORD CORBO

It is my understanding that the rally order is pretty hardcoded. Have you done this before for another building/unit?

Couple of things in my mind. Check "is building" flag, give it a rally order button, check "can create units/is factory" dat requirements... unsure.



fuck you all

Apr 19 2017, 1:54 am Pr0nogo Post #3



Yes, all of that is done. Rally point functions properly, but right-clicking doesn't issue it.




Apr 19 2017, 3:09 am KYSXD Post #4



Quote from Pr0nogo
Thanks to EXE edits, I've gotten everything working, except issuing a right-click order doesn't do anything

I think this can be done with the Rally Point Exe Edit enabled. ('Allow All Buildings to Rally' and 'Use units.dat group flags for factories'). Also set the 'Factory' flag for that building in units.dat Group Flags.

If that doesn't work, disable all plugins to check if that requires other mofications than the Exe Edits (If that's the case, I could take a look in GPTP to help you with that if you want).

Quote from Pr0nogo
is there anything that would stop rally point functionality from being given to zerg eggs and cocoons?

The only fix I can think to that is to modify the orderNewUnitToRally() call in the GPTP's unit_morph hook (unit_morph.cpp) if the unit is an egg/cocoon (line 94).

Code
    if(
        unit->previousUnitType != UnitId::ZergCocoon &&
        unit->previousUnitType != UnitId::ZergLurkerEgg
    )
    {

        CUnit *rallyTarget; //Unit wich selects the rally destination

        // Check if the unit has rally point different than itself
        bool hasRally = (unit->rally.pt.x != unit->getX());

        // If the unit has a valid rally point, use it
        if((unit->rally.unit && unit->rally.unit != unit)
            || hasRally)
        {
            rallyTarget = unit;
        }
        else
        {
            rallyTarget = unit->connectedUnit;
        }

        // Normal behaviour-ish
        orderNewUnitToRally(unit, rallyTarget);
        if(unit2 != NULL)
        {
            orderNewUnitToRally(unit2, rallyTarget);
        }
    }


Maybe that could do the job. The only problem with this approach is that sometimes the zerg egg sets the connectedUnit (Lair, Hive, Hatchery) as the rally target when created. That's a weird behaviour from the original engine.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:41 am]
ManCubuS -- Seems like something's broken regarding the site then. Sadge...
[07:36 am]
Oh_Man -- have i ever told u guys my SC2 pro-gamer story
[11:30 pm]
Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
[2026-7-26. : 3:34 pm]
ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
[2026-7-26. : 3:28 pm]
ManCubuS -- Even tried with imgur, doesn't attach.
[2026-7-26. : 3:14 pm]
ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
[2026-7-26. : 3:05 pm]
NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
[2026-7-26. : 11:15 am]
ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
[2026-7-23. : 6:40 am]
Oh_Man -- true
[2026-7-23. : 3:16 am]
RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
Please log in to shout.


Members Online: Symmetry