Originally Posted by
RobsoN
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(1, from);
helper += stackGetParamVector(2, to);
helper += stackGetParamVector(3, toPoint);
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(from, to, toPoint, out_point);
return stackReturnVector(out_point);
}
#endif