Skip to content

GetAheadLocation - Example?

Can anyone please help in writing an example for the function GetAheadLocation? We could also then add it to NWN Lexicon

https://nwnlexicon.com/index.php?title=GetAheadLocation

I'm getting errors trying to copy paste and playing around with it

Comments

  • FreshLemonBunFreshLemonBun Member Posts: 909
    You could do it with your own vector math. Usually you'll probably use it for something like displacing an effect or custom directional cone relative to the origin. I had something custom like that a while back, after googling math stuff, but I can't remember where I put it.
  • ValeriyaValeriya Member Posts: 55
    I just mean something basic that compiles, nothing fancy. I can't get it to compile..been trying all sorts of variation. Could someone provide a compile-able example?
  • DazDaz Member Posts: 125
    Did you add the following (#include "x0_i0_position") to the very top of your script, above void main()?

    Like so:

    #include "x0_i0_position" void main() { }
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    #include "x0_i0_position"
    void main()
    {
    object oPC = GetLastUsedBy();
    location lTarget = GetAheadLocation(oPC);
    AssignCommand(oPC, JumpToLocation(lTarget));
    }
  • ValeriyaValeriya Member Posts: 55
    *slaps forehead*
    I did indeed forget to include the #include "x0_i0_position"
    I'll add it to NWN Lexicon later on
    Thank you
Sign In or Register to comment.