Hi, im trying to code a new monster for Monster mod metamod plugin, to be exact the replicators from Stargate SG-1 TV Show. Now can enybody help me cause im kind of stuck, i took bits & pieces from other monsters and trying to figure if im right, please tell me if this code is...lets say "Working"
//================================================== =======
// Replicator
//================================================== =======
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
//================================================== =======
// monster-specific DEFINE's
//================================================== =======
#define REPLICATOR_MAXIMUM_REPLICATE 50 // We Definately Do Not Want Massive Lag Cause Of Thousands of Replicator Entities in the map.
//================================================== =======
// monster-specific schedule types
//================================================== =======
enum
{
SCHED_FIND_WEAPON = LAST_COMMON_SCHEDULE + 1,
SCHED_RETURN_TO_NEST,//Schedule The Return to "Nest"
SCHED_CONSUME_WEAPON,//Consumes The Weapon For to use as raw materials for making more of itself
SCHED_REPLICATE,//Simply said, Replicate itself
};
//================================================== =======
// monster-specific tasks
//================================================== =======
enum
{
TASK_REPLICATOR_TAKE_WEAPON = LAST_COMMON_TASK + 1, // Taking a weapon
TASK_REPLICATOR_RETURN_TO_NEST ,// Returning the Weapon to the "Nest"
TASK_REPLICATOR_CONSUME_WEAPON,//Now we shall consume the weapon
TASK_REPLICATOR_REPLICATE,//What about we make more of ourselves so we don't become extinct like dinosaurs?
};
//================================================== =======
// Monster's Anim Events Go Here
//================================================== =======
#define REPLICATOR_AE_ATTACK_ONE 0x01
const char *CMReplicator::pAttackHitSounds[] =
{
"replicator/attack_hit_1.wav",
"replicator/attack_hit_2.wav",
"replicator/attack_hit_3.wav",
};
const char *CMReplicator::pAttackMissSounds[] =
{
"replicator/miss1.wav",
"replicator/miss2.wav",
};
const char *CMReplicator::pAttackSounds[] =
{
"replicator/attack1.wav",
"replicator/attack2.wav",
};
const char *CMReplicator::pIdleSounds[] =
{
"replicator/repli_idle1.wav",
"replicator/repli_idle4.wav",
};
const char *CMReplicator::pAlertSounds[] =
{
"replicator/repli_alert1.wav",
};
//================================================== =======
// Classify - indicates this monster's place in the
// relationship table.
//================================================== =======
int CMReplicator :: Classify ( void )
{
return CLASS_REPLICATOR_MONSTER;
}
//================================================== =======
// hide from the loudest sound source
//================================================== =======
Task_t tlReplicatorTakeCoverFromBestSound[] =
{
{ TASK_STOP_MOVING, (float)0 },
{ TASK_FIND_COVER_FROM_BEST_SOUND, (float)0 },
{ TASK_RUN_PATH, (float)0 },
{ TASK_WAIT_FOR_MOVEMENT, (float)0 },
{ TASK_REMEMBER, (float)bits_MEMORY_INCOVER },
{ TASK_TURN_LEFT, (float)179 },
};
Schedule_t slReplicatorTakeCoverFromBestSound[] =
{
{
tlReplicatorTakeCoverFromBestSound,
ARRAYSIZE ( tlReplicatorTakeCoverFromBestSound ),
bits_COND_NEW_ENEMY,
0,
"ReplicatorTakeCoverFromBestSound"
},
};
//================================================== =======
// AlertIdle Schedules
//================================================== =======
Task_t tlReplicatorHide[] =
{
{ TASK_STOP_MOVING, 0 },
{ TASK_SET_ACTIVITY, (float)ACT_IDLE },
{ TASK_WAIT, (float)2 },
{ TASK_SET_SCHEDULE, (float)SCHED_CHASE_ENEMY },
};
Schedule_t slReplicatorHide[] =
{
{
tlReplicatorHide,
ARRAYSIZE ( tlAssassinHide ),
bits_COND_NEW_ENEMY |
bits_COND_SEE_ENEMY |
bits_COND_SEE_FEAR |
bits_COND_LIGHT_DAMAGE |
bits_COND_HEAVY_DAMAGE |
bits_COND_PROVOKED |
bits_COND_HEAR_SOUND,
0,
"ReplicatorHide"
},
};
All i want it to do is replicate all at costs(ofcourse it has to fetch the weapons it uses for raw materials and bring back it to nest to decompose it to parts then build more of itself with the gun material it gathered)It wouldn't attack player unless it determines if its a threat(i.e one of its kind is shot upon, then they would converge upon the player and kill him). Im kind of clueless after the things i added there what to do. :'(
Btw could enyone attach code for the normal turrets and ceiling turrets from Half Life, i think i wanna try fixing em up for Monstermod usage..