View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0005142 | The Dark Mod | Script/Def | public | 05.02.2020 16:15 | 11.09.2021 15:53 | 
| Reporter | Dragofer | Assigned To | |||
| Priority | normal | Severity | normal | Reproducibility | always | 
| Status | new | Resolution | open | ||
| OS | Windows | OS Version | 10 | ||
| Product Version | TDM 2.07 | ||||
| Summary | 0005142: Calling scripts via console breaks future saves | ||||
| Description | It'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 Reproduce | 1) 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 Information | Forum 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  | ||||
| Tags | No tags attached. | ||||
| Attached Files |  tdm_test_message.script (143 bytes)   
 
#ifndef __TDM_TEST_MESSAGE__
#define __TDM_TEST_MESSAGE__
void test_message()
{
	sys.println("test");
}
#endif //__TDM_TEST_MESSAGE__ | ||||
| has duplicate | 0005755 | new | Calling script from console ruins saves/loads; says Can't load console | 
| 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 |