Author Topic: [PSX/PC] General editor - Hades Workshop (0.50b)  (Read 844626 times)

Bonez

  • Cosmo Memory Dev
  • Global moderator
  • *
  • Posts: 264
  • What goes here?
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1850 on: 2022-06-02 07:38:53 »
@Trilititi helooo ??? fucking answer you dick , this bullshit about ignore people's messages must end once and for all

 ::) Couldn't wait 5 whole days for a reply... @Tirlititi don't worry about answering him. He obviously has issues. He's already been banned before for this exact reason. He subverted the ban but is gone again.

Normally I would have deleted his last post and just banned him quietly, but considering he wrote you a novel, I didn't want you to put any work or thought into any replies to him without being aware.
« Last Edit: 2022-06-02 08:04:06 by Bonez »

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1851 on: 2022-06-02 10:31:21 »
I am obviously not going to answer his new questions.

@carl09876: I don't know what is your age or your situation, so I'm not going to lecture you on how to behave, on the internet or elsewhere. I'll only say that, without even considering the insult, I have been thinking that you don't pay attention to what people write to you and mostly ignore them. It is very dishonest of you to accuse someone else of doing that.

Seramera

  • *
  • Posts: 4
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1852 on: 2022-06-10 16:53:02 »
Hello,
working with field scripts right now. I want to make a window on the bottom of the screen, which shows a token string of a random field that the field exit will lead to.
Now the textwindow should disappear when the player leaves the Region on the walkmesh, but that is kinda hard to handle since there is no boolean "isinregion" or sth like that.
this is my approach so far:
region range loop opening textbox if globool1 false, set true then
Code: [Select]
Function Region16_Range
    if ( VAR_GlobBool_1 == 0 ) {
        SetTextVariable( 0, 1 )
        WindowAsync( 0, 4, 9 )
        set VAR_GlobBool_1 = 1
    }
    return

loop code for globool1 waiting ticks until its set false
Code: [Select]
Function Code1_Loop
    if ( VAR_GlobBool_1 == 1 ) {
        set VAR_GlobUInt8_1++
    }
    if ( VAR_GlobUInt8_1 == 59 ) {
        set VAR_GlobBool_1 = 0
        set VAR_GlobUInt8_1 = 0
    }
    Wait( 1 )
    loop
Code: [Select]
[STRT=160,1][TAIL=LOC][IMME]press x to go to[WDTH=0,160,6,0,-1][TEXT=0,0][TIME=60]
if anyone know if there is a better way, im glad to read.

less important Question1: im declaring global and local variables, which i dont see written in the edited field script. like globool_1 in this case. Might it be used in the backengine?
less important Question2: came up bcs i saw, especially in the worldmap scripts, stuff going on not happening in the scripts, like the alexandria worldmap model dependency on the scenariocounter, which is not articulated in the script.

less important Question3: Is there a way to edit 300:IceCavern Entrance or Daguerro? they seem independent
less important Question4: Is there a way to edit "field" 70 to have the "new game" button open an other field than 50:Primavista, as of now when i edit it i cant save the mod in .hws
« Last Edit: 2022-06-10 17:02:25 by Seramera »

