• 0

    posted a message on Get position of unit and check if unit is next to unit?

    I want to have a unit with 4 actors attached to it. The actors should be created depending on the units around that host unit. It must check every side and corner: Top-Left, Left, Bottom-Left, Bottom, Bottom-Right, Right, Top-Right, and Top to determine the correct actor.

    pseudo code

    If (UnitX is TopLeft of UnitY) then {
    attached Actor TopLeft for UnitY.
    } else If (UnitX is Left of UnitY) then {
    attached Actor Left for UnitY.
    } 
    etc...
    

    Or if you compare the positions of each unit:

    UnitYPos = Position of Unit(UnitY)
    If (Position of Unit(X of Point(UnitYPos - 2), Y of Point(UnitY + 2)) == UnitX then {
    attached Actor TopLeft for UnitY.
    } else If Position of Unit(X of Point(UnitYPos - 2), Y of Point(UnitY)) == UnitX then {
    attached Actor Left for UnitY.
    } 
    etc...
    
    Posted in: Data
  • 0

    posted a message on Get position of unit and check if unit is next to unit?

    1. Is it possible to retrieve the unit's position in the event editor?

    I thought it would be something like this:

    UnitBirth.UNIT -> StatusSet Position (x,y,z)

    2. Also, if that is possible. Is it possible to check if the unit is next to a different particular unit?

    I.e. if the unit is next to a particular unit on the left side..

    UnitBirth.UNIT -> Is next to Unit X, on the Left? Do...

    3. Lastly, Is there a way to check a status variable of a actor through the trigger editor?

    Thanks.

    Posted in: Data
  • 0

    posted a message on Explicit Rotation and model animation

    Hello.

    I'm having trouble with using explicit rotation on an attached actor. Whenever I add SO_ExplicitRotateTest (see image) to the attached actor's Host Site Operations, then it will no longer follow the host's actor animations. It will still remain attached to the point I specified but will be completely still in place.

    How can I use explicit rotation and also allow the attached actor to follow the host's animations. Thanks.

    Posted in: Data
  • 0

    posted a message on Load external text file

    Is this possible in Starcraft 2 via custom script? I'm trying to load an external text file by using C but everything I type comes back as a syntax error.

    #include <fstream>
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
        ifstream infile("filename.txt");
    
        return 0;
    }
    

    Is there a way?

    Posted in: Galaxy Scripting
  • To post a comment, please or register a new account.