add automatic pronoun detection for FTE_STRINGS engines

This commit is contained in:
alison wright 2019-09-20 19:56:41 -04:00
parent af7d5bd846
commit 10d98c67c0
3 changed files with 59 additions and 33 deletions

View File

@ -1,5 +1,35 @@
// client.qc: player-adjacent functions
string(float pro) pronoun_subject = {
switch(pro) {
case PRO_NONE: return "none";
case PRO_FAE: return "fae";
case PRO_HE: return "he";
case PRO_IT: return "it";
case PRO_SHE: return "she";
case PRO_THEY: return "they";
case PRO_XEY: return "xey";
case PRO_ZE_H: return "ze";
case PRO_ZE_Z: return "ze";
default: return "unknown";
}
};
string(float pro) pronoun_possessive = {
switch(pro) {
case PRO_NONE: return "none";
case PRO_FAE: return "faer";
case PRO_HE: return "his";
case PRO_IT: return "its";
case PRO_SHE: return "her";
case PRO_THEY: return "their";
case PRO_XEY: return "xyr";
case PRO_ZE_H: return "hir";
case PRO_ZE_Z: return "zir";
default: return "unknown";
}
};
/*
=============================================================================
@ -53,6 +83,8 @@ void() SetNewParms = {
};
void() DecodeLevelParms = {
float ofs, ofs2, pro;
if(serverflags) {
if(world.model == "maps/start.bsp") {
SetNewParms(); // take away all stuff on starting new episode
@ -69,6 +101,19 @@ void() DecodeLevelParms = {
self.weapon = parm8;
self.armortype = parm9 * 0.01;
self.pronoun = parm10;
if(ext_strings) {
ofs = strstrofs(self.netname, "(", 0);
if(ofs != -1) {
for(pro = PRO_NONE; pro < PRO_MAX; pro++) {
ofs2 = strstrofs(self.netname, pronoun_possessive(pro), ofs);
if(ofs2 == ofs + 1 && strstrofs(self.netname, ")", ofs) != -1) {
self.pronoun = pro;
break;
}
}
}
}
};
/*
@ -1105,36 +1150,6 @@ void() cheat_quad = {
self.items = self.items | IT_QUAD;
};
string(float pro) pronoun_subject = {
switch(pro) {
case PRO_NONE: return "none";
case PRO_FAE: return "fae";
case PRO_HE: return "he";
case PRO_IT: return "it";
case PRO_SHE: return "she";
case PRO_THEY: return "they";
case PRO_XEY: return "xey";
case PRO_ZE_H: return "ze";
case PRO_ZE_Z: return "ze";
default: return "unknown";
}
};
string(float pro) pronoun_possessive = {
switch(pro) {
case PRO_NONE: return "none";
case PRO_FAE: return "faer";
case PRO_HE: return "his";
case PRO_IT: return "its";
case PRO_SHE: return "her";
case PRO_THEY: return "their";
case PRO_XEY: return "xyr";
case PRO_ZE_H: return "hir";
case PRO_ZE_Z: return "zir";
default: return "unknown";
}
};
void(float pro) change_pronoun = {
pro = minmax(pro, PRO_NONE, PRO_MAX - 1);

View File

@ -271,6 +271,17 @@ void(entity e) setspawnparms = #78;
float(string s) checkextension = #99;
float(string str, string sub, float startpos) strstrofs = #221;
float(string str, float ofs) str2chr = #222;
string(float... c) chr2str = #223;
string(float ccase, float calpha, float cnum, string... s) strconv = #224;
string(float chars, string... s) strpad = #225;
string(string info, string key, string... value) infoadd = #226;
string(string info, string key) infoget = #227;
float(string s1, string s2, float len) strncmp = #228;
float(string s1, string s2) strcasecmp = #229;
float(string s1, string s2, float len) strncasecmp = #230;
// constants -----------------------------------------------------------------|
const vector VEC_ORIGIN = '0 0 0';
@ -644,6 +655,7 @@ float player_respawned;
float all_players_are_dead;
float ext_con_set;
float ext_strings;
// fields --------------------------------------------------------------------|

View File

@ -18,9 +18,8 @@ void() worldspawn = {
InitBodyQue();
if(cvar("pr_checkextension")) {
if(checkextension("DP_CON_SET")) {
ext_con_set = TRUE;
}
ext_con_set = checkextension("DP_CON_SET");
ext_strings = checkextension("FTE_STRINGS");
}
// custom map attributes