Hello,
Just thought I would share my latest script
it Spawns an Enemy at defined place...
(similar to how Doom3 spawn enemies behind)
It works nicely at the exit of Level or a door
setting the trigger in front of you and the Spawn point behind...
Let the enemies convince the player he isnt quite ready
to leave the level.
This was designed to work with the A5 templates
but should work with A6 as well with minor modification
( Would have to chanded the spawnee action for sure)
also a Enemy action is included ( A5 template only)
Ok here is the code:
Code:
////////////////////////////
var spawnpos[3];
string enemy_sneak1, <guard.mdl>; // your spawned models here
var enemy1;
//entity* spawn_point;
ACTION S_point // give this to the spawn point
{
spawnpos[0] = my.skill1; // copy a dummy model to where you would like
spawnpos[1] = my.skill2; // enemy to spawn
spawnpos[2] = my.skill3; // copy its positon to these skill in WED
wait(1);
}
action sneaky1
{
wait(1);
enemy1 = me;
my._health =1500;
//MY._ALERTNESS = 3000;
temp.z = 1000; // scanning range
MY._ACCURACY = -100;
MY._COWARDICE =-300;
MY._FORCE = 2;
//MY._FIREMODE = DAMAGE_SHOOT+FIRE_BALL+HIT_FLASH+0.10;
//MY._FIREMODE = DAMAGE_EXPLODE+FIRE_BALL+HIT_EXPLO+BULLET_SMOKETRAIL+0.20;
MY._FIREMODE = DAMAGE_EXPLODE+FIRE_BALL+HIT_EXPLO+BULLET_SMOKETRAIL+0.20;
MY._HITMODE = HIT_GIB;//HIT_EXPLO;
MY._WALKSOUND = _SOUND_ROBOT;
anim_init();
drop_shadow(); // attach shadow to robot
actor_fight();
// if(MY.FLAG4 == ON) { patrol(); }
// create(<arrow.pcx>,MY.POS,_ROBOT_TEST_WATCHER); // used to activate watcher drone
}
function en_spawn()
{
wait(1);
ent_create (enemy_sneak1,spawnpos,sneaky1);
//here the define enemy is spawne, cordiantes set, action give
}
function spawn_check()
{
wait(3); // add 2 spawned enemies if desired have to leave time to spawn
if(event_type == event_impact && you == player)
{
my.enable_impact = OFF;
my.enable_push = off;
en_spawn();
}
}
action Enemy_Spawner1 // here is the Action to give the trigger point
{
wait(1);
exclusive_global;
MY.ENABLE_IMPACT = ON; //enables player impact
my.enable_push = on;
MY.EVENT = spawn_check;
}
////////////////////////////////
//////////////////////////////////////////