<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=Altering_the_savegame_behaviour_of_TDM</id>
	<title>Altering the savegame behaviour of TDM - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=Altering_the_savegame_behaviour_of_TDM"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Altering_the_savegame_behaviour_of_TDM&amp;action=history"/>
	<updated>2026-05-02T21:18:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Altering_the_savegame_behaviour_of_TDM&amp;diff=33334&amp;oldid=prev</id>
		<title>Datiswous: /* Additional script functions */ typo</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Altering_the_savegame_behaviour_of_TDM&amp;diff=33334&amp;oldid=prev"/>
		<updated>2024-06-07T11:07:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Additional script functions: &lt;/span&gt; typo&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:07, 7 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l91&quot;&gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition, there is&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition, there is&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &#039;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;fload&lt;/del&gt;&#039;&#039;&#039; sys.&#039;&#039;getMissionStatistic&#039;&#039;(&quot;totalSaves&quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &#039;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;float&lt;/ins&gt;&#039;&#039;&#039; sys.&#039;&#039;getMissionStatistic&#039;&#039;(&quot;totalSaves&quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;which will return the number of times saved.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;which will return the number of times saved.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Datiswous</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Altering_the_savegame_behaviour_of_TDM&amp;diff=20856&amp;oldid=prev</id>
		<title>Petike: adding missing category</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Altering_the_savegame_behaviour_of_TDM&amp;diff=20856&amp;oldid=prev"/>
		<updated>2018-10-20T05:32:23Z</updated>

		<summary type="html">&lt;p&gt;adding missing category&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:32, 20 October 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l95&quot;&gt;Line 95:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 95:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--[[User:Obsttorte|Obsttorte]] ([[User talk:Obsttorte|talk]]) 14:35, 11 January 2015 (UTC)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--[[User:Obsttorte|Obsttorte]] ([[User talk:Obsttorte|talk]]) 14:35, 11 January 2015 (UTC)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Editing]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Petike</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Altering_the_savegame_behaviour_of_TDM&amp;diff=18050&amp;oldid=prev</id>
		<title>Obsttorte: This article deals with how the new savegame features in TDM 2.03 can be used.</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Altering_the_savegame_behaviour_of_TDM&amp;diff=18050&amp;oldid=prev"/>
		<updated>2015-01-11T14:35:46Z</updated>

		<summary type="html">&lt;p&gt;This article deals with how the new savegame features in TDM 2.03 can be used.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
From TDM 2.03 on it will be possible for mappers to change the savegame behaviour of the game. This means, that you can restrict the possibilities to save the game in a manner that appears suitable to you and for your FM. These restrictions can be&lt;br /&gt;
&lt;br /&gt;
 - Disallowing quicksaves or manual savings completely&lt;br /&gt;
 - restricting the savegame count to a finite number (like in Project I.G.I. 2 or in the Hitman games series)&lt;br /&gt;
 - using checkpoints instead of manual savings&lt;br /&gt;
 - using consumeable tools to save the game, or objects in the world&lt;br /&gt;
 - and so one&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ve tried to keep the system as simple as possible, to easely allow using it in any desired manner.&lt;br /&gt;
&lt;br /&gt;
== Why restricting the savegames? ==&lt;br /&gt;
&lt;br /&gt;
There has been a long discussion in the forum about this matter, so it may be interesting to first think about its purpose. I would advise any mapper to indeed first think about why they want to use it. Using a feature just because it is available is definetely not the best way to go.&lt;br /&gt;
&lt;br /&gt;
Disallowing the player to save whenever he wants can have several consequences on the gameplay. I just want to list a couple of thinks that come to my mind here:&lt;br /&gt;
&lt;br /&gt;
 - increasing the difficulty&lt;br /&gt;
 - creating tension&lt;br /&gt;
 - supporting tactical gameplay&lt;br /&gt;
 - implementing another kind of reward system (when restricting the number of saves,&lt;br /&gt;
   the player may be able to receive additional ones by fulfilling side-quests etc...)&lt;br /&gt;
&lt;br /&gt;
It is obviously up to the mapper and of course the players on how strong those aspects will take effect. But it is definetely worth thinking about what can be achieved with this, and whether it suits certain types of gameplay or mission paradigmas.&lt;br /&gt;
&lt;br /&gt;
But enogh of the forwords. Let&amp;#039;s get to on how to use it.&lt;br /&gt;
&lt;br /&gt;
== General Setup ==&lt;br /&gt;
&lt;br /&gt;
There are three entities that comes with TDM 2.03 serving the purpose of manipulating the savgame mechanics.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;info/atdm:savegame_admin&amp;#039;&amp;#039;&amp;#039; is the main entity. You do need exactly one of those in you missions to allow for changes in the savegame mechanics.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;targets/atdm:target_savegame&amp;#039;&amp;#039;&amp;#039; is a simple target entity, which will store the game under a name defined in its spawnargs.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;playertools/atdm:playertools_savegame&amp;#039;&amp;#039;&amp;#039; is a base class, which can be extended to create inventory objects that saves the game when consumed.&lt;br /&gt;
&lt;br /&gt;
I will describe all of these in the following sections.&lt;br /&gt;
&lt;br /&gt;
== The savegame admin ==&lt;br /&gt;
&lt;br /&gt;
The main entity provides a couple of spawnargs to alter the savegame mechanics.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;save_permission&amp;#039;&amp;#039;&amp;#039; values: 0(default), 1, 2&lt;br /&gt;
 - 0: no restrictions (default TDM behaviour)&lt;br /&gt;
 - 1: no quicksaves&lt;br /&gt;
 - 2: no manual saving&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;save_count_limit&amp;#039;&amp;#039;&amp;#039; values: an integer (default: -1)&lt;br /&gt;