Seramera

  • *
  • Posts: 4
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1853 on: 2022-06-10 17:32:38 »
also here is a rather lazy written code for a world moogle dialog option that will get you around town and change scenario counter. applies to WorldMap:Hilda Garde 3. just take care you hit the spot and not get lost in the void ;D
Code: [Select]
Function World_Moogle_27
    RunWorldCode( 35, 1 )
    set VAR_LocUInt8_20 = GetData_199
    set VAR_LocUInt8_19 = GetRandom
    set VAR_LocUInt8_0 = ( 192 - ( VAR_LocUInt8_20 + VAR_LocUInt8_19 ) )
    TurnInstant( Op60(ObjectUID_250) )
    set VAR_LocUInt8_21 = 1
    set VAR_LocUInt8_22 = 0
    while ( VAR_LocUInt8_22 < 10 ) {
        set VAR_LocInt24_1 = ( ( Cos(VAR_LocUInt8_0) * 2 ) + ( ( ( Cos(VAR_LocUInt8_0) * 4 ) - ( Cos(VAR_LocUInt8_0) * 2 ) ) / VAR_LocUInt8_21 ) )
        set VAR_LocInt24_4 = ( ( Sin(VAR_LocUInt8_0) * 2 ) + ( ( ( Sin(VAR_LocUInt8_0) * 4 ) - ( Sin(VAR_LocUInt8_0) * 2 ) ) / VAR_LocUInt8_21 ) )
        MoveInstantXZY( GetEntryPosX(250) + VAR_LocInt24_1, GetEntryPosZ(255), GetEntryPosY(250) + VAR_LocInt24_4 )
        set VAR_LocUInt8_21 = ( VAR_LocUInt8_21 + 1 )
        if ( VAR_LocUInt8_22 == 0 ) {
            MoveInstantXZY( GetEntryPosX(250) + VAR_LocInt24_1, 2000, GetEntryPosY(250) + VAR_LocInt24_4 )
        } else {
            SetObjectFlags( 7 )
        }
        Wait( 1 )
        set VAR_LocUInt8_22++
    }
    set VAR_LocInt24_1 = ( Cos(VAR_LocUInt8_0) * 2 )
    set VAR_LocInt24_4 = ( Sin(VAR_LocUInt8_0) * 2 )
    MoveInstantXZY( GetEntryPosX(250) + VAR_LocInt24_1, GetEntryPosZ(255), GetEntryPosY(250) + VAR_LocInt24_4 )
    SetObjectFlags( 7 )
    set VAR_LocInt24_7 = ( Cos(VAR_LocUInt8_0) / 3 )
    set VAR_LocInt24_10 = ( Sin(VAR_LocUInt8_0) / 3 )
    RunScriptAsync( 4, 4, 34 )
    InitWalk(  )
    Walk( GetEntryPosX(250) + VAR_LocInt24_7, GetEntryPosY(250) + VAR_LocInt24_10 )
    SetWalkSpeed( 60 )
    RunScriptAsync( 4, 4, 35 )
    TurnInstant( GetEntryAngle(7) - 64 )
    RunAnimation( 6151 )
    set VAR_LocInt24_13 = ( Cos(VAR_LocUInt8_0) / 8 )
    set VAR_LocInt24_16 = ( Sin(VAR_LocUInt8_0) / 8 )
    InitWalk(  )
    Walk( GetEntryPosX(250) + VAR_LocInt24_13, GetEntryPosY(250) + VAR_LocInt24_16 )
    set VAR_LocInt8_25 = 0
    while ( VAR_LocInt8_25 >= 0 ) {
        RunWorldCode( 16, 6 )
        RunWorldCode( 17, 126 )
        RunWorldCode( 20, 0 )
        WindowAsync( 5, 4, 42 )
        do {
            Wait( 1 )
        } while ( !IsButton(196608L) )
        CloseWindow( 5 )
        if ( ( GetDialogChoice == 3 ) && IsButton(131072L) ) {
            RunWorldCode( 16, 39 )
            RunWorldCode( 17, 126 )
            RunWorldCode( 20, 0 )
        }
        switch 4 ( GetDialogChoice ) from 0 {
        case +0:
            set VAR_LocUInt8_24 = 0
            RunWorldCode( 16, 39 )
            RunWorldCode( 17, 126 )
            RunWorldCode( 20, 0 )
            WindowAsync( 5, 4, 43 )
            do {
                Wait( 1 )
            } while ( !IsButton(196608L) )
            CloseWindow( 5 )
            if ( ( GetDialogChoice == 1 ) && IsButton(131072L) ) {
                RunWorldCode( 16, 39 )
                RunWorldCode( 17, 126 )
                RunWorldCode( 20, 0 )
            }
            switch 2 ( GetDialogChoice ) from 0 {
            case +0:
                RunWorldCode( 16, 5 )
                RunWorldCode( 17, 126 )
                RunWorldCode( 20, 0 )
                WindowSync( 5, 4, 45 )
                while ( GetData_200 ) {
                    Wait( 1 )
                }
                RunWorldCode( 39, 0 )
                Menu( 4, 0 )
                RunWorldCode( 40, 0 )
                set VAR_LocUInt8_23 = 2
                break
            case +1:
                set VAR_LocUInt8_23 = 1
                break
            }
            break
        case +1:
            set VAR_LocUInt8_24 = 0
            RunWorldCode( 16, 39 )
            RunWorldCode( 17, 126 )
            RunWorldCode( 20, 0 )
            set VAR_GlobUInt8_42 = GetItemCount(253)
            if ( !VAR_GlobUInt8_42 ) {
                WindowSync( 5, 4, 46 )
            } else {
                SetTextVariable( 1, VAR_GlobUInt8_42 )
                WindowAsync( 5, 4, 44 )
                do {
                    Wait( 1 )
                } while ( !IsButton(196608L) )
                CloseWindow( 5 )
                if ( ( GetDialogChoice == 1 ) && IsButton(131072L) ) {
                    RunWorldCode( 16, 39 )
                    RunWorldCode( 17, 126 )
                    RunWorldCode( 20, 0 )
                }
                switch 2 ( GetDialogChoice ) from 0 {
                case +0:
                    RemoveItem( 253, 1 )
                    RunScriptAsync( 5, 4, 37 )
                    FadeFilter( 2, 24, 0, 255, 255, 255 )
                    Wait( 25 )
                    RunScriptAsync( 5, 7, 38 )
                    RunScriptAsync( 5, 250, 38 )
                    RunScriptSync( 5, 10, 40 )
                    FadeFilter( 3, 16, 0, 0, 0, 0 )
                    Wait( 40 )
                    FadeFilter( 2, 24, 0, 255, 255, 255 )
                    Wait( 25 )
                    RunScriptAsync( 5, 10, 41 )
                    RunScriptAsync( 5, 7, 39 )
                    RunScriptSync( 5, 250, 39 )
                    FadeFilter( 3, 16, 0, 0, 0, 0 )
                    Wait( 20 )
                    set VAR_LocUInt8_23 = 2
                    break
                case +1:
                    set VAR_LocUInt8_23 = 1
                    break
                }
            }
            break
        case +2:
            WindowAsync( 5, 4, 90 )
            do {
                Wait( 1 )
            } while ( !IsButton(196608L) )
            CloseWindow( 5 )
            if ( ( GetDialogChoice == 1 ) && IsButton(131072L) ) {
                RunWorldCode( 16, 39 )
                RunWorldCode( 17, 126 )
                RunWorldCode( 20, 0 )
            }
//Dialog Option starts here
            switch 2 ( GetDialogChoice ) from 0 {
            case +0:
                set VAR_LocInt24_2 = 0
                set VAR_LocInt24_5 = 1
                set VAR_LocInt24_6 = 0
                SetTextVariable( 5, VAR_LocInt24_2 )
                SetTextVariable( 6, VAR_LocInt24_5 )
                SetTextVariable( 4, General_ScenarioCounter )
                WindowAsync( 5, 4, 10 )
                do {
                    if ( IsButton(16) ) {
                        if ( VAR_LocInt24_5 == 1000 ) {
                            set VAR_LocInt24_5 = 1000
                        }
                        if ( VAR_LocInt24_5 == 100 ) {
                            set VAR_LocInt24_5 = 1000
                        }
                        if ( VAR_LocInt24_5 == 10 ) {
                            set VAR_LocInt24_5 = 100
                        }
                        if ( VAR_LocInt24_5 == 1 ) {
                            set VAR_LocInt24_5 = 10
                        }
                        SetTextVariable( 6, VAR_LocInt24_5 )
                    }
                    if ( IsButton(64) ) {
                        if ( VAR_LocInt24_5 == 1 ) {
                            set VAR_LocInt24_5 = 1
                        }
                        if ( VAR_LocInt24_5 == 10 ) {
                            set VAR_LocInt24_5 = 1
                        }
                        if ( VAR_LocInt24_5 == 100 ) {
                            set VAR_LocInt24_5 = 10
                        }
                        if ( VAR_LocInt24_5 == 1000 ) {
                            set VAR_LocInt24_5 = 100
                        }
                        SetTextVariable( 6, VAR_LocInt24_5 )
                    }
                    if ( IsButton(128) ) {
                        set VAR_LocInt24_2 = ( VAR_LocInt24_2 - VAR_LocInt24_5 )
                        SetTextVariable( 5, VAR_LocInt24_2 )
                    }
                    if ( IsButton(32) ) {
                        set VAR_LocInt24_2 = ( VAR_LocInt24_2 + VAR_LocInt24_5 )
                        SetTextVariable( 5, VAR_LocInt24_2 )
                    }
                    if ( IsButton(8) ) {
                        set General_ScenarioCounter = VAR_LocInt24_2
                    }
                    Wait( 1 )
                } while ( !IsButton(196608L) )
                break
            case +1:
                set VAR_LocInt24_2 = 0
                set VAR_LocInt24_5 = 1
                set VAR_LocInt24_6 = 0
                SetTextVariable( 5, VAR_LocInt24_2 )
                SetTextVariable( 6, VAR_LocInt24_5 )
                WindowAsync( 5, 4, 9 )
                do {
                    if ( IsButton(16) ) {
                        if ( VAR_LocInt24_5 == 1000 ) {
                            set VAR_LocInt24_5 = 1000
                        }
                        if ( VAR_LocInt24_5 == 100 ) {
                            set VAR_LocInt24_5 = 1000
                        }
                        if ( VAR_LocInt24_5 == 10 ) {
                            set VAR_LocInt24_5 = 100
                        }
                        if ( VAR_LocInt24_5 == 1 ) {
                            set VAR_LocInt24_5 = 10
                        }
                        SetTextVariable( 6, VAR_LocInt24_5 )
                    }
                    if ( IsButton(64) ) {
                        if ( VAR_LocInt24_5 == 1 ) {
                            set VAR_LocInt24_5 = 1
                        }
                        if ( VAR_LocInt24_5 == 10 ) {
                            set VAR_LocInt24_5 = 1
                        }
                        if ( VAR_LocInt24_5 == 100 ) {
                            set VAR_LocInt24_5 = 10
                        }
                        if ( VAR_LocInt24_5 == 1000 ) {
                            set VAR_LocInt24_5 = 100
                        }
                        SetTextVariable( 6, VAR_LocInt24_5 )
                    }
                    if ( IsButton(128) ) {
                        set VAR_LocInt24_2 = ( VAR_LocInt24_2 - VAR_LocInt24_5 )
                        SetTextVariable( 5, VAR_LocInt24_2 )
                    }
                    if ( IsButton(32) ) {
                        set VAR_LocInt24_2 = ( VAR_LocInt24_2 + VAR_LocInt24_5 )
                        SetTextVariable( 5, VAR_LocInt24_2 )
                    }
                    if ( IsButton(8) ) {
                        Field( VAR_LocInt24_2 )
                    }
                    Wait( 1 )
                } while ( !IsButton(196608L) )
                break
            }
            break
        case +3:
            switch 2 ( VAR_LocUInt8_23 ) from 1 {
            case +0:
                WindowAsync( 5, 4, 47 )
                break
            case +1:
                WindowAsync( 5, 4, 48 )
                break
            default:
                if ( VAR_LocUInt8_24 < 8 ) {
                    WindowAsync( 5, 4, 50 )
                } else {
                    if ( VAR_LocUInt8_24 == 8 ) {
                        WindowAsync( 5, 4, 51 )
                    } else {
                        if ( VAR_LocUInt8_24 == 12 ) {
                            WindowAsync( 5, 4, 52 )
                        } else {
                            if ( VAR_LocUInt8_24 >= 16 ) {
                                WindowAsync( 5, 4, 49 )
                            } else {
                                WindowAsync( 5, 4, 50 )
                            }
                        }
                    }
                }
                break
            }
            if ( ( !VAR_LocUInt8_23 ) && ( VAR_LocUInt8_24 < 32 ) ) {
                set VAR_LocUInt8_24 = ( VAR_LocUInt8_24 + 1 )
            }
            RunScriptSync( 5, 7, 42 )
            set VAR_LocInt8_25 = 65535
            set VAR_LocUInt8_23 = 0
            break
        }
        Wait( 1 )
    }
    return
