Tools

Post here if you want to help developing something for FAF.

Re: Tools

Postby Ze_PilOt » 06 Jan 2014, 18:00

Seems good enough :)

The main thing is that it does what you want, and that the code is clean enough so you can add functions later.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: Tools

Postby Domino » 06 Jan 2014, 20:00

Hey,

:)
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Tools

Postby Anaryl » 12 Jan 2014, 16:15

I was under the impression that this was never finished.
Image
User avatar
Anaryl
Banned
 
Posts: 453
Joined: 20 Dec 2011, 18:54
Location: Rohangrad
Has liked: 13 times
Been liked: 6 times
FAF User Name: Anaryl

Re: Tools

Postby Domino » 12 Jan 2014, 19:09

Hey,

Dont know what gave you that idea, its still being worked on, infact today I worked on the front end part where you convert any existing map for the editor so you can make missions on it, its all going good
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Tools

Postby Anaryl » 13 Jan 2014, 07:57

Oh I just got the idea from that thread, when the OP stopped replying to DeadMG, that he kinda abandoned the project.

So as I understand it, you can use this function to essentially call in other APIs? I kinda understand the potential, although what APIs/C libs might provide for FA in terms of coding? Like, uh, what's something cool to do with this, or are there any promising APIs out there ??
Image
User avatar
Anaryl
Banned
 
Posts: 453
Joined: 20 Dec 2011, 18:54
Location: Rohangrad
Has liked: 13 times
Been liked: 6 times
FAF User Name: Anaryl

Re: Tools

Postby Domino » 13 Jan 2014, 20:54

ummm, think your in the wrong thread pal, read back a few pages or from the first page lol.. to make sure were talking about the same thing.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Tools

Postby Anaryl » 14 Jan 2014, 22:31

Ha so I am!, sorry the dangers of multiple tabs. Appa loggies.
Image
User avatar
Anaryl
Banned
 
Posts: 453
Joined: 20 Dec 2011, 18:54
Location: Rohangrad
Has liked: 13 times
Been liked: 6 times
FAF User Name: Anaryl

Re: Tools

Postby Domino » 23 Jan 2014, 20:23

Hi zep,

i thought it would be best to get the supcom fa path from the registry and then the person wanting to make a episode of war wouldnt need
to enter it in fa before they begin in the editor, i can then just issue commands to the server with the tables, and completely omit the path
part, because the server will propogate that and append /maps/scenarioid/ ... filename ect..

SO,

how do i set a variable when the server starts that holds the forged alliance path?

i got some code from the net which i have modified, however i am unable to get it to work in prelim tests.

Code: Select all
def showsupcomfapath(self):
        import errno
        import win32com.client
        import _winreg
        shell = win32com.client.Dispatch('WScript.Shell')
        proc_arch = shell.ExpandEnvironmentStrings(r'%PROCESSOR_ARCHITECTURE%').lower()

        if proc_arch == 'x86':
            arch_keys = {0}
        elif proc_arch == 'amd64':
            arch_keys = {_winreg.KEY_WOW64_32KEY, _winreg.KEY_WOW64_64KEY}
        else:
            raise Exception("Unhandled arch: %s" % arch)

        for arch_key in arch_keys:
            key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{31D95937-B237-405D-920C-A3EF4E482395}", 0, _winreg.KEY_READ | arch_key)
            for i in xrange(0, _winreg.QueryInfoKey(key)[0]-1):
                skey_name = _winreg.EnumKey(key, i)
                skey = _winreg.OpenKey(key, skey_name)
                try:
                    print _winreg.QueryValueEx(skey, 'InstallLocation')[0]
                except OSError as e:
                    if e.errno == errno.ENOENT:
                        # DisplayName doesn't exist in this skey
                        pass
                finally:
                    skey.Close()


could you possibly get this code working for me, so that i can return the fa installation path? thanks..

Dave.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Tools

Postby Ze_PilOt » 23 Jan 2014, 21:19

I think the easier thing to do would be to integrate it to FAF lobby.

Not only you will know where the installation folder is, but the miniserver can easily be integrated (so it's transparent for the user), and uploading scenario to the map vault would be trivial too.

But if you want to do it yourself, you can look at the function mostProbablePaths in the lobby code :

https://bitbucket.org/thepilot/modular- ... at=default
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: Tools

Postby Domino » 29 Jan 2014, 17:48

Hey,

zep, how can i make the LOG restart on every startup, so that a new miniserver.log file is wiped and started from fresh on each start up?
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

PreviousNext

Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest