Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Calling an executable from a script  (Read 796 times)

pantsentranced

  • Escaped Lunatic
    • View Profile
Calling an executable from a script
« on: April 30, 2016, 12:23:47 am »

I have a top secret plan to make a competitive DF experience.

Every time a certain good is produced I'd like to call an executable which will interface with a server. I'm sure there are nicer ways to do this, but I'd like to make a proof of concept first.

How would you go about running an exe file from within DF?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Calling an executable from a script
« Reply #1 on: April 30, 2016, 01:35:14 am »

What do you plan the executable to do?

pantsentranced

  • Escaped Lunatic
    • View Profile
Re: Calling an executable from a script
« Reply #2 on: April 30, 2016, 02:04:42 am »

Perhaps it's already been done, but my general idea was to set up a system in which two people can play DF against one another online, and when each player crafts certain goods, certain hostile units are spawned near their opponent's fortress, with the objective of the game being to overrun your opponent by producing so much.

The executable I mentioned will establish a connection with a server on the opponent's computer, which will in turn pass the command to dfhack to spawn the unit. It's going to be messy.

Anyway I think rb system('') might do what I want.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Calling an executable from a script
« Reply #3 on: April 30, 2016, 02:11:22 am »

You'll probably just want to write it as a plugin in C++ with DFHack.