7 override static void InitInfo(WorldSystemInfo outInfo)
9 outInfo.SetAbstract(
false);
12 void HelloWorldSystem()
14 Print(
"Hello world (systems)");
20modded
class HelloWorldSystem
23 override static void InitInfo(WorldSystemInfo outInfo)
25 super.InitInfo(outInfo);
30 private int m_FrameCount = 0;
36 int frameIndex = m_FrameCount;
37 PrintFormat(
"Hello world (systems) frame %1", frameIndex);
42 if (m_FrameCount == 10)
52 override static void InitInfo(WorldSystemInfo outInfo)
64 private int m_FrameCount = 0;
65 private int m_FixedFrameCount = 0;
66 private int m_SimulatePhysicsCount = 0;
70 switch (args.GetPoint())
73 PrintFormat(
"MultiPointSystem Frame %1", m_FrameCount);
77 PrintFormat(
"MultiPointSystem FixedFrame %1", m_FixedFrameCount);
78 m_FixedFrameCount += 1;
81 PrintFormat(
"MultiPointSystem SimulatePhysics %1", m_SimulatePhysicsCount);
82 m_SimulatePhysicsCount += 1;
86 int total = m_FrameCount + m_FixedFrameCount + m_SimulatePhysicsCount;
96 override static void InitInfo(WorldSystemInfo outInfo)
98 outInfo.SetAbstract(
false);
102 private int m_ConfigInt;
104 void ConfigurableSystem()
106 PrintFormat(
"ConfigurableSystem.ctor m_ConfigInt = %1", m_ConfigInt);
114 override static void InitInfo(WorldSystemInfo outInfo)
123 override protected void OnInit()
125 Print(
"GameMode.OnInit()");
132class DeathmatchMode : GameMode
134 override static void InitInfo(WorldSystemInfo outInfo)
137 outInfo.SetAbstract(
false);
141 override protected void OnInit()
143 Print(
"DeathmatchMode.OnInit()");
147 override void Notify()
149 Print(
"DeathmatchMode.Notify()");
153class TeamDeathmatchMode : GameMode
155 override static void InitInfo(WorldSystemInfo outInfo)
158 outInfo.SetAbstract(
false);
162 override protected void OnInit()
164 Print(
"TeamDeathmatchMode.OnInit()");
168 override void Notify()
170 Print(
"TeamDeathmatchMode.Notify()");
179 override static void InitInfo(WorldSystemInfo outInfo)
186 .AddController(PlayerNameInputController);
195 DbgUI.Begin(
"Player name input");
196 DbgUI.InputText(
"name", playerName);
197 apply = DbgUI.Button(
"Apply");
203 auto controller = PlayerNameInputController.Cast(
204 GetSystems().FindMyController(PlayerNameInputController)
206 controller.RequestNameChange(playerName);
213 override static void InitInfo(WorldControllerInfo outInfo)
216 outInfo.SetPublic(
true);
219 [
RplProp(onRplName:
"OnPlayerNameChanged")]
222 void RequestNameChange(
string newPlayerName)
224 Rpc(Rpc_NameChange_S, newPlayerName);
228 private void Rpc_NameChange_S(
string newPlayerName)
230 if (m_PlayerName == newPlayerName)
233 m_PlayerName = newPlayerName;
234 Replication.BumpMe();
237 this.OnPlayerNameChanged();
240 private void OnPlayerNameChanged()
242 PlayerId ownerPlayerId = this.GetOwnerPlayerId();
244 PrintFormat(
"Player %1 name '%2'", ownerPlayerId, m_PlayerName);
251modded
class PlayerNameInputController
255 Print(
"PlayerNameInputController.OnAuthorityReady()");
258 private bool RplGiven(ScriptBitReader reader)
260 Print(
"PlayerNameInputController.RplGiven()");
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
void OnUpdatePoint(WorldUpdatePointArgs args)
Called at specific points during World update.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.