Code: [Select]
[STRT=167,5][TAIL=DEFT][WDTH=0,61,64,0,64,1,-1][IMME][D06050][HSHD] [C8B040][HSHD]Set Field()
[68C0D8][HSHD]New=[NUMB=5], Increment=[NUMB=6]
[DBTN=START]: Overwrite[TIME=-1]
Code: [Select]
[STRT=167,5][TAIL=DEFT][WDTH=0,61,64,0,64,1,-1][IMME][D06050][HSHD] [C8B040][HSHD]Set Scenario Counter()
[68C0D8][HSHD]Old=[NUMB=4], New=[NUMB=5], Increment=[NUMB=6]
[DBTN=START]: Overwrite[TIME=-1]
Code: [Select]
[STRT=136,3][TAIL=UPC][PCHC=2,1][IMME]Debug?
[CHOO][MOVE=18,0]Scenario Counter
[MOVE=18,0]Field[TIME=-1]
« Last Edit: 2022-06-10 18:20:22 by Seramera »

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1854 on: 2022-06-13 08:54:25 »
Hi Seramera,
Congrats on doing all that already. That's really neat.

Many script variables are indeed used by the back engine. The scenario counter (General_ScenarioCounter) is used indeed a lot (for city destroyed and whether Iifa roots expand to post-Terra spots on the World Map, but also whether Garnet has long or short hair and surely I'm missing some). The friendly flags (FriendlyMonster_Progress and the first bit of Ragtime_QuizzSuccess) disable the possibility to encounter those friendly monsters. The pepper spot flags (Chocobo_ParadiseFound and Chocobo_MognetFound) change the appearance of the entrance on the world map etc...
The "General" variables are usually the ones used by the engine. It sometimes happens that the engine fetch local or global variables for "hotfixes", especially on the Steam version of the game. At the end of the day, that's very rare though so you'll most likely never get to one of these instances. Here's an example of such hotfix that can be found in the engine's source code: it increases the score of the Blank sword fight minigame by checking that the field map is 64 (A. Castle/Public Seats), that the running script is a function of the object 4 (Code4_Init or Code4_Loop) and even the exact binary position of the code executed (after the normal score is computed but before the "SetTextVariable" line). So you can see in that example that hotfixes are very specific: you'll almost surely won't have issues because of them. Also, these hotfixes aside, script variables (local or global) are never used by the engine so you can't mess with it by using "VAR_GlobBool_1" especially if it weren't used in the field's script already.

I don't have a complete list of these hotfixes or how the engine uses general-type variables for purposes like the ones you spotted.
Unfortunatly, these uses are spread in the code and hard to interpret.

I don't understand your 3rd question. Ice Cavern's Entrance and Daguerro's field scripts should be editable like any other. I'll check if there is a problem with these but there shouldn't.

I am currently working on an update of the tool that will fix the issues with the field 70: Opening for FMV (among other things).

I don't know of a better way to check if the player character is in the region. I think that your solution is actually the best suited and fits with the spirit of programming tricks they usually used.

(By the way, Global-type variables can be used up to index 79. If you use "VAR_GlobUInt8_80", it will get out of the array range and probably at least throw an exception on Steam, effectively at least terminating the script function, or have an unexpected behaviour on the PSX version. I'm not sure if that limit is documented correctly in the tool.)

Seramera

  • *
  • Posts: 4
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1855 on: 2022-06-18 04:13:53 »
Hello Tirlititi,
thank you for the elaborate answer.
Having built the Randomizer and other stuff, I indeed found out some Variables are used in the back engine.
It got me burst out laughing when i suddenly swapped control with the npc I interacted with. Bugs can be funny creatures. :-D

So the method (that works for me now) is to look for Variables that are already used on the field, but dont interfere with the added use, instead of searching for unused variables.

Here is a little Speak Script that i use to test Battles.

Code: [Select]
Function YoungWomanB_SpeakBTN
    ifnot ( IsMovementEnabled ) {
        return
    }
    set VAR_GlobBool_158 = 0
    if ( VAR_GlobBool_159 == 1 ) {
        DisableMove(  )
        if ( VAR_GlobBool_144 == 0 ) {
            DisableMenu(  )
        } else {
            Wait( 1 )
        }
    }
    SetTriangleFlagMask( 127 )
    WaitTurn(  )
    set VAR_GlobUInt8_16 = GetEntryAngle(255)
    TurnTowardObject( 250, 32 )
    WaitTurn(  )
    WindowSync( 5, 2, 2 )
    switch 1 ( GetDialogChoice ) from 0 {
    case +0:
        set VAR_GlobInt16_6 = 0
        set VAR_GlobInt16_4 = 1
        set VAR_GlobBool_21 = 0
        SetTextVariable( 4, VAR_GlobBool_21 )
        SetTextVariable( 5, VAR_GlobInt16_6 )
        SetTextVariable( 6, VAR_GlobInt16_4 )
        WindowAsync( 5, 4, 3 )
        do {
            if ( IsButton(16) ) {
                if ( VAR_GlobInt16_4 == 1000 ) {
                    set VAR_GlobInt16_4 = 1000
                }
                if ( VAR_GlobInt16_4 == 100 ) {
                    set VAR_GlobInt16_4 = 1000
                }
                if ( VAR_GlobInt16_4 == 10 ) {
                    set VAR_GlobInt16_4 = 100
                }
                if ( VAR_GlobInt16_4 == 1 ) {
                    set VAR_GlobInt16_4 = 10
                }
                SetTextVariable( 6, VAR_GlobInt16_4 )
            }
            if ( IsButton(64) ) {
                if ( VAR_GlobInt16_4 == 1 ) {
                    set VAR_GlobInt16_4 = 1
                }
                if ( VAR_GlobInt16_4 == 10 ) {
                    set VAR_GlobInt16_4 = 1
                }
                if ( VAR_GlobInt16_4 == 100 ) {
                    set VAR_GlobInt16_4 = 10
                }
                if ( VAR_GlobInt16_4 == 1000 ) {
                    set VAR_GlobInt16_4 = 100
                }
                SetTextVariable( 6, VAR_GlobInt16_4 )
            }
            if ( IsButton(128) ) {
                set VAR_GlobInt16_6 = ( VAR_GlobInt16_6 - VAR_GlobInt16_4 )
                SetTextVariable( 5, VAR_GlobInt16_6 )
            }
            if ( IsButton(32) ) {
                set VAR_GlobInt16_6 = ( VAR_GlobInt16_6 + VAR_GlobInt16_4 )
                SetTextVariable( 5, VAR_GlobInt16_6 )
            }
            if ( IsButton(8) ) {
                if ( VAR_GlobBool_21 == 0 ) {
                    set VAR_GlobBool_21 = 1
                    SetTextVariable( 4, VAR_GlobBool_21 )
                } else {
                    set VAR_GlobBool_20 = 0
                    SetTextVariable( 4, VAR_GlobBool_21 )
                }
            }
            Wait( 1 )
        } while ( ( !IsButton(196608L) )  )
        break
    default:
        break
    }
    Wait( 5 )
    if ( VAR_GlobBool_21 == 1 ) {
        Battle( 0, VAR_GlobInt16_6 )
    }
    CloseAllWindows(  )
    0xA9( 250 )
    set VAR_GlobBool_158 = 1
    if ( VAR_GlobBool_159 == 1 ) {
        if ( VAR_GlobBool_156 == 0 ) {
            EnableMove(  )
            SetTriangleFlagMask( 255 )
            if ( VAR_GlobBool_144 == 0 ) {
                EnableMenu(  )
            }
        }
    }
    TimedTurn( VAR_GlobUInt8_16, 16 )
    WaitTurn(  )
    return
Code: [Select]
[STRT=100,3][IMME]What u wanna do?
[CHOO=2,1] Go Battle
Nothing
Code: [Select]
[STRT=200,4] [IMME]Increment: [NUMB=6] Destination: [NUMB=5]
startbattlebool: [NUMB=4] (0=no, 1=yes)
[JCBT=START] change startbattlebool
[JCBT=UP] [JCBT=DOWN]Increment[JCBT=LEFT] [JCBT=RIGHT]Destination

I'll report when I'm stuck elsewhere or have finished sth playable.
« Last Edit: 2022-06-18 05:30:52 by Seramera »

stir472

  • *
  • Posts: 18
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1856 on: 2022-07-07 22:25:09 »
Hello to the whole community, I wanted to thank you Tirlititi for this incredible tool. I am creating a difficulty mod thanks to your tool and I am learning how to implement npcs. With the latter I have a big problem, when I try to add an npc. I don't know how to add the npc function, for example, if there is Man_A in a scenario and I want to introduce a second NPC called Man_B, I can't change the name of the functions. When you have time can you tell me how I can do it? Thanks in advance. (the english not is my native languaje sorry >.<)

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1857 on: 2022-07-08 12:38:15 »
Hello stir472.

The name of the function is automatically using the entry's model. You can't change it indeed: it's automatically set when it finds a line "SetModel" in the entry's functions.

In order to add a NPC, first get off the "Edit Script" window and start by adding an entry in the "Edit Entries" window. Set that entry's type to "Object" (I think it is the type number "2" if I recall correctly), remember the newly added entry's ID and confirm.
Then only, go back to the "Edit Script" window and right-click on the function list to add a function. Select the newly added entry and create a function of type "0" (the "_Init" function). In there, add the code to initialize your NPC (you can copy/paste the content of another "_Init" function of an object-type entry and change the positions and the "SetModel" value). Also add a line "InitObject" in the "Main_Init" function to actually initialize it when entering the screen.
Then add whatever code you want for your NPC (most likely, add a function of type "talk button").

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1858 on: 2022-07-22 11:06:50 »
Update to v0.43.
That's a big update, with several new features, half of which I still don't know why I did them and who will ever really use them...

- Added a Damage Calculator: that's something I wanted for a long time. It doesn't take into account the enemy's elemental boost bug in the PSX version so it can be inaccurate for a couple of enemy attacks depending on the language you play (in PSX, enemies can benefit from elemental boosts but that depends on the language, eg. Sealion has a Water boost but only in the PSX japanese version).

- Added a Walkmesh editor, a Walkmesh OBJ exporter and a Walkmesh OBJ importer. Now walkmeshes can be (almost) fully edited. The editor of the tool is not very convenient or practical, but it allows to change path flags that cannot be passed to an OBJ model. The addition of this editor makes the script editor a bit more convenient regarding the functions "EnablePathTriangle" and "EnablePath" as you can now double-click on the 3D model of the walkmesh to select the triangle/walkpath you want to enable/disable.
Although the walkmesh editor is accessible for both the Steam and the PSX version, it is very buggy on the PSX version and sometimes place newly-added triangles at random positions in-game.

- Added "command" version of the tool. It is a fake command-line version because it still uses an interface but it allows HW to be used by external programs by providing it a sequence of commands written into a file. In the ZIP, I added a file, "CommandSample.txt", that shows how to use this feature and should run fine if you have the Steam version of the game installed.

- Added the options "Memoria -> Export as Custom Field/Battle". These take an existing field or battle and simply create Steam assets (same as "Save Steam Mod" with the option "Raw Assets") with the correct paths and filenames so they can be used by Memoria as additional fields/battles without the need to replace existing ones. I tested a adding a custom field and that worked correctly.
In addition to using that option, creating a custom field/battle requires:
-- reference them in another script, adding a "Field" or "Battle" line using that custom field/battle's script ID,
-- create a file "DictionaryPatch.txt" in your mod folder and copy/paste a line that Hades Workshop provides,
-- for fields, you need to edit the files "[ModFolder]/FF9_Data/embeddedasset/text/[LANG]/location/loc_name.mes" and adding an entry for specifying the custom field's name (these files are generated when you have modified another field name and saved Steam mod with "Raw Assets" and they can be edited with a text editor).
I guess that the convenient workflow for making a mod with custom fields/battles is to have 2 HWS files: one without the custom fields/battles but with all other modifications and the scripts referencing to custom IDs, a the other HWS with only custom fields/battles (because you can't add fields/battles in the lists in Hades Workshop, so you can't have the base field/battle and the custom field/battle simultaneously).
The assets generated this way are not removed when generating a Steam mod (except if you picked the same identifiers as existing fields/battles, which is not advised).

- Added a couple of datas that can be changed in field backgrounds: the depths and positions of tiles (individual tiles or tile sets) can now be changed. I think that most (all?) bug fixes provided by the Moguri mod concerning incorrect tile depths (as described in this topic) could be done using that feature instead of editing the scripts (and potentially make mod compatibility more difficult).

- Fixed several bugs and added several improvements. The world map battle spots or place names should now work correctly (both when saving HWS files and generating Steam mods). "Opening-for-FMV" should not cause any problem anymore. Several script functions were given a name and description instead of the "0xXX" default names. Script batch exporting are a bit better commented because entries are correctly named in the Main_Init function (typically the "InitObject" lines). etc.
« Last Edit: 2022-07-22 11:13:00 by Tirlititi »

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1859 on: 2022-08-12 00:02:53 »
Thank you for your work. Tell me please. Is it possible to overcome the limit of hit points for the mark 65535? In the editor, this is the maximum value...  :-(

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.41f)
« Reply #1860 on: 2022-08-12 08:11:04 »
No, it's not possible to overcome that limit with HW but you can bypass it using a trick (basically healing the enemy to simulate a max health increase; that's what I did for my own mod for Necron).

On the Steam version of the game, using Albeoris's Memoria tool, it is possible to really overcome the max HP limit without any drawback or side effect. It is not very convenient to do it right now but it should be better relatively soon, and when that comes the information will be provided in the wiki (it doesn't explain how to do that yet).

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1861 on: 2022-08-12 08:45:40 »
Thank you, we will be waiting! I saw your article about it. Just didn't understand you need to open a text document AbilityFeatures.txt or something else to correct the CIL code? Sorry, I'm new to this, and I'm only using Hades Workshop now. I want to learn more))).    :-P

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1862 on: 2022-08-13 14:59:46 »
"Examples of equipment passive effects
Those must be included in the >SA Global or >SA GlobalLast section in order not to be bound to any supporting ability."





