1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Cannot make a function in ArcherCommon.as

Discussion in 'Modding Help' started by Blue_Tiger, Apr 15, 2015.

Thread Status:
Not open for further replies.
  1. Blue_Tiger

    Blue_Tiger Haxor Tester

    Messages:
    899
    I'm probably doing something insanely stupid but this is because I don't know any AngelScript, and from what I gather it is similar to C++, which I know almost nothing of.

    Anyway, I was just messing around in the ArcherCommon.as file and tried to make the following function:

    Code:
    bool hasSpecialArrows(CBlob@ this, u8 arrowType)
    {
       
        if (archer.arrow_type == ArrowType::normal)
        {
            return true;
        }
        else
        {
            return hasArrows(this);
        }
        return false;
    }
    which seemed to not function at all with KAG. I assume that it is a sub-class or something, but looking around at the top of the class doesn't help guide me in any direction. Even when I don't call the method at any point, it still seems to do this.

    Again, sorry for the ignorance to AngelScript.
     
    daskew87 likes this.
  2. Skinney

    Skinney THD Team THD Team Forum Moderator Tester

    Messages:
    468
    You're lacking a reference for 'archer', you either need to pass a handle through the functions arguments or get it from the object it is set to.

    Code:
    ArcherInfo@ archer;
    if(!this.get("archerInfo", @archer)) return;
     
    Blue_Tiger likes this.
  3. FuzzyBlueBaron

    FuzzyBlueBaron Warm, Caring, Benign, Good and Kind Philanthrope Global Moderator Forum Moderator Donator Tester
    1. The Young Blood Collective - [YB]

    Messages:
    2,508
    Locked on OP request [solved].
     
Thread Status:
Not open for further replies.