News:

Rings of Reznor!

Main Menu

FF Questions

Started by Miraitto, September 04, 2022, 06:46:02 AM

Previous topic - Next topic

Miraitto

Hello it's me again. I made a new thread to separate the problem I am having between the :ff: and :ffvstr: games. So here we go.

Every time I try to go watch mode on FFX2.6. The game always has this error pop up.


The next problem is. Sometimes even the default attribute flier also has this error. Does anyone ever encounter this 2 problems using FFX2.6 for :ff:?

Miraitto

The error still occurs in my :ff: FFX 2.6. I've checked almost everything. The directory paths, the filenames, missing attributes. It's there but it's not being loaded whenever I play the FFX 2.6 Skirmish Watchmode.

Here is the ffx.py code.

def m25_Enable(event):
    char=event.object
    if Object_Exists(char):
       Object_SetAttr(char, 'enabled', 1)
       Object_SetAttr(char, 'ai_priority', 0)
       if Object_GetAttr(char, 'ai_nostandardai') == 0:
           enable(char)

Epimethee

The Object_GetAttr() is indeed the issue if the attribute doesn't exist, as it simply breaks hence your message) instead of returning a script error or a default value. However the attribute should be initialized at the beginning of the mission for every character (line 55 of m252.py).

When playing a Watch Mode session, does your script.log file contains errors?

FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Miraitto

The game runs fine even with tons of error. I can do rumble room. But I can't use the FFX 2.6. Especially Watchmode because of ai_nostandardai making them stuck and won't move.

The entire error log is too large.
https://www.mediafire.com/file/wihwnyzkkm5jnqw/FF.log/file

Even my :ff: FFEdit is buggy. It won't let me add my custom attribute.

Epimethee

This is the ff.log, which records game-engine level messages. To debug FFX, which uses Python scripting, we need the other log file, script.log.

(And the errors you're getting in FF.logare very much by design: they are what made FFX possible. Dr Mike created attributes the game engine didn't recognize, got error messages in ff.log, set a script to read the names of the attributes from that file and then created behaviours for each attribute.)
FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Miraitto

There are no error messages on the script.log.

Epimethee

Still, could you post the file? It certainly looks like not everything is loading correctly.
FFX add-on for FFvsTTR at ffx.freedomforceforever.com


Epimethee

That's indeed a very short script.log! Since the built-in Flyer attribute causes the crash, this is probably related to the FFQ_checkFlight() function (FFX 3.x uses a very different method to detect flying). It might be due to the exec command. Could you try this?

1. Open the ffx.py file in a plain-text editor (back up the file first!)

2. Change the function FFQ_checkFlight() (lines 13989-14008) to add two print statements after the consequence = consequence + "(char)" line to help identify the bug in script.log:
OLD
def FFQ_checkFlight(char, cause = 0, consequence = ''):
    if FFX_TemplateGetAttr(char, 'canFly') == 0:
        if cshelper.isPlaying():
            RegTimer('OnFFQCheckFlight',2, cause, char, consequence)
        else:
            print 'checking if %s of %s template can fly'%(char, Object_GetTemplate(char))
            createHiddenCopy(char)
            missionobjvar.Object_SetVar(char,'checkFlightAction',[cause, consequence])
    else:
        consequence = consequence + "(char)"
        if FFX_TemplateGetAttr(char, 'canFly') == -1:
            print 'FFQ_checkFlight results:'
            print '    %s of template %s cannot fly'%(char, Object_GetTemplate(char))
            if cause == -1:
                exec consequence
        else: # if == 1
            print 'FFQ_checkFlight results:'
            print '    template %s can fly'%Object_GetTemplate(char)
            if cause == 1:
                exec consequence


NEW
def FFQ_checkFlight(char, cause = 0, consequence = ''):
    if FFX_TemplateGetAttr(char, 'canFly') == 0:
        if cshelper.isPlaying():
            RegTimer('OnFFQCheckFlight',2, cause, char, consequence)
        else:
            print 'checking if %s of %s template can fly'%(char, Object_GetTemplate(char))
            createHiddenCopy(char)
            missionobjvar.Object_SetVar(char,'checkFlightAction',[cause, consequence])
    else:
        consequence = consequence + "(char)"
        print "TEST FFQ_checkFlight"
        print consequence
        if FFX_TemplateGetAttr(char, 'canFly') == -1:
            print 'FFQ_checkFlight results:'
            print '    %s of template %s cannot fly'%(char, Object_GetTemplate(char))
            if cause == -1:
                exec consequence
        else: # if == 1
            print 'FFQ_checkFlight results:'
            print '    template %s can fly'%Object_GetTemplate(char)
            if cause == 1:
                exec consequence


3. Run the mission, and after the error, post the update script.log (since it's going to be short, please post it directly).
FFX add-on for FFvsTTR at ffx.freedomforceforever.com

Miraitto

I will try the code and report when I have the time.

The problem is it doesn't detect FFX 2.6 attributes. All of it are just there but they're not loaded properly. I followed the installation tutorial. :ffvstr: FFX3 works minus a few missions.

My :ff: FFEdit won't let me add new attributes.

I'm using Windows 10 btw.

Maybe it's time for FFX 2.7. jk