1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Arc Formula Discussion

Discussion in 'Triggers & Scripts' started by dardas, Apr 11, 2011.

  1. Tukki

    Tukki

    Joined:
    Feb 10, 2008
    Messages:
    247
    Resources:
    2
    Maps:
    1
    JASS:
    1
    Resources:
    2
    It seems like the problem lies within the z-declaring, so you should rewrite it like this:

    Code (vJASS):

    public static method create takes unit Object, vector position, real angle, vector acceleration returns thistype
            local thistype this     = allocate()
           
            set .Object             = Object
            set .Homing             = null
           
            set .Position           = vector.create(position.x, position.y, position.z + GetCoordniateZ(position.x, position.y)
            set .Acceleration       = vector.create(acceleration.x * Cos(angle * bj_DEGTORAD), acceleration.y * Sin(angle * bj_DEGTORAD), acceleration.z)
            set .Velocity           = vector.create(0, 0, 0)
            set .Start              = vector.create(position.x, position.y, position.z)
            set .Reach              = vector.create(position.x, position.y, position.z)

            call SetUnitFlyHeight(.Object, position.z /*not .Position.z*/, 0)

    .. etc.


    Homing doesn't work because of the unset 'angle variable.
    Just add the
    angle = GetAngleBetweenVectors(.Position, .Reach)
    before you actually set the facing.
    Because of the unset variable the whole script crashes at that point, every time, so try to fix that first.
     
  2. dardas

    dardas

    Joined:
    Sep 12, 2008
    Messages:
    649
    Resources:
    0
    Resources:
    0
    Okay, now im mad on the indexing, i realised what happends,
    it overwrites last missle, thats the idea, but it does not re-create it and re-do variables, so it leaks 5 vectors + 1 RealityObject,
    and also it makes the other missle stops, because its behing overwritten,
    which is very bad. if you want me to pm you the test map, tell me.
     
  3. Tukki

    Tukki

    Joined:
    Feb 10, 2008
    Messages:
    247
    Resources:
    2
    Maps:
    1
    JASS:
    1
    Resources:
    2
    Alright, send it my way! :)
     
  4. dardas

    dardas

    Joined:
    Sep 12, 2008
    Messages:
    649
    Resources:
    0
    Resources:
    0
    You can close this, tukki has helped me finish this, and all problems are solved.