Translations of this page:

This is an old revision of the document!
—-

Script para prevenir que el actor camine debido a la conversión errónea 3D/2D

A veces puedes encontrarte con el siguiente problema. Tu actor se detiene el algún punto gracias a los puntos calientes. Pinchas otra vez en ese punto y el actor se da la vuelta misteriosamente. Esto es debido a la conversión del espacio 3D/2D, y el problema es que el actor piensa que tiene que caminar un pixel más allá.

Fix is simple: create a script which you attach to your actor. Inside put the following code:

#include "scripts/base.inc" 
 
var C_DX = 2; // thresholds which define that the actor is on one place  
var C_DY = 2; 
 
function abs(X)  //returns absolute value of the number 
{ 
    if (X <0) X = X*-1; 
    return(X);     
} 
 
method GoTo(DestX,DestY) 
{ 
 
    if (abs(this.X - DestX) < C_DX && abs(this.Y - DestY) < C_DY) return; // Let's not spin by approx clicks.     
        this.GoTo(DestX,DestY); 
}


 
es/resource/script_to_prevent_actor_from_walking_thanks_to_3d_2d_conversion_imperfection.1269004112.txt.gz · Last modified: 2010/03/19 14:08 by saboteur
Recent changes RSS feed Creative Commons License Driven by DokuWiki