DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ HandleEngineSound()

void Car::HandleEngineSound ( CarEngineSoundState state)
inlineprotected

postpone the engine sound played from c++ on soundcontroller (via OnSound override)

См. определение в файле CarScript.c строка 1560

1561 {
1564
1565 #ifndef SERVER
1566 #ifndef NO_GUI
1567 PlayerBase player = null;
1568 EffectSound sound = null;
1569 WaveKind waveKind = WaveKind.WAVEEFFECTEX;
1570
1571 bool doInside = false;
1572
1574
1575 switch (state)
1576 {
1577 case CarEngineSoundState.STARTING:
1578 sound = new EffectSound();
1579 sound.SetSoundSet("Offroad_02_Starting_SoundSet");
1580 sound.SetSoundFadeOut(0.15);
1581
1582 m_PreStartSound = sound;
1583 break;
1584 case CarEngineSoundState.START_OK:
1585 doInside = true;
1586
1587 sound = new EffectSound();
1589 sound.SetAutodestroy(true);
1590
1592 g_Game.GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(SetEngineStarted, 1000, false, true);
1593 break;
1594
1595 case CarEngineSoundState.START_NO_FUEL:
1596 sound = new EffectSound();
1597 sound.SetSoundSet("offroad_engine_failed_start_fuel_SoundSet");
1598 sound.SetAutodestroy(true);
1599 break;
1600
1601 case CarEngineSoundState.START_NO_BATTERY:
1602 sound = new EffectSound();
1603 sound.SetSoundSet("offroad_engine_failed_start_battery_SoundSet");
1604 sound.SetAutodestroy(true);
1605 break;
1606
1607 case CarEngineSoundState.START_NO_SPARKPLUG:
1608 sound = new EffectSound();
1609 sound.SetSoundSet("offroad_engine_failed_start_sparkplugs_SoundSet");
1610 sound.SetAutodestroy(true);
1611 break;
1612
1613 case CarEngineSoundState.STOP_OK:
1614 doInside = true;
1615
1616 sound = new EffectSound();
1618 sound.SetAutodestroy(true);
1619 break;
1620 case CarEngineSoundState.STOP_NO_FUEL:
1621 doInside = true;
1622
1623 sound = new EffectSound();
1625 sound.SetAutodestroy(true);
1626 break;
1627
1628 default:
1629 break;
1630 }
1631
1632 // play different sound based on selected camera
1633 if (doInside && Class.CastTo(player, g_Game.GetPlayer()))
1634 {
1635 if (player.IsCameraInsideVehicle())
1636 {
1637 waveKind = WaveKind.WAVEEFFECT;
1638 }
1639 }
1640
1641 if (sound)
1642 {
1643 vector enginePos = GetEnginePos();
1644
1645 sound.SetParent(this);
1646 sound.SetPosition(ModelToWorld(enginePos));
1647 sound.SetLocalPosition(enginePos);
1648 sound.SetSoundWaveKind(waveKind);
1649 SEffectManager.EffectRegister(sound);
1650
1651 sound.SoundPlay();
1652 }
1653
1654 #endif
1655 #endif
1656 }
DayZGame g_Game
Определения DayZGame.c:4074
proto native vector GetEnginePos()
Get actual position of engine (model space)
WaveKind
Определения Sound.c:2
string m_EngineStartOK
Sounds.
Определения CarScript.c:148
int m_CarEngineLastSoundState
Определения CarScript.c:185
void SetEngineStarted(bool started)
Определения CarScript.c:2238
string m_EngineStopFuel
Определения CarScript.c:153
ref EffectSound m_PreStartSound
Определения CarScript.c:162
void SetCarEngineSoundState(CarEngineSoundState pState)
Определения CarScript.c:1554
string m_EngineStop
Определения CarScript.c:152
void SetSoundSet(string snd)
Set soundset for the sound.
Определения EffectSound.c:798
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Определения EffectSound.c:607
void SetSoundWaveKind(WaveKind wave_kind)
Set WaveKind for the sound.
Определения EffectSound.c:788
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.
Определения EffectSound.c:908
override void SetParent(Object parent_obj, int pivot)
Set parent for the sound to follow.
Определения EffectSound.c:658
bool SoundPlay()
Plays sound.
Определения EffectSound.c:199
const int CALL_CATEGORY_GAMEPLAY
Определения 3_Game/DayZ/tools/tools.c:10

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, Class::CastTo(), SEffectManager::EffectRegister(), g_Game, GetEnginePos(), m_CarEngineLastSoundState, m_EngineStartOK, m_EngineStop, m_EngineStopFuel, m_PreStartSound, EffectSound::SetAutodestroy(), SetCarEngineSoundState(), SetEngineStarted(), EffectSound::SetParent(), EffectSound::SetSoundFadeOut(), EffectSound::SetSoundSet(), EffectSound::SetSoundWaveKind() и EffectSound::SoundPlay().