Jump to content

TwoBearsHighfiving

Members
  • Posts

    6
  • Joined

  • Last visited

About TwoBearsHighfiving

  • Rank
    New Member
    New Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. This would be the optimal solution. I started developing this a couple days before posting it so it is still in it's infancy. I am looking into many things brought up in this thread and whatever else I can find. We'll see how far this can go.
  2. You are correct, although certain operating systems require the program to be run in administrator mode to alter files that are not in the games directory. I believe Windows is one of them and I think 90% of GZDoom players are on Windows.
  3. Well it already works so I guess it's to late for that. Although it is very obvious if a Wad uses this because you have to start it through a batch file or start the script yourself so it's not like this can be smuggled in with any wad.
  4. This is just an example. I really just wanted to make ACS call a python script, I don't really have a goal it just seems interesting.
  5. Hi, I'm new to Doom modding, but I think I found a way to expand the things you can do with ACS scripts using python. Perhaps this was done before, but to my knowledge this is the first time someone has done this. This paragraph is about how I got the Idea to do this so if you just want the technical stuff you can skip it. I got into Doom modding through the myhouse analysis videos by DavidXNewton. It was really cool how myhouse used the relatively simple ACS scripting language to great effect. I wanted to make some more complex scripts that are beyond the capabilites of ACS so I started with Writing files (haven't figured out reading yet but I'm working on it). To my knowledge ACS scripting does not support writing files to the users computer at all. So I had to get ACS to tell a python script to do so. ACS can't do this, however, there is one way I can get ACS to shout into the void, if you will, so that my Python script can listen for the right things and then execute its functions. It turns out I can make ACS log some text and using a commandline argument to write this log to a text file. My Python script then reads this file and when certain text is written there it executes a certain function. To run both Doom with the log argument and my Python script at the same time I used a batch file. Here is a little demo that uses this algorithm to exteract a text file from a zip when the player picks up a chaingun: ACS: script 1 (void) { Log(s:"Call1"); } Logic.py: import zipfile #Extract file from zip def Pull(target): if getattr(Pull, 'has_run', False): return Pull.has_run = True with zipfile.ZipFile('Data.zip') as zf: zf.extract('Data/'+target, 'Files') print("Pulled: "+target) def Call1(): #do stuff Pull("Text.txt") print("started") while True: with open('log.txt') as log: if 'Call1' in log.read(): print("Here") Pull("Text.txt") print("done") Batch: start gzdoom.exe +logfile log.txt -file Bunker.wad start py Logic.py Here is a video demonstration: https://www.youtube.com/watch?v=-7AghV91gJk Any questions, suggestions or criticism is very welcome. (I posted this on the ZDoom forum under a different name so if you see that don't be confused)
×
×
  • Create New...