djcev.com

//

Git Repos / fte_dogmode / qc / compat / mg1.qc

Last update to this file was on 2025-03-30 at 19:29.

Show mg1.qc

//==============================================================================
// KNOWN_RELEASE_MG1 compatibility - Machine Games "Dimension Of The Machine"
//==============================================================================

//======================================================================
// constants
//======================================================================

#ifdef SSQC
//----------------------------------------------------------------------
// misc_corpse_seq -- matches misc_corpse_poses from MG1 -- CEV
//----------------------------------------------------------------------
typedef enum
{
MISC_CORPSE_SEQ_DEMON_1, // Monster corpses
MISC_CORPSE_SEQ_DOG_1,
MISC_CORPSE_SEQ_DOG_2,
MISC_CORPSE_SEQ_ENFORCER_1,
MISC_CORPSE_SEQ_ENFORCER_2,
MISC_CORPSE_SEQ_FISH_1,
MISC_CORPSE_SEQ_HKNIGHT_1,
MISC_CORPSE_SEQ_HKNIGHT_2,
MISC_CORPSE_SEQ_KNIGHT_1,
MISC_CORPSE_SEQ_KNIGHT_2,
MISC_CORPSE_SEQ_OGRE_1,
MISC_CORPSE_SEQ_OGRE_2,
MISC_CORPSE_SEQ_SHALRATH_1,
MISC_CORPSE_SEQ_SHAMBLER_1,
MISC_CORPSE_SEQ_SOLDIER_1,
MISC_CORPSE_SEQ_SOLDIER_2,
MISC_CORPSE_SEQ_WIZARD_1,
MISC_CORPSE_SEQ_PLAYER_1, // Player corpse
MISC_CORPSE_SEQ_PLAYER_2,
MISC_CORPSE_SEQ_PLAYER_3,
MISC_CORPSE_SEQ_PLAYER_4,
MISC_CORPSE_SEQ_PLAYER_5,
MISC_CORPSE_SEQ_PLAYER_6,
MISC_CORPSE_SEQ_DEMON_HEAD, // Heads
MISC_CORPSE_SEQ_DOG_HEAD,
MISC_CORPSE_SEQ_SOLDIER_HEAD, // "h_guard"
MISC_CORPSE_SEQ_HKNIGHT_HEAD,
MISC_CORPSE_SEQ_KNIGHT_HEAD,
MISC_CORPSE_SEQ_ENFORCER_HEAD, // "h_mega"
MISC_CORPSE_SEQ_OGRE_HEAD,
MISC_CORPSE_SEQ_PLAYER_HEAD,
MISC_CORPSE_SEQ_SHALRATH_HEAD,
MISC_CORPSE_SEQ_SHAMBLER_HEAD,
MISC_CORPSE_SEQ_WIZARD_HEAD,
MISC_CORPSE_SEQ_ZOMBIE_HEAD,
MISC_CORPSE_SEQ_GIB_1, // Gibs
MISC_CORPSE_SEQ_GIB_2,
MISC_CORPSE_SEQ_GIB_3
} misc_corpse_seq;
#endif

//======================================================================
// forward declarations
//======================================================================

#ifdef SSQC
void() compat_mg1_monster_spawnflags;
#endif

#ifdef SSQC
// info_player_start_hub
void(entity e) info_player_start_hub_init;
void() info_player_start_hub;
#endif

#ifdef SSQC
// trigger_activate_coop_spawns
void() trigger_activate_coop_spawns;
#endif

#ifdef SSQC
// func_explode
void() func_explode;
#endif

#ifdef SSQC
// misc_corpse
void() misc_corpse;
#endif

//------------------------------------------------------------------------------

#ifdef SSQC
//----------------------------------------------------------------------
void() compat_mg1_monster_spawnflags =
{
local float startflags = self.spawnflags;

// spawnflag 4 is SPAWNED in MG1; entity waits to be used -- CEV
if (startflags & 4)
{
self.spawnflags &= ~4;
self.spawnflags |= SPAWNFLAG_MONSTER_SPAWNED;
}

// spawnflag 8 is ANGRY in MG1 -- CEV
if (startflags & 8)
{
self.spawnflags &= ~8;
self.spawnflags |= SPAWNFLAG_MONSTER_ANGRY;
}

// spawnflag 16 is TFOG in MG1 -- CEV
if (startflags & 16)
{
self.spawnflags &= ~16;
self.wait = 0;
}
else
{
self.wait = 1;
}

// spawnflag 32 is ATTACK_FRIEND in MG1 -- CEV
if (startflags & 32)
{
self.spawnflags &= ~32;
// TODO CEV
}

// whatever spawnflag 64 in MG1 is it's incompatible -- CEV
if (startflags & 64)
{
self.spawnflags &= ~64;
// TODO CEV
}

// spawnflag 4096 is WAITWALK in MG1 -- CEV
if (startflags & 4096)
{
self.spawnflags &= ~4096;
self.spawnflags |= SPAWNFLAG_MONSTER_WAITWALK;
}
};
#endif

#ifdef SSQC
/*QUAKED info_player_start_hub (1 0 0) (-16 -16 -24) (16 16 24)
Only used on start map for the return point from an episode.
*/
//----------------------------------------------------------------------
// class info_player_start_hub: base_mapentity
// {
//--------------------------------------------------------------
void(entity e) info_player_start_hub_init =
{
base_mapentity_init (e);
e.classname = "info_player_start_hub";
e.classtype = CT_INFO_PLAYER_START_HUB;
};

