ja, ich probiere jez das i-wie zu machen das man selber die wache steuert das sind dann so aus :
#include <acknex.h>
#include <default.c>
action guard_walk()
{
camera_follow(me);
VECTOR vFeet;
vec_for_min(vFeet,me); // vFeet.z = distance from player origin to lowest vertex
my.STATE = 1;
while (1)
{
// state 1: walking ////////////////////////////////////////////
if (my.STATE == 1)
{
// rotate the entity with the arrow keys
my.pan += (key_cul-key_cur)*5*time_step;
// move the entity forward/backward with the arrow keys
var distance = (key_cuu-key_cud)*5*time_step;
c_move(me, vector(distance,0,0), NULL, GLIDE);
// animate the entity
my.ANIMATION += 2*distance;
ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
// adjust entity to the ground height, using a downwards trace
c_trace(my.x,vector(my.x,my.y,my.z-1000),IGNORE_ME | IGNORE_PASSABLE);
my.z = hit.z - vFeet.z; // always place player's feet on the ground
if (key_space) { // key pressed -> go to state 2
my.ANIMATION = 0;
my.STATE = 2;
}
}
// state 2: casting a spell ///////////////////////////////////
if (my.STATE == 2)
{
my.ANIMATION += 8*time_step;
ent_animate(me,"attack",my.ANIMATION,0);
if (my.ANIMATION > 100) { // create the spell and go to state 3
ent_create("spell.dds",vector(my.x,my.y,my.z+20),spell_fly);
my.ANIMATION = 0;
my.STATE = 3;
}
}
// state 3: waiting for key release ///////////////////////////
if (my.STATE == 3) {
if (!key_space) my.STATE = 1; // when key was released, back to state 1
}
wait(1);
}
}
function main()
{
level_load("land1.wmb");
wait(1);
ent_create("guard.mdl", NULLVECTOR, guard_walk);
}
aber wenn ic hauf den pfeil drücke errort es nur -.-