Painkeep v3 - Blast your opponents with 3 times the Pain. Deathmatch mod - make other players "die." Disclaimer - this is a free product with no warranty - see disclaimer.txt for details. Number Six - welcome to the village.

Post tutorial RSS Painkeep hubs and PK mode in v1.2.x and v2.x code

Find out what PK mode is and how it affects normal and custom hubs.

Posted by on - Intermediate Server Side Coding

Here is a recent question:
"What is PK mode and how does it affect regular and custom hubs?"

With the old painkeep v1.1x, anytime you loaded a map with the map command, say "map e1m1", when exit occurred from any method, if the hub flag was set the hub would be loaded. This behavior has been restored with the v1.2.1 release. Hub operation is more complex under the v1.2 release.

"What is PK mode?"
I implemented a map detection option called "PK mode" - simply put the admin can determine how maps are handled with respect to painkeep visual and sound effects and loaded items.

If you connect to a server and enter admin mode you will see this on the main menu:
60: PK mode toggle
--- PK mode = TRUE {... or FALSE}

When you enter 60 at the main menu one of the following messages will appear below the menu indicating the PK mode state:
"PK mode = NEVER" - no map will use painkeep features, no effects appear, and pk items if loaded / collected cant be used.

"PK mode = ALWAYS" - every map is treated as a painkeep map. All will use pk features, effects and items. Every map will return to the hub if the hub flag is set.

PK mod = Map - Painkeep maps will use painkeep features and items. Normal maps will use normal features, effects and sounds.

These operation states determine whether PK mode is true or false for a map. Never is always false and Always is always true. With Map, PK mode will evaluate to true for: the original painkeep maps, maps that load painkeep items, and custom hubs. PK mode will evaluate false for all other maps.

Item over-ride features found in v1.2.1 will work in any mode.

"What does that mean for hubs?"

Original painkeep hub:
Under the v1.2 release if PK mode is false for a map and the server admin issues a map command, such as "map e1m1" the hub will not reload, until manually or map reloaded. For example upon exiting e1m7 which reloads the start map - in painkeep, the hub. This issue is fixed in the v1.2.1 release and manual map loads work as in v1.1x.

Now for the custom hub. The custom hub requires 3 elements to work:
1. .ent file (darkplaces, enhanced engines), bsp edited with quark, re-compiled map - any with hub_custom entity(s) and hub_control entity added and configured correctly.
2. Alias hubmap set to "map {custom hub mapname}" - this is set by the server.
3. custom hub flag and PK hub flag set.

Since the custom hub can reference non painkeep maps that will cause PK mode to evaluate false if PK mode = Map, the custom hub ignores PK mode and will reload as long as its flags and alias are set properly.

No hubs will reload if the hub option is toggled off - from the main admin menu, select:
24: painkeep control
the select:
02: HUB mode toggle

This will toggle hub mode on and off.

A compile option for v1.2.1 reverts to v1.1x behavior for all hubs - only turning off the hub mode exits the hub loop! A server admin could compile the server code so that the v1.2 behavior applies, where having PK mode false will cause a hub loop exit upon manually loading a map.


numbersix Author

Does anyone (who even reads this...) think this still sounds confusing?

Reply Good karma+1 vote
numbersix Author

The confusion with this (if there ever was any) will now end.

After much deliberation with the 2.0 code base I have decided to make the PK mode option in admin an override only, and code map mode to only effect the things I really wanted it to control - environment / static sounds, teleporter sounds, and minor details like that.

All the other pk goodies it controls will be always on if present. So if you carry pk weps to a quake 1 map (e1m1.bsp, etc.) they will work no matter what the map mode setting.

Reply Good karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Profile
Send Message
Release date
Mod watch
Related Mods
Related Games
Quake First Person Shooter
Related Groups
qc Hardware & Tech with 31 members