//--------------------------------------------------------------
void() info_player_start_hub =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

info_player_start_hub_init (self);
};
// };
#endif

#ifdef SSQC
//----------------------------------------------------------------------
// class trigger_activate_coop_spawns: entity
// {
//--------------------------------------------------------------
void() trigger_activate_coop_spawns =
{
remove (self);
};
// };
#endif

#ifdef SSQC
/*QUAKED func_explode (0 .5 .8) (0 0 0) (32 32 64)
Custom exploding box
*/
//----------------------------------------------------------------------
// class func_explode: base_func
// {
//--------------------------------------------------------------
void() func_explode =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

func_explobox_init (self);
};
// }
#endif

#ifdef SSQC
//----------------------------------------------------------------------
// class misc_corpse: base_misc_model
// {
//--------------------------------------------------------------
void() misc_corpse =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

switch (self.style)
{
case MISC_CORPSE_SEQ_DEMON_1:
monster_dead_demon_init (self);
break;
case MISC_CORPSE_SEQ_DOG_1:
self.spawnflags |= 2;
monster_dead_dog_init (self);
break;
case MISC_CORPSE_SEQ_DOG_2:
self.spawnflags |= 4;
monster_dead_dog_init (self);
break;
case MISC_CORPSE_SEQ_ENFORCER_1:
monster_dead_enforcer_init (self);
break;
case MISC_CORPSE_SEQ_ENFORCER_2:
self.spawnflags |= 2;
monster_dead_enforcer_init (self);
break;
case MISC_CORPSE_SEQ_FISH_1:
monster_dead_fish_init (self);
break;
case MISC_CORPSE_SEQ_HKNIGHT_1:
monster_dead_hell_knight_init (self);
break;
case MISC_CORPSE_SEQ_HKNIGHT_2:
self.spawnflags |= 2;
monster_dead_hell_knight_init (self);
break;
case MISC_CORPSE_SEQ_KNIGHT_1:
self.spawnflags |= 2;
monster_dead_knight_init (self);
break;
case MISC_CORPSE_SEQ_KNIGHT_2:
monster_dead_knight_init (self);
break;
case MISC_CORPSE_SEQ_OGRE_1:
self.spawnflags |= 2;
monster_dead_ogre_init (self);
break;
case MISC_CORPSE_SEQ_OGRE_2:
monster_dead_ogre_init (self);
break;
case MISC_CORPSE_SEQ_SHALRATH_1:
monster_dead_shalrath_init (self);
break;
case MISC_CORPSE_SEQ_SHAMBLER_1:
monster_dead_shambler_init (self);
break;
case MISC_CORPSE_SEQ_SOLDIER_1:
self.spawnflags |= 2;
monster_dead_army_init (self);
break;
case MISC_CORPSE_SEQ_SOLDIER_2:
monster_dead_army_init (self);
break;
case MISC_CORPSE_SEQ_WIZARD_1:
monster_dead_wizard_init (self);
break;
case MISC_CORPSE_SEQ_PLAYER_1:
player_dead_axe ();
break;
case MISC_CORPSE_SEQ_PLAYER_2:
// TODO CEV
// misc_corpse_init (self);
break;
case MISC_CORPSE_SEQ_PLAYER_3:
// TODO CEV
// misc_corpse_init (self);
break;
case MISC_CORPSE_SEQ_PLAYER_4:
// TODO CEV
// misc_corpse_init (self);
break;
case MISC_CORPSE_SEQ_PLAYER_5:
// TODO CEV
// misc_corpse_init (self);
break;
case MISC_CORPSE_SEQ_PLAYER_6:
player_dead_on_side ();
break;
case MISC_CORPSE_SEQ_DEMON_HEAD:
item_head_demon_init (self);
break;
case MISC_CORPSE_SEQ_DOG_HEAD:
item_head_dog_init (self);
break;
case MISC_CORPSE_SEQ_SOLDIER_HEAD:
item_head_army_init (self);
break;
case MISC_CORPSE_SEQ_HKNIGHT_HEAD:
item_head_hell_knight_init (self);
break;
case MISC_CORPSE_SEQ_KNIGHT_HEAD:
item_head_knight_init (self);
break;
case MISC_CORPSE_SEQ_ENFORCER_HEAD:
item_head_enforcer_init (self);
break;
case MISC_CORPSE_SEQ_OGRE_HEAD:
item_head_ogre_init (self);
break;
case MISC_CORPSE_SEQ_PLAYER_HEAD:
item_head_player_init (self);
break;
case MISC_CORPSE_SEQ_SHALRATH_HEAD:
item_head_shalrath_init (self);
break;
case MISC_CORPSE_SEQ_SHAMBLER_HEAD:
item_head_shambler_init (self);
break;
case MISC_CORPSE_SEQ_WIZARD_HEAD:
item_head_wizard_init (self);
break;
case MISC_CORPSE_SEQ_ZOMBIE_HEAD:
item_head_zombie_init (self);
break;
case MISC_CORPSE_SEQ_GIB_1:
item_gib1_init (self);
break;
case MISC_CORPSE_SEQ_GIB_2:
item_gib2_init (self);
break;
case MISC_CORPSE_SEQ_GIB_3:
item_gib3_init (self);
break;
default:
objerror ("misc_corpse with invalid style");
}
};
// };
#endif

Return to the top of this page or return to the overview of this repo.

Log mg1.qc

Date Commit Message Author + -
2025-03-30 Big commit. Entity networking, etc. cev +342  

Return to the top of this page or return to the overview of this repo.