Can I write to file? (Decorate / ACS)

Hello hello!!!

I'm just wondering if it possible to write values to a .txt file (or any other file) via Decorate, ACS or something. Let's say I want to store a value that I want to retrieve after the player closes ZDoom.

Also, can I execute a program (.exe) from ZDoom too? I really forgot why I would want this but yeah, though I throw it in here too.

Thanks and love! hoho

Share this post


Link to post

No; you cannot access the filesystem from a ZDoom mod*. That means no writing or reading files, and certainly no running external programs. The latter especially has no chance of being accepted by the developers:

1. Legitimate uses of such a feature would be not guaranteed to work: "The mod tries to run WindowsProgram.exe, but I use Mac OS/Linux"
2. Abusive uses of such a feature could cause serious damage to one's system: "My antivirus complains about a trojan in the pk3!"



* Exception: you can force an autosave to be written.

Share this post


Link to post

Ohhhhhhh.... Snap! Blam! Shazam!

Ok, thank you Gez, now I need to kill myself...
Haha kidding :)

Share this post


Link to post

I was wondering about this earlier and considering making this same topic. My situation was in ACS; pressing spacebar generated randomish architecture on a grid of squares. So I'd maybe want to keep pressing spacebar until something interesting looking appeared, then "save" that particular data for reuse somehow.

There might be a way, but didn't try: What about when you exit zdoom there's a window that says all the stuff that happened in game apparently.. like "bla picked up a stimpack" and such. So maybe if you print a big array of data, all the values will appear in that window and maybe you can copy/paste from there or something?

Share this post


Link to post
gggmork said:

There might be a way, but didn't try: What about when you exit zdoom there's a window that says all the stuff that happened in game apparently.. like "bla picked up a stimpack" and such. So maybe if you print a big array of data, all the values will appear in that window and maybe you can copy/paste from there or something?

The console history can be saved automatically if you have logging enabled in autoexec.cfg, whether you can get your array data to appear there in a meaningful form is another matter.

Share this post


Link to post
GreyGhost said:

The console history can be saved automatically if you have logging enabled in autoexec.cfg, whether you can get your array data to appear there in a meaningful form is another matter.


I just tried and it actually works (print () makes stuff appear in the console), didn't try the autoexec.cfg portion of that yet but seems like the right next step to take, thanks.

So now I don't have to devise some morse code scheme by alternately picking up armored bonuses and health bonuses or something..

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now