|
Re: Arachnoid---free Model
[Re: TheGameMaker]
#108481
01/22/07 18:45
01/22/07 18:45
|
Joined: Apr 2005
Posts: 2,332 Germany, BaWü
aztec

Expert
|

Expert
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
|
Hey this is a small contribution of my side Its a simple KI script for the moddel test it! Code:
function angriff_spider {
var attack_percentage; var spider_bottom; var spider_head; while(my.health > 0) { if(vec_dist (my.x, player.x) < 500) { attack_percentage = 0; // reset the "attack" animation frames
while (attack_percentage < 100)
{
vec_for_vertex (spider_head, my, 424); // sword tip vertex - get the value in Med
vec_for_vertex (spider_bottom, my, 619); // sword base vertex - get the value in Med
if (c_trace (spider_bottom, spider_head, ignore_me | ignore_passable) > 0) // the enemy has hit something?
{
if (you != null && you == player)
{
you.health -= 0.5 * time_step; // if the player has hit an entity, decrease its health
}
}
ent_animate(my,"attack", attack_percentage, null);
attack_percentage += 6 * time_step;
wait (1);
} } wait(1); }
}
action spider { var enemy_distance; my.enable_impact = on; wait(1); my.min_x = -20; my.min_y = -20; my.max_x = 20; my.max_y = 20; my.polygon = on; move_mode = ignore_passable+glide;//ignoriert passierbare Blocks und Entities my.health = 500;//Ich habe 500 Lebenspunkte
while (my.health > 0)//solange ich lebe { my.event = angriff_spider; //wenn der player näher als 800 quants ist, laufe auf ihn zu if (vec_dist (my.x, player.x) < 1000 && player.health > 0)&&(vec_dist (my.x, player.x)) { if(my.skill5 == 0){my.skill5 = 1; vec_set(temp, player.x); vec_sub(temp, my.x); vec_to_angle(my.pan, temp); enemy_distance.x = 10 * time;
//schwerkraft, gravity vec_set (temp, my.x); temp.z -= 1000; trace_mode = ignore_me + ignore_passable + use_box; enemy_distance.z = -trace (my.x, temp);
//bewege mich, move move_mode = use_box;//ignoriert passierbare Blocks und Entities ent_move(enemy_distance, nullvector); ent_cycle("walk", my.skill4); //Laufanimation my.skill4 += 3 * time; // "Animationsgeschwindigkeit if (my.skill4 > 100) {my.skill4 = 0;} //wiederhole animation } //wenn der player weiter weg ist, stehe nur doof rum if (vec_dist (my.x, player.x) > 10000) { my.skill5 = 0; ent_cycle("stand", my.skill4);//stehanimation my.skill4 += 3 * time; if (my.skill4 > 100) {my.skill4 = 0;} } wait (1); } //wenn das monster tot ist my.skill4 = 0;//animation zurücksetzen my.tilt = 0;//ich stehe senkrecht zum boden while (my.skill4 < 80 && my.alpha > 1) { my.passable = on;//man kann einfach durch ihn durchlaufen ent_cycle("death", my.skill4);// spiele sterbeanimation my.skill4 += 1.5 * time; // Animationsgeschwindigkeit wait (1); } } Regards Aztec PS: Will upload a video if possible
Last edited by aztec; 01/22/07 19:33.
Visit: schwenkschuster-design.de
|
|
|
Re: Arachnoid---free Model
[Re: TheGameMaker]
#108483
01/22/07 19:33
01/22/07 19:33
|
Joined: Apr 2005
Posts: 2,332 Germany, BaWü
aztec

Expert
|

Expert
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
|
ups du hast recht ein paar sachen sind nicht gelöscht worden^^ es sollte aber trotzdem funktionieren Ich edite schnell mal 
Visit: schwenkschuster-design.de
|
|
|
Re: Arachnoid---free Model
[Re: TheGameMaker]
#108485
01/22/07 20:25
01/22/07 20:25
|
Joined: Apr 2005
Posts: 2,332 Germany, BaWü
aztec

Expert
|

Expert
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
|
Ja okay ich benutze halt nicht die templates  ^^ gut zu wissen, dass du die Laufanimation noch ändern willst Mfg Aztec 
Visit: schwenkschuster-design.de
|
|
|
|