For examples, in my AbilityFeatures.txt it looks like:

">SA 62 Bandit (effect is coded in 0058_StealScript.cs)

>SA 63 Void

>SA
GlobalLast
Permanent
Code: (Condition) [Select]
WeaponId == 74
Code: (MaxMP) [Select]
MaxMP + MaxMP / 2 "

I don't understand how to make it works...

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1863 on: 2022-08-13 23:08:30 »
The "code" tag is problematic with the forum's tag, so it's not obvious to read your message.
However, I think that your only problem is that ">SA" and "GlobalLast" are not on the same line. You must have:
Code: [Select]
>SA GlobalLast
Permanent
etc...
and not:
Code: [Select]
>SA
GlobalLast
Permanent
etc...

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1864 on: 2022-08-14 12:51:33 »
I wrote the code on your recommendation, I attach a screenshot.  I didn't get the expected effect. Maybe the problem is that I'm writing code in the wrong file or place? I will be grateful for the help, I did not find an example.


Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1865 on: 2022-08-15 09:40:08 »
That code works perfectly fine when I try it (the weapon 74 is Vivi's Oak Staff).
How did you update Memoria?

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1866 on: 2022-08-15 09:55:20 »
I used Memoria.Compiler.exe . Files have been updated ==> (D:\Final Fantasy IX\StreamingAssets\Scripts). But I haven't moved them anywhere. Copies of these files are nowhere to be found.

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1867 on: 2022-08-17 06:56:42 »
I used Memoria.Compiler.exe . Files have been updated ==> (D:\Final Fantasy IX\StreamingAssets\Scripts). But I haven't moved them anywhere. Copies of these files are nowhere to be found.

#######################################################################################################

Good Morning! I have studied a lot of your articles. I tried to write some interesting scripts to change the number of attacks, the amount of critical damage, and they work.

But attempts to add effects to weapons using ">SA GlobalLast" did not lead to anything. I studied Git and tried to update the Memoria with a patch, but that didn't help either. I don't understand where and how to move it Memoria.script.dll to make it work. I don't know what I can do about it anymore...

It would be really cool if you made a mini guide as a screen recording :-[


Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1868 on: 2022-08-17 11:13:13 »
Good day to you!
It would be awesome to have more visual guides but I have such a long todo-list right now about this game that I don't feel like doing it myself at the moment.

Updating the "Memoria.script.dll" will not help toward "AbilityFeatures.txt". I can tell you however that "Memoria.script.dll" goes to "StreamingAssets/Scripts/Memoria.script.dll" by default and it can also be present in mod folders to take over that default one (for example, I have one for my own mod and thus it has the path "AlternateFantasy/StreamingAssets/Scripts/Memoria.script.dll").

Running Memoria.Patcher.exe should the be correct way to update Memoria.
There are surely problems because you have the game installed in the D: drive though, and not the C: drive. If you didn't install the game using Steam, then I don't know what happens. The normal installation path is "C:\Program Files (x86)\Steam\steamapps\common\FINAL FANTASY IX".

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1869 on: 2022-08-18 17:24:22 »
Good day to you!
It would be awesome to have more visual guides but I have such a long todo-list right now about this game that I don't feel like doing it myself at the moment.

Updating the "Memoria.script.dll" will not help toward "AbilityFeatures.txt". I can tell you however that "Memoria.script.dll" goes to "StreamingAssets/Scripts/Memoria.script.dll" by default and it can also be present in mod folders to take over that default one (for example, I have one for my own mod and thus it has the path "AlternateFantasy/StreamingAssets/Scripts/Memoria.script.dll").

Running Memoria.Patcher.exe should the be correct way to update Memoria.
There are surely problems because you have the game installed in the D: drive though, and not the C: drive. If you didn't install the game using Steam, then I don't know what happens. The normal installation path is "C:\Program Files (x86)\Steam\steamapps\common\FINAL FANTASY IX".

Hello again, @Tirlititi! =)

I've done a lot of work on my knowledge, learned what a repository is and how to work with it

With the help of Visual Studio, I downloaded the repository "https://github.com/Albeoris/Memoria.git " and according to his instructions, "I put together a solution."

Updated the game with a patch along the path that you suggested (C:\Program Files (x86)\Steam\steamapps\common\Final Fantasy IX).

After all the manipulations, the game started.

The new launcher has the opportunity to download your Alternative Fantasy mod.

But I found that even in your patch, even after everything I did according to the instructions, "SA GLOBAL" refuses to work =D

I think that Assembly-CSharp.dll  is broken how to download a new one and where I never understood.



rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1870 on: 2022-08-26 15:26:02 »
Hello! ;)

