Home » MODDING HQ 1.13 » v1.13 Idea Incubation Lab » Externalised taunts
|
Re: Externalised taunts[message #328399]
|
Thu, 21 November 2013 02:45
|
|
anv |
|
Messages:258
Registered:March 2013 |
|
|
This
Toggle Spoiler
Index: Init.cpp
===================================================================
--- Init.cpp (revision 6638)
+++ Init.cpp (working copy)
@@ -1018,20 +1018,42 @@
#endif
// Externalised taunts
- strcpy(fileName, directoryName);
- strcat(fileName, TAUNTSFILENAME);
- DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
- SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), TAUNTSFILENAME);
-
-#ifndef ENGLISH
- AddLanguagePrefix(fileName);
- if ( FileExists(fileName) )
+ GETFILESTRUCT FileInfo;
+ char tauntFileNamePattern[MAX_PATH];
+ strcpy(tauntFileNamePattern, directoryName);
+ strcat(tauntFileNamePattern, TAUNTSFILENAMEBEGINNING"*"TAUNTSFILENAMEENDING);
+ if( GetFileFirst(tauntFileNamePattern, &FileInfo) )
{
+ strcpy(fileName, directoryName);
+ strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
- SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), TAUNTSFILENAME);
+ SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
+ }
+#endif
+ while( GetFileNext(&FileInfo) )
+ {
+ strcpy(fileName, directoryName);
+ strcat(fileName, FileInfo.zFileName);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
+ }
+#endif
+ }
+ GetFileClose(&FileInfo);
}
-#endif
-
+
// IMP Portraits List by Jazz
strcpy(fileName, directoryName);
strcat(fileName, IMPPORTRAITS);
Index: Tactical/XML.h
===================================================================
--- Tactical/XML.h (revision 6638)
+++ Tactical/XML.h (working copy)
@@ -238,6 +238,8 @@
#define SQUADNAMEFILENAME "SquadNames.xml"
#define BACKGROUNDSFILENAME "Backgrounds.xml"
#define TAUNTSFILENAME "EnemyTaunts.xml"
+#define TAUNTSFILENAMEBEGINNING "EnemyTaunts"
+#define TAUNTSFILENAMEENDING ".xml"
#define ENEMY_ADMIN_PROFILE_FILENAME "Profiles\\SoldierProfileEnemyAdmin.xml"
#define ENEMY_REGULAR_PROFILE_FILENAME "Profiles\\SoldierProfileEnemyRegular.xml"
Index: Tactical/XML_Taunts.cpp
===================================================================
--- Tactical/XML_Taunts.cpp (revision 6638)
+++ Tactical/XML_Taunts.cpp (working copy)
@@ -272,8 +272,8 @@
pData->curTaunt.uiFlags2 |= TAUNT_C_VETERAN;
}
- //pData->curArray[pData->curTaunt.uiIndex] = pData->curTaunt;
- pData->curArray[num_found_taunt-1] = pData->curTaunt;
+ pData->curArray[pData->curTaunt.uiIndex] = pData->curTaunt;
+ //pData->curArray[num_found_taunt-1] = pData->curTaunt;
}
}
num_found_taunt++;
@@ -962,7 +962,7 @@
memset(&pData,0,sizeof(pData));
- pData.curArray = zTaunt;
+ pData.curArray = &(zTaunt[num_found_taunt]);
pData.maxArraySize = NUM_TAUNT;
XML_SetUserData(parser, &pData);
should let use any file named EnemyTauntsWhatever.xml for storing taunts, including splitting existing taunts into several files or adding new ones + modders migh find it easier to add extra file with all their added taunts then modifying existing one. Just be careful with backups, because TableData/EnemyTaunts - Copy.xml will be loaded too.
About restructuring file: problem is that with tag taunts can't be just moved around or added in between similar ones, because any changing of order screws over translators (another problem is single English taunt can't be translated into multiple different ones with added extra tags in languages with different verb inflection depending on subject's gender).
Proof reading - yep, please help to hunt down any grammar errors and unfitting taunts. I'm not native so there's only that much I can do about errors, and find it easier to put in contributions en masse to xml than meditate over every single quote, plus I only provided some additional coding for the feature already implemented, so I don't want to pose as some evil taunt overlord - anyone is free to translate his ideas into xml and post them for 1.13 crew consideration. For these already included, just post them, so they can be discussed upon and replaced, I'm sure nobody's feelings will get hurt After all it's difficult to introduce brand new content and stay true to the spirit of original, but that's what seasoned community is supposed to control, right?
Report message to a moderator
|
|
|
|
|
|
|
|
Re: Externalised taunts[message #328424]
|
Thu, 21 November 2013 21:29
|
|
anv |
|
Messages:258
Registered:March 2013 |
|
|
YaguarIm not trying to be an ass here, but could you make the taunts that are posted here by users optional? I dont like most of the taunts that maalstrom is posting, so could you please make it optional to use those community taunts? Taunts written by different contributors could be put in different author-specific file, and turning them off handled by simply removing it from installation. However, I think it would be more constructive to fix bad quotes rather than throw entire content into trash can.
RoWa21@all: Please do not remove existing taunts, just replace them if they do not fix. Re-ordering the for all the taunts is not really funny I couldn't figure out any way to automatically reorder uiIndexes in Notepad++, but for anyone with Perl installed on machine it could be done using
perl -i.bak -p -e "s|(?<=).*(?=)|$n++|e" EnemyTaunts.xml
RoWa21@anv: Should I apply the Taunts-patch above to the svn source trunk? Yes, please. Moa also noticed some bugs and suggested fixes, so here's more updated patch:
Toggle SpoilerIndex: ja2_v1.13/Build/Init.cpp
===================================================================
--- ja2_v1.13/Build/Init.cpp (revision 6638)
+++ ja2_v1.13/Build/Init.cpp (working copy)
@@ -1018,20 +1018,42 @@
#endif
// Externalised taunts
- strcpy(fileName, directoryName);
- strcat(fileName, TAUNTSFILENAME);
- DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
- SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), TAUNTSFILENAME);
-
-#ifndef ENGLISH
- AddLanguagePrefix(fileName);
- if ( FileExists(fileName) )
+ GETFILESTRUCT FileInfo;
+ char tauntFileNamePattern[MAX_PATH];
+ strcpy(tauntFileNamePattern, directoryName);
+ strcat(tauntFileNamePattern, TAUNTSFILENAMEBEGINNING"*"TAUNTSFILENAMEENDING);
+ if( GetFileFirst(tauntFileNamePattern, &FileInfo) )
{
+ strcpy(fileName, directoryName);
+ strcat(fileName, FileInfo.zFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
- SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), TAUNTSFILENAME);
+ SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
+ }
+#endif
+ while( GetFileNext(&FileInfo) )
+ {
+ strcpy(fileName, directoryName);
+ strcat(fileName, FileInfo.zFileName);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
+ }
+#endif
+ }
+ GetFileClose(&FileInfo);
}
-#endif
-
+
// IMP Portraits List by Jazz
strcpy(fileName, directoryName);
strcat(fileName, IMPPORTRAITS);
Index: ja2_v1.13/Build/Tactical/Civ Quotes.cpp
===================================================================
--- ja2_v1.13/Build/Tactical/Civ Quotes.cpp (revision 6638)
+++ ja2_v1.13/Build/Tactical/Civ Quotes.cpp (working copy)
@@ -1047,7 +1047,7 @@
//--------------------------------------------------------------
// anv: start enemy taunt with probabilty depending on taunt settings
-void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, INT8 iTauntType, SOLDIERTYPE *pTarget )
+void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTarget )
{
// taunts disabled?
if( gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == FALSE )
@@ -1243,7 +1243,7 @@
}
// SANDRO - soldier taunts
-void StartEnemyTaunt( SOLDIERTYPE *pCiv, INT8 iTauntType, SOLDIERTYPE *pTarget )
+void StartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTarget )
{
UINT16 iTauntNumber;
CHAR16 sTauntText[320];
Index: ja2_v1.13/Build/Tactical/Civ Quotes.h
===================================================================
--- ja2_v1.13/Build/Tactical/Civ Quotes.h (revision 6638)
+++ ja2_v1.13/Build/Tactical/Civ Quotes.h (working copy)
@@ -74,7 +74,7 @@
NUM_CIV_QUOTES
};
-enum //enemy taunts - SANDRO
+enum TAUNTTYPE//enemy taunts - SANDRO
{
// actions
TAUNT_FIRE_GUN,
@@ -154,8 +154,8 @@
TAUNT_RIPOSTE
};
-void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, INT8 iTauntType, SOLDIERTYPE *pTarget = NULL );
-void StartEnemyTaunt( SOLDIERTYPE *pCiv, INT8 iTauntType, SOLDIERTYPE *pTarget = NULL ); //enemy taunts - SANDRO // anv: added pTarget argument
+void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTarget = NULL );
+void StartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTarget = NULL ); //enemy taunts - SANDRO // anv: added pTarget argument
void ShowTauntPopupBox( SOLDIERTYPE *pCiv, STR16 gzTauntQuote );
void InitCivQuoteSystem( );
Index: ja2_v1.13/Build/Tactical/Interface.h
===================================================================
--- ja2_v1.13/Build/Tactical/Interface.h (revision 6638)
+++ ja2_v1.13/Build/Tactical/Interface.h (working copy)
@@ -206,7 +206,7 @@
extern UINT16 num_found_background; // the correct number is set on reading the xml
// anv: enums for externalised taunts
-enum {
+enum TAUNTPROPERTY{
// progress
TAUNT_PROGRESS_LT,
Index: ja2_v1.13/Build/Tactical/Soldier Control.cpp
===================================================================
--- ja2_v1.13/Build/Tactical/Soldier Control.cpp (revision 6638)
+++ ja2_v1.13/Build/Tactical/Soldier Control.cpp (working copy)
@@ -5917,30 +5917,30 @@
}
}
DecayIndividualOpplist( this );
- PossiblyStartEnemyTaunt( this, TAUNT_S_GOT_BLINDED, MercPtrs[ubAttackerID]);
- PossiblyStartEnemyTaunt( this, TAUNT_S_GOT_DEAFENED, MercPtrs[ubAttackerID]);
+ PossiblyStartEnemyTaunt( this, TAUNT_GOT_BLINDED, MercPtrs[ubAttackerID]);
+ PossiblyStartEnemyTaunt( this, TAUNT_GOT_DEAFENED, MercPtrs[ubAttackerID]);
break;
case FIRE_WEAPON_BLINDED:
- PossiblyStartEnemyTaunt( this, TAUNT_S_GOT_BLINDED, MercPtrs[ubAttackerID]);
+ PossiblyStartEnemyTaunt( this, TAUNT_GOT_BLINDED, MercPtrs[ubAttackerID]);
break;
case FIRE_WEAPON_DEAFENED:
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Soldier is deafened" );
this->bDeafenedCounter = bDeafValue;
- PossiblyStartEnemyTaunt( this, TAUNT_S_GOT_DEAFENED, MercPtrs[ubAttackerID]);
+ PossiblyStartEnemyTaunt( this, TAUNT_GOT_DEAFENED, MercPtrs[ubAttackerID]);
break;
};
if ( usWeaponIndex == STRUCTURE_EXPLOSION )
{
ubReason = TAKE_DAMAGE_STRUCTURE_EXPLOSION;
- PossiblyStartEnemyTaunt( this, TAUNT_S_GOT_HIT_STRUCTURE_EXPLOSION, MercPtrs[ubAttackerID]);
+ PossiblyStartEnemyTaunt( this, TAUNT_GOT_HIT_STRUCTURE_EXPLOSION, MercPtrs[ubAttackerID]);
}
else
{
ubReason = TAKE_DAMAGE_EXPLOSION;
- PossiblyStartEnemyTaunt( this, TAUNT_S_GOT_HIT_EXPLOSION, MercPtrs[ubAttackerID]);
+ PossiblyStartEnemyTaunt( this, TAUNT_GOT_HIT_EXPLOSION, MercPtrs[ubAttackerID]);
}
}
else
Index: ja2_v1.13/Build/Tactical/XML.h
===================================================================
--- ja2_v1.13/Build/Tactical/XML.h (revision 6638)
+++ ja2_v1.13/Build/Tactical/XML.h (working copy)
@@ -238,6 +238,8 @@
#define SQUADNAMEFILENAME "SquadNames.xml"
#define BACKGROUNDSFILENAME "Backgrounds.xml"
#define TAUNTSFILENAME "EnemyTaunts.xml"
+#define TAUNTSFILENAMEBEGINNING "EnemyTaunts"
+#define TAUNTSFILENAMEENDING ".xml"
#define ENEMY_ADMIN_PROFILE_FILENAME "Profiles\\SoldierProfileEnemyAdmin.xml"
#define ENEMY_REGULAR_PROFILE_FILENAME "Profiles\\SoldierProfileEnemyRegular.xml"
Index: ja2_v1.13/Build/Tactical/XML_Taunts.cpp
===================================================================
--- ja2_v1.13/Build/Tactical/XML_Taunts.cpp (revision 6638)
+++ ja2_v1.13/Build/Tactical/XML_Taunts.cpp (working copy)
@@ -21,7 +21,7 @@
UINT32 currentDepth;
UINT32 maxReadDepth;
}
-typedef enemyRankParseData;
+typedef tauntParseData;
BOOLEAN localizedTextOnly_Taunts;
@@ -30,7 +30,7 @@
static void XMLCALL
tauntStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
- enemyRankParseData * pData = (enemyRankParseData *)userData;
+ tauntParseData * pData = (tauntParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
{
@@ -202,7 +202,7 @@
static void XMLCALL
tauntCharacterDataHandle(void *userData, const XML_Char *str, int len)
{
- enemyRankParseData * pData = (enemyRankParseData *)userData;
+ tauntParseData * pData = (tauntParseData *)userData;
if( (pData->currentDepth <= pData->maxReadDepth) &&
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
@@ -214,7 +214,7 @@
static void XMLCALL
tauntEndElementHandle(void *userData, const XML_Char *name)
{
- enemyRankParseData * pData = (enemyRankParseData *)userData;
+ tauntParseData * pData = (tauntParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth)
{
@@ -272,8 +272,8 @@
pData->curTaunt.uiFlags2 |= TAUNT_C_VETERAN;
}
- //pData->curArray[pData->curTaunt.uiIndex] = pData->curTaunt;
- pData->curArray[num_found_taunt-1] = pData->curTaunt;
+ pData->curArray[pData->curTaunt.uiIndex] = pData->curTaunt;
+ //pData->curArray[num_found_taunt-1] = pData->curTaunt;
}
}
num_found_taunt++;
@@ -931,7 +931,7 @@
CHAR8 * lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL);
- enemyRankParseData pData;
+ tauntParseData pData;
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EnemyTaunts.xml" );
@@ -962,7 +962,7 @@
memset(&pData,0,sizeof(pData));
- pData.curArray = zTaunt;
+ pData.curArray = &(zTaunt[num_found_taunt]);
pData.maxArraySize = NUM_TAUNT;
XML_SetUserData(parser, &pData);
And to be more specific about changes:
- taunts will be loaded from any file in TableData/ that follows EnemyTaunts*.xml naming convention (and LanguagePrefixEnemyTaunts*.xml for translations)
- for taunts in every file should start from 0 and increase normally
Report message to a moderator
|
|
|
|
|
|
|
Re: Externalised taunts[message #328432]
|
Fri, 22 November 2013 00:46
|
|
anv |
|
Messages:258
Registered:March 2013 |
|
|
@JMich: There's no need for that, any taunt can be just removed by player without messing with uiIndexes, and will be skipped on loading xml and later in game (as it won't have any situation tag specified). But once again, instead of enforcing player to mess with files, any taunts should be tailored to fit in perfectly.
@Flugente: it's not currently possible, but very easy to do. Instead of calling taunts from HandleDialogueEnd() for reacting to mercs quotes, they'd be called from ShutDownQuoteBox() so they'd be shown after someone's previous taunt ends. Maybe with single tag specyfing what type of taunts is this taunt answering to. With high riposte probability it would result in long insult exchanges (possibly until one of sides is dead). They won't stop fighting in the mean time though...
@Maalstroom: I myself have no contraindications. Just keep interchangeable taunts together, like knife attacks with knife charges, etc. They're already somewhat grouped. No sure if translators will be so hot about it - I know hrvg is already translating to French, don't know about other languages. But then again, it's work in progress.
Report message to a moderator
|
|
|
|
Re: Externalised taunts[message #328440]
|
Fri, 22 November 2013 14:02
|
|
Taro_M |
|
Messages:292
Registered:November 2008 |
|
|
Hey, could we get an alternative taunt list that is a bit more family friendly?
Its not about me being offended by the language, but I just watched A-team episode and I realized that JA2 is much like 80's TV action serial. So replacing the hard fucks with something a bit lighter would actually improve the atmosphere.
Lynx: Motherf...
enemy: LANGUAGE!
[Updated on: Fri, 22 November 2013 14:56] by Moderator Report message to a moderator
|
Master Sergeant
|
|
|
Re: Externalised taunts[message #328444]
|
Fri, 22 November 2013 17:39
|
|
hrvg |
|
Messages:158
Registered:August 2012 Location: France |
|
|
Hi,
We can stop translating "French.EnemyTaunts.xml" file. 0--->450 translation finished.
Line: "450) You're the disease and I'm the cure."
And we wait new files...
No problem.
But you can write the numbers of lines (taunts) for every files.
For example (fictive Line):
EnemyTauntsComebacks.xml.
Line: 1 to 10, 15, 18...
EnemyTauntsKill.xml.
Line: 11 to 14, 20, 25...
EnemyTauntsHeadPop.xml
Line: 16, 17, 19, 21 to 24...
It is possble?
Thanks.
Regards.
[Updated on: Fri, 22 November 2013 17:42] by Moderator Report message to a moderator
|
Staff Sergeant
|
|
|
|
|
|
|
|
|
Re: Externalised taunts[message #328529]
|
Mon, 25 November 2013 14:42
|
|
hrvg |
|
Messages:158
Registered:August 2012 Location: France |
|
|
MaalstroomHi, I've made all the changes and here are the files.
http://we.tl/KhE6g3416B
I kept Throwing knife with throwing Grenade in the same file.
The old index is marked as a comment and were it's missing it's either the same, new, or above the last translated one (450).
Hi Maalstroom,
You've done a lot of work.
Thank you for old index.
I rename files?:
EnemyTaunts_000_Attack.xml = French.EnemyTaunts_000_Attack.xml
EnemyTaunts_001_Fire_Gun.xml = French.EnemyTaunts_001_Fire_Gun.xml
EnemyTaunts_001_Fire_Launcher.xml = French.EnemyTaunts_001_Fire_Launcher.xml
...
Thank you.
Regards.
[Updated on: Mon, 25 November 2013 14:47] by Moderator Report message to a moderator
|
Staff Sergeant
|
|
|
|
|
|
|
|
Re: Externalised taunts[message #328552]
|
Mon, 25 November 2013 21:59
|
|
hrvg |
|
Messages:158
Registered:August 2012 Location: France |
|
|
You wrote the 792 "Taunts"?
You changed (modified) the files of mercenaries in the files Data-1.13 --> MercEdt or Data--> MercEdt?
Because I do not know the changes (modifications) of these files... (See my example). And to check all the files... It is very hard.
Thank you.
Regards.
[Updated on: Mon, 25 November 2013 22:01] by Moderator Report message to a moderator
|
Staff Sergeant
|
|
|
|
Re: Externalised taunts[message #328558]
|
Mon, 25 November 2013 23:49
|
|
anv |
|
Messages:258
Registered:March 2013 |
|
|
@Maalstroom: 55 files?! I expected like 5-8. Thought all GotHitByWhatever would stay in one file, etc. That must have been a shitload of work. Isn't there too much of repeated taunts in files? Meh, maybe that's for the better. There all should go into own subdirectory though.
Good idea about shared document, would speed up corrections and new contributions, and every once in a while, after enough changes were made, they could be uploaded to svn, without bothering to upload every single letter fix (beatiful->beautiful. Come on, what kind of language uses 3 vowels in a row anyway? )
@hrvg: I changed Bud's .edt together with Postie, Reuban and Leon's, as described in http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/298288/12/Jagged_Alliance_Deadly_Games_M.html
Mostly fixed some repeated lines and replaced others with better fitting. About this specific one - in DG there were two variants of "enemy noticed", depending on if enemy sees us or not.
In JA2 there are 2 variants too, but they're unconnected with enemy noticing us or not. "I've been spotted" suggested that enemy sees us, implying, duh, that Bud has been spotted, which could be obviously untrue like seeing enemy with his back turned on us, so I changed it to more neutral "Made contact with...".
"I've made contact... Haven't been spotted!" is kinda of a stretch as 001, but we can just assume Bud haven't been spotted BEFORE that very moment, as 001 is only used once for the first enemy noticed - or Bud is just in denial, so I left it in.
To check which lines were changed, check SVN log, specifically 240_xxx.wavs added together with new .edt in revision 1853.
[Updated on: Mon, 25 November 2013 23:49] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Externalised taunts[message #328605]
|
Wed, 27 November 2013 03:43
|
|
bimbo0099 |
Messages:3
Registered:May 2013 |
|
|
I just now wanted to report this bug as well.
It seems to not only occur with shotguns but also with burst/auto fire. Multiple text boxes overlap and the game freezes (mouse is frozen, music still playing, 100% cpu usage on the core(s) the game is running on). You then have to exit the game via task manager
I had it happen during my turn but also on enemy and militia turns.
Game dir: 1878
Exe: 6641
Mods: Wildfire maps 6.07
A workaround, I found a couple of minutes ago, is to set TAUNT_SHOW_POPUP_BOX to FALSE in root\Data-1.13\Taunts_Settings.ini
Report message to a moderator
|
Civilian
|
|
|
|
|
|
|
Re: Externalised taunts[message #328654]
|
Thu, 28 November 2013 00:56
|
|
anv |
|
Messages:258
Registered:March 2013 |
|
|
Update:
- fixed crash due to same enemy taunting several times in a row (e.g. after being hit by a burst)
- prevent enemy from taunting again, before his previous taunt is finished
- taunt .xmls should be kept in subdirectory TableData\EnemyTaunts\ to avoid mess in TableData\
- added , if TAUNT_CENSORED_MODE set to TRUE and defined, it will be displayed instead of
Source diff
Toggle SpoilerIndex: ja2_v1.13/Build/GameSettings.cpp
===================================================================
--- ja2_v1.13/Build/GameSettings.cpp (revision 6657)
+++ ja2_v1.13/Build/GameSettings.cpp (working copy)
@@ -3206,6 +3206,7 @@
void LoadTauntsSettings()
{
CIniReader iniReader(TAUNTS_SETTINGS_FILE);
+ gTauntsSettings.fTauntCensoredMode = iniReader.ReadBoolean("Taunts Settings","TAUNT_CENSORED_MODE", FALSE );
gTauntsSettings.fTauntShowPopupBox = iniReader.ReadBoolean("Taunts Settings","TAUNT_SHOW_POPUP_BOX", TRUE );
gTauntsSettings.fTauntShowInLog = iniReader.ReadBoolean("Taunts Settings","TAUNT_SHOW_IN_LOG", TRUE );
gTauntsSettings.fTauntMakeNoise = iniReader.ReadBoolean("Taunts Settings","TAUNT_MAKE_NOISE", TRUE );
Index: ja2_v1.13/Build/GameSettings.h
===================================================================
--- ja2_v1.13/Build/GameSettings.h (revision 6657)
+++ ja2_v1.13/Build/GameSettings.h (working copy)
@@ -1330,6 +1330,7 @@
typedef struct
{
+ BOOLEAN fTauntCensoredMode;
BOOLEAN fTauntShowPopupBox;
BOOLEAN fTauntShowInLog;
BOOLEAN fTauntMakeNoise;
Index: ja2_v1.13/Build/Tactical/Civ Quotes.cpp
===================================================================
--- ja2_v1.13/Build/Tactical/Civ Quotes.cpp (revision 6657)
+++ ja2_v1.13/Build/Tactical/Civ Quotes.cpp (working copy)
@@ -45,6 +45,8 @@
#define HIGH_TOWN_LOYALTY 80
#define CIV_QUOTE_HINT 99
+#define MAX_APPLICABLE_TAUNTS 512
+
extern void CaptureTimerCallback( void );
BOOLEAN gfSurrendered = FALSE;
@@ -137,6 +139,11 @@
UINT16 gusCivQuoteBoxWidth;
UINT16 gusCivQuoteBoxHeight;
+// anv: store times, when enemy taunt will be finished (so they won't taunt 50 times / second)
+UINT32 uiTauntFinishTimes[ TOTAL_SOLDIERS ];
+
+TAUNT_VALUES zApplicableTaunts[NUM_TAUNT];
+
//--------------------------------------------------------------
void CopyNumEntriesIntoQuoteStruct( ) // Not used
{
@@ -1029,11 +1036,15 @@
return( TRUE );
}
+// anv: used now
//is allowed remove. Not used and remove from SaveLoadGame.cpp.
BOOLEAN LoadCivQuotesFromLoadGameFile( HWFILE hFile )
{
UINT32 uiNumBytesRead;
+ // anv: reset uiTauntFinishTimes after game is loaded (so enemies can taunt after guiBaseJA2Clock is decreased)
+ memset( &uiTauntFinishTimes, 0, sizeof( uiTauntFinishTimes ) );
+
FileRead( hFile, &gCivQuotes, sizeof( gCivQuotes ), &uiNumBytesRead );
if( uiNumBytesRead != sizeof( gCivQuotes ) )
{
@@ -1062,6 +1073,12 @@
{
return;
}
+ // is enemy blocked from taunting at the moment?
+ if( uiTauntFinishTimes[pCiv->ubID] > GetJA2Clock() )
+ {
+
+ return;
+ }
// check if generated person
if ( !(IS_MERC_BODY_TYPE( pCiv )) || !(pCiv->ubProfile == NO_PROFILE) )
{
@@ -1079,7 +1096,7 @@
return;
}
// only enemies that are able to speak at the moment can taunt
- if ( pCiv->stats.bLife < OKLIFE || pCiv->bCollapsed )
+ if ( pCiv->stats.bLife < OKLIFE || pCiv->bBreathCollapsed )
{
return;
}
@@ -1248,25 +1265,22 @@
// SANDRO - soldier taunts
void StartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTarget )
{
- UINT16 iTauntNumber;
- CHAR16 sTauntText[320];
+ CHAR16 sTauntText[ 320 ];
CHAR16 gzTauntQuote[ 320 ];
- TAUNT_VALUES zApplicableTaunts[1024];
UINT16 iApplicableTaunts = 0;
- BOOLEAN fApplicableAttitude[6];
-
#ifdef ENABLE_ZOMBIES
// Flugente: zombies don't talk
if ( pCiv->IsZombie() )
return;
#endif
+ // gCivQuoteData.bActive is checked in ShowTauntPopupBox() instead, taunt can be shown in log though!
// if we have a different quote on, return, this one is not important
- if ( gCivQuoteData.bActive )
- {
- return;
- }
+ //if ( gCivQuoteData.bActive )
+ //{
+ // return;
+ //}
// anv: check all taunts, and remember those applicable
for(UINT16 i=0; i= MAX_APPLICABLE_TAUNTS)
+ continue;
}
// are there any applicable taunts?
if( iApplicableTaunts > 0 )
{
// use random one
- swprintf( sTauntText, zApplicableTaunts[ Random(iApplicableTaunts) ].szText );
- }
- else
- {
- return;
- }
-
+ // use censored version if setting is set
+ UINT16 iChosenTaunt = Random(iApplicableTaunts);
+ if( gTauntsSettings.fTauntCensoredMode == TRUE && zApplicableTaunts[ iChosenTaunt ].szCensoredText[0] != 0 )
+ {
+ swprintf( sTauntText, zApplicableTaunts[ iChosenTaunt ].szCensoredText );
+ }
+ else
+ {
+ swprintf( sTauntText, zApplicableTaunts[ iChosenTaunt ].szText );
+ }
#ifdef TAIWANESE
- swprintf( gzTauntQuote, L"%s", sTauntText );
+ swprintf( gzTauntQuote, L"%s", sTauntText );
#else
- swprintf( gzTauntQuote, L"\"%s\"", sTauntText );
+ swprintf( gzTauntQuote, L"\"%s\"", sTauntText );
#endif
- if( gTauntsSettings.fTauntMakeNoise == TRUE )
- MakeNoise( pCiv->ubID, pCiv->sGridNo, pCiv->pathing.bLevel, pCiv->bOverTerrainType, gTauntsSettings.sVolume, NOISE_VOICE, gzTauntQuote );
- else
- {
- if(gTauntsSettings.fTauntShowPopupBox == TRUE)
- {
- if( gbPublicOpplist[gbPlayerNum][pCiv->ubID] == SEEN_CURRENTLY || gTauntsSettings.fTauntAlwaysShowPopupBox == TRUE )
- {
- ShowTauntPopupBox( pCiv, gzTauntQuote );
+ // block this enemy from taunting for a time being
+ uiTauntFinishTimes[pCiv->ubID] = GetJA2Clock() + min( gTauntsSettings.sMaxDelay , max( gTauntsSettings.sMinDelay, FindDelayForString( gzTauntQuote ) + gTauntsSettings.sModDelay ) );
+
+ if( gTauntsSettings.fTauntMakeNoise == TRUE )
+ MakeNoise( pCiv->ubID, pCiv->sGridNo, pCiv->pathing.bLevel, pCiv->bOverTerrainType, gTauntsSettings.sVolume, NOISE_VOICE, gzTauntQuote );
+ else
+ {
+ if(gTauntsSettings.fTauntShowPopupBox == TRUE)
+ {
+ if( gbPublicOpplist[gbPlayerNum][pCiv->ubID] == SEEN_CURRENTLY || gTauntsSettings.fTauntAlwaysShowPopupBox == TRUE )
+ {
+ ShowTauntPopupBox( pCiv, gzTauntQuote );
+ }
}
- }
- if(gTauntsSettings.fTauntShowInLog == TRUE)
- {
- if( gbPublicOpplist[gbPlayerNum][pCiv->ubID] == SEEN_CURRENTLY || gTauntsSettings.fTauntAlwaysShowInLog == TRUE )
+ if(gTauntsSettings.fTauntShowInLog == TRUE)
{
- ScreenMsg( FONT_GRAY2, MSG_INTERFACE, L"%s: %s", pCiv->GetName(), gzTauntQuote );
+ if( gbPublicOpplist[gbPlayerNum][pCiv->ubID] == SEEN_CURRENTLY || gTauntsSettings.fTauntAlwaysShowInLog == TRUE )
+ {
+ ScreenMsg( FONT_GRAY2, MSG_INTERFACE, L"%s: %s", pCiv->GetName(), gzTauntQuote );
+ }
}
}
}
+ else
+ {
+ return;
+ }
+
}
void ShowTauntPopupBox( SOLDIERTYPE *pCiv, STR16 gzTauntQuote )
@@ -1922,6 +1950,12 @@
INT16 sScreenX, sScreenY;
VIDEO_OVERLAY_DESC VideoOverlayDesc;
+ // stop if other civ quote is already being shown
+ if( gCivQuoteData.bActive == TRUE )
+ {
+ return;
+ }
+
// Determine location...
// Get location of civ on screen.....
GetSoldierScreenPos( pCiv, &sScreenX, &sScreenY );
Index: ja2_v1.13/Build/Tactical/Interface.h
===================================================================
--- ja2_v1.13/Build/Tactical/Interface.h (revision 6657)
+++ ja2_v1.13/Build/Tactical/Interface.h (working copy)
@@ -267,6 +267,7 @@
{
UINT16 uiIndex;
CHAR16 szText[320];
+ CHAR16 szCensoredText[320];
UINT64 uiFlags;
UINT64 uiFlags2;
INT16 value[TAUNT_MAX];
Index: ja2_v1.13/Build/Tactical/XML.h
===================================================================
--- ja2_v1.13/Build/Tactical/XML.h (revision 6657)
+++ ja2_v1.13/Build/Tactical/XML.h (working copy)
@@ -238,7 +238,7 @@
#define SQUADNAMEFILENAME "SquadNames.xml"
#define BACKGROUNDSFILENAME "Backgrounds.xml"
#define TAUNTSFILENAME "EnemyTaunts.xml"
-#define TAUNTSFILENAMEBEGINNING "EnemyTaunts"
+#define TAUNTSFILENAMEBEGINNING "EnemyTaunts\\EnemyTaunts"
#define TAUNTSFILENAMEENDING ".xml"
#define ENEMY_ADMIN_PROFILE_FILENAME "Profiles\\SoldierProfileEnemyAdmin.xml"
Index: ja2_v1.13/Build/Tactical/XML_Taunts.cpp
===================================================================
--- ja2_v1.13/Build/Tactical/XML_Taunts.cpp (revision 6657)
+++ ja2_v1.13/Build/Tactical/XML_Taunts.cpp (working copy)
@@ -55,6 +55,7 @@
else if(pData->curElement == ELEMENT &&
(strcmp(name, "uiIndex") == 0 ||
strcmp(name, "szText") == 0 ||
+ strcmp(name, "szCensoredText") == 0 ||
strcmp(name, "aggressive") == 0 ||
strcmp(name, "defensive") == 0 ||
@@ -233,6 +234,8 @@
{
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curArray[pData->curTaunt.uiIndex].szText, sizeof(pData->curTaunt.szText)/sizeof(pData->curTaunt.szText[0]) );
pData->curArray[pData->curTaunt.uiIndex].szText[sizeof(pData->curTaunt.szText)/sizeof(pData->curTaunt.szText[0]) - 1] = '\0';
+ MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curArray[pData->curTaunt.uiIndex].szCensoredText, sizeof(pData->curTaunt.szCensoredText)/sizeof(pData->curTaunt.szCensoredText[0]) );
+ pData->curArray[pData->curTaunt.uiIndex].szCensoredText[sizeof(pData->curTaunt.szCensoredText)/sizeof(pData->curTaunt.szCensoredText[0]) - 1] = '\0';
}
else
{
@@ -297,6 +300,13 @@
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curTaunt.szText, sizeof(pData->curTaunt.szText)/sizeof(pData->curTaunt.szText[0]) );
pData->curTaunt.szText[sizeof(pData->curTaunt.szText)/sizeof(pData->curTaunt.szText[0]) - 1] = '\0';
}
+ else if(strcmp(name, "szCensoredText") == 0 )
+ {
+ pData->curElement = ELEMENT;
+
+ MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curTaunt.szCensoredText, sizeof(pData->curTaunt.szCensoredText)/sizeof(pData->curTaunt.szCensoredText[0]) );
+ pData->curTaunt.szCensoredText[sizeof(pData->curTaunt.szCensoredText)/sizeof(pData->curTaunt.szCensoredText[0]) - 1] = '\0';
+ }
else if(strcmp(name, "aggressive") == 0)
{
pData->curElement = ELEMENT;
Settings diff
Toggle SpoilerIndex: Taunts_Settings.INI
===================================================================
--- Taunts_Settings.INI (revision 1883)
+++ Taunts_Settings.INI (working copy)
@@ -1,5 +1,8 @@
[Taunts Settings]
+; Should lighter version of taunts be used?
+TAUNT_CENSORED_MODE = FALSE
+
; Should enemy taunts be shown in popup boxes?
TAUNT_SHOW_POPUP_BOX = TRUE
Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Thu Apr 18 11:41:54 GMT+3 2024
Total time taken to generate the page: 0.02214 seconds
|