Skip to content

Commit 6a4d0c5

Browse files
committed
Example update
1 parent 6745643 commit 6a4d0c5

File tree

2 files changed

+43
-42
lines changed

2 files changed

+43
-42
lines changed

Example/Save/PyPlugins/Test/Test.py

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class Test:
1010
def On_TablesLoaded(self, tables):
1111
# Debug.Log("On_TablesLoaded hooked with " + tables.Count.ToString() + " element, from Python")
12-
Plugin.TryDumpObjToFile("On_TablesLoaded.Tables", tables)
12+
Plugin.DumpObjToFile("On_TablesLoaded.Tables", tables, 3, 20, True, True)
1313
return tables
1414

1515
def On_AllPluginsLoaded(self):
@@ -27,7 +27,7 @@ def testtimerCallback(self, dic):
2727
plug2.Invoke("TestSharedFunction", dic["first"], dic["second"])
2828
Debug.Log(dic["first"])
2929
Debug.Log(dic["second"])
30-
Plugin.TryDumpObjToFile("testtimerCallback.dic", dic)
30+
Plugin.DumpObjToFile("testtimerCallback.dict", dic, 3, 20, True, True)
3131
Plugin.KillTimers()
3232

3333
def On_PluginInit(self):
@@ -38,76 +38,77 @@ def On_ServerShutdown(self):
3838

3939
def On_ItemsLoaded(self, items):
4040
# Debug.Log("On_ItemsLoaded hooked with " + items.Count + " element, from Python")
41-
Plugin.TryDumpObjToFile("On_ItemsLoaded.Items", items)
41+
Plugin.DumpObjToFile("On_ItemsLoaded.Items", items, 3, 20, True, True)
4242
return items
4343

4444
def On_Chat(self, Player, Text):
4545
# Debug.Log(Player.Name + " says: " + Text)
46-
Plugin.TryDumpObjToFile("On_Chat.Player", Player)
47-
Plugin.TryDumpObjToFile("On_Chat.Text", Text)
46+
Plugin.DumpObjToFile("On_Chat.Player", Player, 3, 20, True, True)
47+
Plugin.DumpObjToFile("On_Chat.Text", Text, 3, 20, True, True)
4848

4949
def On_BlueprintUse(self, Player, BPUseEvent):
5050
# Debug.Log(Player.Name + " researched " + BPUseEvent.ItemName)
51-
Plugin.TryDumpObjToFile("On_BlueprintUse.Player", Player)
52-
Plugin.TryDumpObjToFile("On_BlueprintUse.BPUseEvent", BPUseEvent)
51+
Plugin.DumpObjToFile("On_BlueprintUse.Player", Player, 3, 20, True, True)
52+
Plugin.DumpObjToFile("On_BlueprintUse.BPUseEvent", BPUseEvent, 3, 20, True, True)
5353

5454
def On_Command(self, Player, cmd, args):
5555
# Debug.Log("On_Command(" + Player.Name + ", " + cmd + ", " + args + ")")
56-
Plugin.TryDumpObjToFile("On_Command.Player", Player)
57-
Plugin.TryDumpObjToFile("On_Command.cmd", cmd)
58-
Plugin.TryDumpObjToFile("On_Command.args", args)
56+
Plugin.DumpObjToFile("On_Command.Player", Player, 3, 20, True, True)
57+
Plugin.DumpObjToFile("On_Command.cmd", cmd, 3, 20, True, True)
58+
Plugin.DumpObjToFile("On_Command.args", args, 3, 20, True, True)
5959

6060
def On_Console(self, Player, Arg):
6161
# Debug.Log(Player.Name + " used " + Arg.Class + "." + Arg.Function + " in console ")
62-
Plugin.TryDumpObjToFile("On_Console.Player", Player)
63-
Plugin.TryDumpObjToFile("On_Console.Arg", Arg)
62+
Plugin.DumpObjToFile("On_Console.Player", Player, 3, 20, True, True)
63+
Plugin.DumpObjToFile("On_Console.Arg", Arg, 3, 20, True, True)
6464

6565
def On_DoorUse(self, Player, DoorEvent):
6666
# Debug.Log(Player.Name + " tried to use a door")
6767
# Debug.Log("Succeded? " + ("yes" if DoorEvent.Open else "no"))
68-
Plugin.TryDumpObjToFile("On_DoorUse.Player", Player)
69-
Plugin.TryDumpObjToFile("On_DoorUse.DoorEvent", DoorEvent)
68+
Plugin.DumpObjToFile("On_DoorUse.Player", Player, 3, 20, True, True)
69+
Plugin.DumpObjToFile("On_DoorUse.DoorEvent", DoorEvent, 3, 20, True, True)
7070

7171
def On_EntityDecay(self, DecayEvent):
72-
Plugin.TryDumpObjToFile("On_EntityDecay.DecayEvent", DecayEvent)
72+
Plugin.DumpObjToFile("On_EntityDecay.DecayEvent", DecayEvent, 3, 20, True, True)
7373
return DecayEvent.DamageAmount
7474

