Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
largetent.c
Go to the documentation of this file.
1
enum
SoundTypeTent
2
{
3
REPACK
= 1,
4
NONE
= 0,
5
}
6
7
class
LargeTent
extends
TentBase
8
{
9
ref
protected
EffectSound
m_RepackingLoopSound
;
10
11
void
LargeTent
()
12
{
13
m_ToggleAnimations.Insert(
new
ToggleAnimations
(
"EntranceO"
,
"EntranceC"
, OPENING_0), 0 );
14
m_ToggleAnimations.Insert(
new
ToggleAnimations
(
"Window1O"
,
"Window1C"
, OPENING_1), 0 );
15
m_ToggleAnimations.Insert(
new
ToggleAnimations
(
"Window2O"
,
"Window2C"
, OPENING_2), 0 );
16
m_ToggleAnimations.Insert(
new
ToggleAnimations
(
"Window3O"
,
"Window3C"
, OPENING_3), 0 );
17
m_ToggleAnimations.Insert(
new
ToggleAnimations
(
"Window4O"
,
"Window4C"
, OPENING_4), 0 );
18
m_ToggleAnimations.Insert(
new
ToggleAnimations
(
"Window5O"
,
"Window5C"
, OPENING_5), 0 );
19
m_ToggleAnimations.Insert(
new
ToggleAnimations
(
"Window6O"
,
"Window6C"
, OPENING_6), 0 );
20
m_ToggleAnimations.Insert(
new
ToggleAnimations
(
"Window7O"
,
"Window7C"
, OPENING_7), 0 );
21
22
m_ShowAnimationsWhenPitched.Insert(
"Body"
);
23
/*m_ShowAnimationsWhenPitched.Insert( "EntranceO" );
24
m_ShowAnimationsWhenPitched.Insert( "Window1O" );
25
m_ShowAnimationsWhenPitched.Insert( "Window2O" );
26
m_ShowAnimationsWhenPitched.Insert( "Window3O" );
27
m_ShowAnimationsWhenPitched.Insert( "Window4O" );
28
m_ShowAnimationsWhenPitched.Insert( "Window5O" );
29
m_ShowAnimationsWhenPitched.Insert( "Window6O" );
30
m_ShowAnimationsWhenPitched.Insert( "Window7O" );*/
31
m_ShowAnimationsWhenPitched.Insert(
"Pack"
);
32
33
m_ShowAnimationsWhenPacked.Insert(
"Inventory"
);
34
35
m_HalfExtents
=
Vector
(2.2, 0.3, 1.9);
36
}
37
38
void
~LargeTent
()
39
{
40
SEffectManager
.
DestroyEffect
(
m_RepackingLoopSound
);
41
}
42
43
override
void
OnRPC
(
PlayerIdentity
sender,
int
rpc_type,
ParamsReadContext
ctx)
44
{
45
super.OnRPC(sender, rpc_type, ctx);
46
47
Param1<bool> p =
new
Param1<bool>(
false
);
48
49
if
(ctx.
Read
(p))
50
{
51
bool
play = p.param1;
52
}
53
54
switch
(rpc_type)
55
{
56
case
SoundTypeTent
.REPACK:
57
58
if
( play )
59
{
60
PlayRepackingLoopSound
();
61
}
62
63
if
( !play )
64
{
65
StopRepackingLoopSound
();
66
}
67
68
break
;
69
}
70
}
71
72
void
PlayRepackingLoopSound
()
73
{
74
if
( !
m_RepackingLoopSound
|| !
m_RepackingLoopSound
.IsSoundPlaying() )
75
{
76
m_RepackingLoopSound
=
SEffectManager
.
PlaySound
(
"largetent_deploy_SoundSet"
,
GetPosition
(), 0.5, 0.5 );
77
}
78
}
79
80
void
StopRepackingLoopSound
()
81
{
82
m_RepackingLoopSound
.SetSoundFadeOut(0.5);
83
m_RepackingLoopSound
.SoundStop();
84
}
85
86
override
void
EEInit
()
87
{
88
super.EEInit();
89
}
90
91
override
void
OnItemLocationChanged
(
EntityAI
old_owner,
EntityAI
new_owner)
92
{
93
super.OnItemLocationChanged(old_owner, new_owner);
94
}
95
96
override
string
GetSoundOpen
()
97
{
98
return
"LargeTent_Door_Open_SoundSet"
;
99
}
100
101
override
string
GetSoundClose
()
102
{
103
return
"LargeTent_Door_Close_SoundSet"
;
104
}
105
106
override
string
GetSoundOpenWindow
()
107
{
108
return
"LargeTent_Window_Open_SoundSet"
;
109
}
110
111
override
string
GetSoundCloseWindow
()
112
{
113
return
"LargeTent_Window_Close_SoundSet"
;
114
}
115
116
override
bool
HasClutterCutter
()
117
{
118
return
true
;
119
}
120
121
override
string
GetClutterCutter
()
122
{
123
return
"LargeTentClutterCutter"
;
124
}
125
126
//================================================================
127
// ADVANCED PLACEMENT
128
//================================================================
129
130
override
void
OnPlacementComplete
( Man player,
vector
position =
"0 0 0"
,
vector
orientation =
"0 0 0"
)
131
{
132
super.OnPlacementComplete( player, position, orientation );
133
134
PlayerBase
pb =
PlayerBase
.Cast( player );
135
136
if
(
g_Game
.IsServer() )
137
{
138
if
( !
m_ClutterCutter
)
139
{
140
m_ClutterCutter
=
g_Game
.CreateObjectEx(
"LargeTentClutterCutter"
, pb.GetLocalProjectionPosition(),
ECE_PLACE_ON_SURFACE
);
141
m_ClutterCutter
.SetOrientation( pb.GetLocalProjectionOrientation() );
142
}
143
}
144
}
145
146
override
string
GetDeploySoundset
()
147
{
148
return
"placeLargeTent_SoundSet"
;
149
}
150
151
override
string
GetLoopDeploySoundset
()
152
{
153
return
"largetent_deploy_SoundSet"
;
154
}
155
};
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition
centraleconomy.c:37
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition
effectsound.c:5
EntityAI
Definition
inventoryitem.c:2
PlayerBase
Definition
playerbaseclient.c:2
PlayerIdentity
The class that will be instanced (moddable).
Definition
gameplay.c:389
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound).
Definition
effectmanager.c:6
SEffectManager::DestroyEffect
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Definition
effectmanager.c:271
SEffectManager::PlaySound
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Definition
effectmanager.c:169
Serializer::Read
proto bool Read(void value_in)
TentBase
Definition
cartent.c:2
TentBase::OnItemLocationChanged
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition
cartent.c:21
TentBase::GetDeploySoundset
override string GetDeploySoundset()
Definition
cartent.c:50
TentBase::HasClutterCutter
override bool HasClutterCutter()
Definition
cartent.c:36
TentBase::GetLoopDeploySoundset
override string GetLoopDeploySoundset()
Definition
cartent.c:55
TentBase::GetSoundClose
override string GetSoundClose()
Definition
cartent.c:31
TentBase::GetClutterCutter
override string GetClutterCutter()
Definition
mediumtent.c:41
TentBase::EEInit
override void EEInit()
Definition
cartent.c:16
TentBase::OnPlacementComplete
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition
mediumtent.c:50
TentBase::GetSoundOpen
override string GetSoundOpen()
Definition
cartent.c:26
TentBase::GetSoundCloseWindow
override string GetSoundCloseWindow()
Definition
partytent.c:41
TentBase::GetSoundOpenWindow
override string GetSoundOpenWindow()
Definition
partytent.c:36
ToggleAnimations
Definition
toggleselections.c:2
vector
Definition
enconvert.c:119
m_HalfExtents
Container_Base m_HalfExtents
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
m_ClutterCutter
Object m_ClutterCutter
Definition
fireplacebase.c:207
ParamsReadContext
Serializer ParamsReadContext
Definition
gameplay.c:15
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
NONE
@ NONE
body is not in simulation, nor in collision world
Definition
simulationstate.c:15
GetPosition
vector GetPosition()
Get the world position of the Effect.
Definition
effect.c:473
StopRepackingLoopSound
void StopRepackingLoopSound()
Definition
largetent.c:80
LargeTent
void LargeTent()
Definition
largetent.c:11
m_RepackingLoopSound
enum SoundTypeTent m_RepackingLoopSound
~LargeTent
void ~LargeTent()
Definition
largetent.c:38
SoundTypeTent
SoundTypeTent
Definition
largetent.c:2
REPACK
@ REPACK
Definition
largetent.c:3
PlayRepackingLoopSound
void PlayRepackingLoopSound()
Definition
largetent.c:72
OnRPC
override void OnRPC(ParamsReadContext ctx)
Definition
playerstatbase.c:69
Games
Dayz
scripts
4_world
entities
itembase
tentbase
largetent.c
Generated by
1.17.0