View Issue Details

IDProjectCategoryView StatusLast Update
0005142The Dark ModScript/Defpublic11.09.2021 15:53
ReporterDragofer Assigned To 
PrioritynormalSeveritynormalReproducibilityalways
Status newResolutionopen 
OSWindowsOS Version10 
Product VersionTDM 2.07 
Summary0005142: Calling scripts via console breaks future saves
DescriptionIt's possible to use the console to call scripts, with the syntax: script name_of_script(); This opens up the potential for addons, for example I wanted to make a script that shows the player a message scroll with their current stealth score and other statistics after pressing a hotkey.

However, any save made after the console was used to call a script will not load, throwing the error message "Couldn't load console".
Steps To Reproduce1) Place the 2 attached files in your /darkmod/script folder. This is a 1-line script that prints "test" to the console.
2) In any map, call the script by pasting the following into the console:
script test_message();
3) Save and then load the save. The save won't load, with the error "Couldn't load console".
Additional InformationForum thread where I wanted to make the script that shows a message with stealth statistics:
https://forums.thedarkmod.com/index.php?/topic/20245-view-stealth-score-during-gameplay/page/2/&tab=comments#comment-443361
TagsNo tags attached.
Attached Files
tdm_custom_scripts.script (41 bytes)   
#include "script/tdm_test_message.script"
tdm_custom_scripts.script (41 bytes)   
tdm_test_message.script (143 bytes)   
#ifndef __TDM_TEST_MESSAGE__
#define __TDM_TEST_MESSAGE__

void test_message()
{
	sys.println("test");
}

#endif //__TDM_TEST_MESSAGE__
tdm_test_message.script (143 bytes)   

Relationships

has duplicate 0005755 new Calling script from console ruins saves/loads; says Can't load console 

Issue History

Date Modified Username Field Change
05.02.2020 16:15 Dragofer New Issue
05.02.2020 16:15 Dragofer File Added: tdm_custom_scripts.script
05.02.2020 16:15 Dragofer File Added: tdm_test_message.script
06.02.2020 15:47 Dragofer Summary Calling scripts via console breaks saves => Calling scripts via console breaks future saves
06.02.2020 15:47 Dragofer Description Updated
06.02.2020 15:47 Dragofer Steps to Reproduce Updated
09.02.2020 06:00 stgatilov Note Added: 0012184
11.09.2021 15:53 Dragofer Relationship added has duplicate 0005755