75-
def On_EntityDeployed(self, Player, Enity):
76-
Plugin.TryDumpObjToFile("On_EntityDeployed.Player", Player)
77-
Plugin.TryDumpObjToFile("On_EntityDeployed.Enity", Enity)
75+
def On_EntityDeployed(self, Player, Entity):
76+
Plugin.DumpObjToFile("On_EntityDeployed.Player", Player, 3, 20, True, True)
77+
Plugin.DumpObjToFile("On_EntityDeployed.Entity", Entity, 3, 20, True, True)
7878

79-
def On_EntityHurt(self, he):
80-
Plugin.TryDumpObjToFile("On_EntityHurt.HurtEvent", he)
79+
def On_EntityHurt(self, HurtEvent):
80+
Plugin.DumpObjToFile("On_EntityHurt.HurtEvent", HurtEvent, 3, 20, True, True)
8181

82-
def On_EntityDestroyed(self, de):
83-
Plugin.TryDumpObjToFile("On_EntityDestroyed.DestroyEvent", de)
82+
def On_EntityDestroyed(self, DestroyEvent):
83+
Plugin.DumpObjToFile("On_EntityDestroyed.DestroyEvent", DestroyEvent, 3, 20, True, True)
8484

85-
def On_NPCKilled(self, de):
86-
Plugin.TryDumpObjToFile("On_NPCKilled.DeathEvent", de)
85+
def On_NPCKilled(self, DeathEvent):
86+
Plugin.DumpObjToFile("On_NPCKilled.DeathEvent", DeathEvent, 3, 20, True, True)
8787

88-
def On_NPCHurt(self, he):
89-
Plugin.TryDumpObjToFile("On_NPCHurt.HurtEvent", he)
88+
def On_NPCHurt(self, HurtEvent):
89+
Plugin.DumpObjToFile("On_NPCHurt.HurtEvent", HurtEvent, 3, 20, True, True)
9090

91-
def On_PlayerGathering(self, Player, ge):
92-
Plugin.TryDumpObjToFile("On_PlayerGathering.Player", Player)
93-
Plugin.TryDumpObjToFile("On_PlayerGathering.GatherEvent", ge)
91+
def On_PlayerGathering(self, Player, GatherEvent):
92+
Plugin.DumpObjToFile("On_PlayerGathering.Player", Player, 3, 20, True, True)
93+
Plugin.DumpObjToFile("On_PlayerGathering.GatherEvent", GatherEvent, 3, 20, True, True)
9494

95-
def On_PlayerSpawning(self, Player, se):
96-
Plugin.TryDumpObjToFile("On_PlayerSpawn.Player", Player)
97-
Plugin.TryDumpObjToFile("On_PlayerSpawn.SpawnEvent", se)
95+
def On_PlayerSpawning(self, Player, SpawnEvent):
96+
Plugin.DumpObjToFile("On_PlayerSpawning.Player", Player, 3, 20, True, True)
97+
Plugin.DumpObjToFile("On_PlayerSpawning.SpawnEvent", SpawnEvent, 3, 20, True, True)
98+
return Util.CreateVector(SpawnEvent.X, SpawnEvent.Y, SpawnEvent.Z)
9899

99-
def On_PlayerSpawned(self, Player, se):
100-
Plugin.TryDumpObjToFile("On_PlayerSpawned.Player", Player)
101-
Plugin.TryDumpObjToFile("On_PlayerSpawned.SpawnEvent", se)
100+
def On_PlayerSpawned(self, Player, SpawnEvent):
101+
Plugin.DumpObjToFile("On_PlayerSpawned.Player", Player, 3, 20, True, True)
102+
Plugin.DumpObjToFile("On_PlayerSpawned.SpawnEvent", SpawnEvent, 3, 20, True, True)
102103

103-
def On_PlayerKilled(self, de):
104-
Plugin.TryDumpObjToFile("On_PlayerKilled.DeathEvent", de)
104+
def On_PlayerKilled(self, DeathEvent):
105+
Plugin.DumpObjToFile("On_PlayerKilled.DeathEvent", DeathEvent, 3, 20, True, True)
105106

106-
def On_PlayerHurt(self, he):
107-
Plugin.TryDumpObjToFile("On_PlayerHurt.HurtEvent", he)
107+
def On_PlayerHurt(self, HurtEvent):
108+
Plugin.DumpObjToFile("On_PlayerHurt.HurtEvent", HurtEvent, 3, 20, True, True)
108109

109110
def On_PlayerConnected(self, Player):
110-
Plugin.TryDumpObjToFile("On_PlayerConnected.Player", Player)
111+
Plugin.DumpObjToFile("On_PlayerConnected.Player", Player, 3, 20, True, True)
111112

112-
def On_PlayerDisconnected(self, he):
113-
Plugin.TryDumpObjToFile("On_PlayerDisconnected.Player", Player)
113+
def On_PlayerDisconnected(self, Player):
114+
Plugin.DumpObjToFile("On_PlayerDisconnected.Player", Player, 3, 20, True, True)
7.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)