Nuclide
Software Development Kit for id Technology
MapTweaks

Conditional map entity overrides. More...

Detailed Description

Conditional map entity overrides.

MapTweaks

Overview

This is a very customizable system that applies changes to levels/maps depending on a variable amount of parameters. It was invented specifically for Nuclide and designed to work together with EntityDefs.

Syntax

All MapTweaks are defined within scripts/maptweaks.txt.

Let's take a look at an example MapTweak:

hldm_tweak
{
when-cvar deathmatch equals 2
when-serverinfo *bspversion equals 30
replace weapon_gauss info_null
replace weapon_egon info_null
}
Tools-Entity: Generic Hint.
Definition: info_null.qc:38
serverinfoAPI_t serverinfo
Definition: api.h:155

The hldm_tweaks is just a user-defined name. It doesn't affect functionality.

The when-cvar and when-serverinfo lines are checks. each one is checked individually and only if all are positive will the replace lines take effect.

You can have as many lines in there as you like.

Other than equals, you can also use one of the following keywords when comparing values:

At this time, when-cvar and when-serverinfo only do comparisons on numbers. So you cannot check for strings at this time.

Classes

struct  mapTweak_t
 Data holding MapTweak entries. More...
 

Functions

void MapTweaks_Init (void)
 Called upon server init, after all EntityDef have been initialized. More...
 
bool MapTweak_EntitySpawn (entity)
 Will take an existing entity, and apply the currently valid map tweaks to it. More...
 
void MapTweak_ListActive (void)
 

Function Documentation

◆ MapTweak_EntitySpawn()

bool MapTweak_EntitySpawn ( entity  targetEntity)

Will take an existing entity, and apply the currently valid map tweaks to it.

◆ MapTweak_ListActive()

void MapTweak_ListActive ( void  )

◆ MapTweaks_Init()

void MapTweaks_Init ( void  )

Called upon server init, after all EntityDef have been initialized.