Nuclide
Software Development Kit for id Tech
MapTweaks

Conditional map entity overrides. More...

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...
 

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

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.

Function Documentation

◆ MapTweak_EntitySpawn()

bool MapTweak_EntitySpawn ( entity  targetEntity)

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

◆ MapTweaks_Init()

void MapTweaks_Init ( void  )

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