Results 1 to 4 of 4

Thread: [Question] Astar (a*) and SetAlive functions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by RobsoN View Post
    Hello, I want to ask how to use 2 functions: astar and setalive. What values ​​of closer id have those functions?
    Could you give any examples of those 2 functions? Thanks in advance.

    Regards, RobsoN.
    setAlive: http://killtube.org/downloads/libcod/std/entity.gsc

    astar
    PHP Code:
    switch (function)
        {
            
    #if COMPILE_PLAYER == 1
            
    case 0: return gsc_player_velocity_set(); // todo: stackGetParamVector
            
    case 1: return gsc_player_velocity_get();
            case 
    2: return gsc_player_button_ads();
            case 
    7: return gsc_player_state_alive_set();
            
    #endif 
            
            #if COMPILE_ASTAR == 1
            
    case 8: return gsc_graph_new();
            case 
    9: return gsc_graph_add_edge();
            case 
    10: return gsc_graph_add_vertex();
            case 
    11: return gsc_graph_delete();
            case 
    12: return gsc_graph_build();
            case 
    13: return gsc_graph_do_astar();
            
    //if (function == 14) { return gsc_tracefraction...;
            
    case 15: return gsc_graph_get_nearest_edge();
            
    //if (function == 16) { return gsc_math_nearest_point_on_linesegment();
            #endif
        
    }

        
    #if COMPILE_ASTAR == 1
        
    if (function == 16)
        {
            
    float from[3];
            
    float to[3];
            
    float toPoint[3];
            
    int helper 0;
            
    helper += stackGetParamVector(1from);
            
    helper += stackGetParamVector(2to);
            
    helper += stackGetParamVector(3toPoint);
            if (
    helper != 3)
            {
                
    printf_hide("scriptengine> wrongs args for: int MATH_nearest_point_on_linesegment(from, to, toPoint, out_point)\n");
                return 
    stackPushInt(0);
            }
            
    float out_point[3];
            
    MATH_nearest_point_on_linesegment(fromtotoPointout_point);

            return 
    stackReturnVector(out_point);
        }
        
    #endif 

  2. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    RobsoN (23rd February 2014),smect@ (12th March 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •