.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Metamod and metamod plugins (http://forums.bots-united.com/forumdisplay.php?f=15)
-   -   Help a newbie coder (http://forums.bots-united.com/showthread.php?t=2402)

Akalamanaia 01-08-2004 16:58

Help a newbie coder
 
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..:|

Akalamanaia 02-08-2004 12:53

Re: Help a newbie coder
 
could somebody please, help meeeeeeeeeeeeeeee?

Akalamanaia 07-08-2004 10:40

Re: Help a newbie coder
 
Ah so my thread got 35 views, but no one bothers to help me?

sPlOrYgOn 11-08-2004 03:00

Re: Help a newbie coder
 
I'm sorry I do not know anything about this stuff...
maybe someone else here can help you when they find the time to.

Maleficus 11-08-2004 06:54

Re: Help a newbie coder
 
Sorry - I don't know anything about the HL engine or coding for it, I'm a coder for a quake3 engine game. :(

[MoD]Cha0s C0ntr0L 14-08-2004 13:28

Re: Help a newbie coder
 
ask botman (PM)

Cheeseh 14-08-2004 15:09

Re: Help a newbie coder
 
It's a bit of a big question since you want to do all this stuff and none of that code up there shows you have tried to even do it.

It seems you don't know how the tasks and schedules work in HL, do you? If you do know, then simply apply the rules. This is more of an AI question as you want a monster to do what it wants.

Perhaps you want to try out some of that stuff and tell us of any problems you are having with it (bugs etc you have) you will be more likely to receive replies from people willing to help that way. We like to solve problems but not to do work for others, sorry.. that might be just me :)

botman 15-08-2004 14:20

Re: Help a newbie coder
 
Start with a working simple moster (like the headcrab) and change one rule at a time until you get to the point that it behaves like you want your monster to, then swap out the sound, models, etc. for the stuff you want to use for your model.

Don't try to change everything all at once.

botman


All times are GMT +2. The time now is 07:13.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.