SC2Mapster Forums

Development > Triggers

Please Help - FPS Weapon Issues

  • 3 posts
    #1 Dec 11, 2012 at 15:11 UTC - 0 likes

    Updates

    Look at post #3 for images.

    Original Post

    Linked below is a video that I made displaying what is wrong with my FPS map. The issues include:

    1. Cursor not being hidden even after trigger action.
    2. Weapon does not adjust its pitch to follow camera.
    3. Weapon does not display a firing actor.
    4. Weapon does not bob while the player moves.
    5. Traceline seems to only work if player aims at the torso of the enemy unit.

    http://www.youtube.com/watch?v=umxPpGUtng4&feature=youtu.be

    What can I do to fix these five issues?

    Last edited Dec 12, 2012 by admielke
    #2 Dec 12, 2012 at 14:59 UTC - 0 likes

    You might want to post some of the triggers you are using, I cant tell much from the video you have shown (though it's good to have a video to see the actual error).

    #3 Dec 12, 2012 at 21:21 UTC - 0 likes
    Quote from Demtrod: Go

    You might want to post some of the triggers you are using, I cant tell much from the video you have shown (though it's good to have a video to see the actual error).

    Global Variables

    Map Initialization

    Direct Link

    Weapon Firing

    Direct Link

    Traceline

    Traceline Custom Script

    while(lv_traceDistance < 50.0) {
        if(lv_pitch < 90){
            lv_traceHeight = Tan(lv_pitch) * lv_traceDistance * (-1);
        } else if(lv_pitch > 270) {
            lv_traceHeight = Tan(360 - lv_pitch) * lv_traceDistance;
        }
        lv_tracePoint = PointWithOffsetPolar(lp_cameraPosition, lv_traceDistance, lv_yaw);
        lv_traceWorldHeight = WorldHeight(c_heightMapGround, lv_tracePoint);
        lv_traceRegion = RegionCircle(lv_tracePoint, 1.5);
        lv_closestUnit = libNtve_gf_ClosestUnitToPoint(lv_tracePoint, UnitGroup(null, 15, lv_traceRegion, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
        lv_unitRegion = RegionCircle(UnitGetPosition(lv_closestUnit), UnitGetPropertyFixed(lv_closestUnit, c_unitPropRadius, true));
        lv_unitWorldHeight = WorldHeight(c_heightMapGround, UnitGetPosition(lv_closestUnit));
        if(lv_closestUnit != null && 
        lv_closestUnit != gv_mainUnit[lp_player] && 
        RegionContainsPoint(lv_unitRegion, lv_tracePoint) && 
        lp_cameraHeight + lv_traceHeight - lv_unitWorldHeight >= 0.0 && 
        lp_cameraHeight + lv_traceHeight - lv_unitWorldHeight <= UnitGetPropertyFixed(lv_closestUnit, c_unitPropRadius, true)) {
            gv_traceline_currentTarget[lp_player] = lv_closestUnit;
            gv_traceline_currentTargetPoint[lp_player] = lv_tracePoint;
            gv_traceline_currentTargetHeight[lp_player] = lp_cameraHeight + lv_traceHeight;
            		
            return;
        }
        if(lp_cameraHeight + lv_traceHeight <= lv_traceWorldHeight) {
            gv_traceline_currentTarget[lp_player] = null;
            gv_traceline_currentTargetPoint[lp_player] = lv_tracePoint;
            gv_traceline_currentTargetHeight[lp_player] = lp_cameraHeight + lv_traceHeight;
            return;
        }
        lv_traceDistance += 0.5;
    }
    gv_traceline_currentTarget[lp_player] = null;
    gv_traceline_currentTargetPoint[lp_player] = null;
    gv_traceline_currentTargetHeight[lp_player] = 0.0;
    

    Movement Variables

    Movement

    Direct Link

    Direct Link

    Direct Link

  • 3 posts

You must login to post a comment. Don't have an account? Register to get one!