Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ This page lists all the individual contributions to the project by their author.
- Warhead activation target health thresholds enhancements
- Event 606: AttachEffect is attaching to a Techno
- Linked superweapons
- ScriptType action `Play speech`
- **Starkku**:
- Misc. minor bugfixes & improvements
- AI script actions:
Expand Down
13 changes: 13 additions & 0 deletions docs/AI-Scripting-and-Mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@ ShowBriefing=true ; boolean

## Script Actions

### Below `10000`

#### `24` Play speech

- Restored functionality.
- Given a speech index, the game will play it. Just like action 24 from Tiberian Sun.

In `aimd.ini`:
```ini
[SOMESCRIPTTYPE] ; ScriptType
x=24,n
```

### `10000-10999` Ingame Actions

#### `10000-10049` Attack Actions
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ New:
- [Unlimbo Detonate warhead](New-or-Enhanced-Logics.md#unlimbo-detonate-warhead) (by FlyStar)
- Attack and damage technos underground (by TaranDahl)
- Fast access structure (by FlyStar)
- ScriptType action `Play speech` (by FS-21)

Vanilla fixes:
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
Expand Down
11 changes: 11 additions & 0 deletions src/Ext/Script/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ void ScriptExt::ProcessAction(TeamClass* pTeam)
// Chronoshift to enemy base, argument is additional distance modifier
ScriptExt::ChronoshiftToEnemyBase(pTeam, argument);
break;
case PhobosScripts::PlaySpeech:
ScriptExt::PlaySpeech(pTeam);
break;
default:
// Do nothing because or it is a wrong Action number or it is an Ares/YR action...
if (action > 70 && !ScriptExt::IsExtVariableAction(action))
Expand Down Expand Up @@ -1247,3 +1250,11 @@ void ScriptExt::Log(const char* pFormat, ...)
Debug::LogWithVArgs(pFormat, args);
va_end(args);
}

// Works like the old Tiberian Sun ScriptType Action "24"
void ScriptExt::PlaySpeech(TeamClass* pTeam)
{
int index = pTeam->CurrentScript->Type->ScriptActions[pTeam->CurrentScript->CurrentMission].Argument;
VoxClass::PlayIndex(index);
pTeam->StepCompleted = true;
}
3 changes: 3 additions & 0 deletions src/Ext/Script/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

enum class PhobosScripts : unsigned int
{
PlaySpeech = 24,

// Range 10000-10999 are team (aka ingame) actions
// Sub-range 10000-10049 is for "attack" actions
RepeatAttackCloser = 10000,
Expand Down Expand Up @@ -217,6 +219,7 @@ class ScriptExt
static void VariableBinaryOperationHandler(TeamClass* pTeam, int nVariable, int nVarToOperate);
static bool IsUnitAvailable(TechnoClass* pTechno, bool checkIfInTransportOrAbsorbed);
static void Log(const char* pFormat, ...);
static void PlaySpeech(TeamClass* pTeam);

// Mission.Attack.cpp
static void Mission_Attack(TeamClass* pTeam, int calcThreatMode = 0, bool repeatAction = true, int attackAITargetType = -1, int idxAITargetTypeItem = -1);
Expand Down