I have a little problem. With maxMP/HP active abilities, the current MP/HP values are constantly reset to base values when changing equipment and activating other SA abilities.

example
## Permanent (code=MaxHP) MaxHP + MaxHP / 2 (/code) ##

the patch from April 29 is installed.


<iframe src='https://my.mail.ru/video/embed/3747690893717536769' width='626' height='367' frameborder='0' scrolling='no' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1871 on: 2022-08-26 16:40:18 »
I'll check what it is but I don't remember having that issue. Maybe that's because you use GlobalLast instead of Global? Although I don't see why it would matter... I'm pretty sure that my implementation of MP+20% on Magus Hat doesn't have that problem.

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1872 on: 2022-08-26 16:57:24 »
I'll check what it is but I don't remember having that issue. Maybe that's because you use GlobalLast instead of Global? Although I don't see why it would matter... I'm pretty sure that my implementation of MP+20% on Magus Hat doesn't have that problem.

This happens in >SA 5,6,7,8. The same error occurs in Global and GloBallast. I need to restore HP and MP when I change weapons, equipments or abilities.

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1873 on: 2022-08-28 00:46:16 »
I must have badly tested it because that was indeed a bug common to all of the HP+X% or MP+X% features.
Thanks for pointing that bug; I've fixed it for the next Memoria release.

rassellek

  • *
  • Posts: 19
    • View Profile
Re: [PSX/PC] General editor - Hades Workshop (0.43)
« Reply #1874 on: 2022-08-28 13:25:57 »
I must have badly tested it because that was indeed a bug common to all of the HP+X% or MP+X% features.
Thanks for pointing that bug; I've fixed it for the next Memoria release.

@Tirlititi !!!  :-* Thank you for the answer! Thanks to you, I was able to solve this problem. Everything works fine. I'm looking forward to the new patch. I can't build it myself in Visual Studio according to the instructions, there are a lot of errors, apparently I don't have enough experience in this... But I will try to become like you!