&lt;br /&gt;
Set this to a non-negative number to restrict the amount of saves to said number.&lt;br /&gt;
&lt;br /&gt;
The entity appears as a blue box of size 16x16x16 in DR. It comes with three script functions.&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;void&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;enableRestriction&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039;float&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;): Dis-/Enables the limitation of the amount of savegames. &lt;br /&gt;
  To disable it, pass zero as argument. &lt;br /&gt;
&lt;br /&gt;
The amount of used saves is stored. So if the player has five saves and used three of them before the restriction gets disabled, enabling the restriction later on will leave him with two saves left, &amp;#039;&amp;#039;&amp;#039;independend on how often he saved the game in between&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;float&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;isRestrictionEnabled&amp;#039;&amp;#039;(): Returns 0 if disabled, 1 if enabled.&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;void&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;addSaves&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039;float&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;saves&amp;#039;&amp;#039;): Gives the player the amount of saves passed as an argumant. &lt;br /&gt;
  Negative numbers will reduce the savegame count left.&lt;br /&gt;
&lt;br /&gt;
The savegame_admin scriptobject is deriveable, which allows you to derive scriptobjects from it to extend or alter its behaviour.&lt;br /&gt;
&lt;br /&gt;
== The target entity ==&lt;br /&gt;
&lt;br /&gt;
The target entity holds the spawnarg &amp;#039;&amp;#039;&amp;#039;savegame_name&amp;#039;&amp;#039;&amp;#039;. The entity will save the game under said name (possible overwriting an older savegame with the same name). If no name is said, the game won&amp;#039;t get saved and a warning gets printed to the console.&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;WARNING:&amp;#039;&amp;#039;&amp;#039; savegame_name not set on entity &amp;#039;&amp;#039;entity_name&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;entity_name&amp;#039;&amp;#039; is the name of the entity. Use this information to find the entity in DR and fix the problem.&lt;br /&gt;
&lt;br /&gt;
The entity does not provide additional script functions.&lt;br /&gt;
&lt;br /&gt;
== The playertool ==&lt;br /&gt;
&lt;br /&gt;
The playertool entity is completely set up from the functional side. Derive an entity from it and set spawnargs like &amp;#039;&amp;#039;inv_name&amp;#039;&amp;#039; or &amp;#039;&amp;#039;inv_icon&amp;#039;&amp;#039; on it. It doesn&amp;#039;t provide additional script functions.&lt;br /&gt;
&lt;br /&gt;
== Additional script functions ==&lt;br /&gt;
&lt;br /&gt;
There are three more script functions left. You will normally not need them, except you are going to implement a more complex setup.&lt;br /&gt;
&lt;br /&gt;
The player entity has two additional script functions. You can call them on the player (&amp;#039;&amp;#039;player1&amp;#039;&amp;#039;).&lt;br /&gt;
  - &amp;#039;&amp;#039;&amp;#039;void&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;saveGame&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039;string&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;savename&amp;#039;&amp;#039;): Saves the game under set name&lt;br /&gt;
  - &amp;#039;&amp;#039;&amp;#039;void&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;setSavePermissions&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039;float&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;permission&amp;#039;&amp;#039;): corresponds to the &amp;#039;&amp;#039;save_permission&amp;#039;&amp;#039; spawnarg on the &lt;br /&gt;
  admin entity above&lt;br /&gt;
&lt;br /&gt;
In addition, there is&lt;br /&gt;
  &amp;#039;&amp;#039;&amp;#039;fload&amp;#039;&amp;#039;&amp;#039; sys.&amp;#039;&amp;#039;getMissionStatistic&amp;#039;&amp;#039;(&amp;quot;totalSaves&amp;quot;)&lt;br /&gt;
which will return the number of times saved.&lt;br /&gt;
&lt;br /&gt;
--[[User:Obsttorte|Obsttorte]] ([[User talk:Obsttorte|talk]]) 14:35, 11 January 2015 (UTC)&lt;/div&gt;</summary>
		<author><name>Obsttorte</name></author>
	</entry>
</feed>