1
FF9 Tools / Re: [PSX/PC] General editor - Hades Workshop (0.40b)
« on: 2019-06-18 01:48:35 »[...]Prison Cage; Garnet battle does this.
3) Last but not least, what about if I want to set in a "Trance Mode at start of the battle" other characters instead only Zidane, Steiner and Vivi? It's possible?
I know there is something that enables "Trance Mode" in the main enemy attacks, is it correct?
[...]
It has an attack that fills the Trance meter. It may be a different name in later versions of HW, but in version 0.38 its called Transfer.
in that fight there are a few important things that happen related to the trance bar filling. I'll try to show each of the important parts of the code. You can load the battle up yourself if you want to compare.
Code: [Select]
Function Main_Init
if ( IsBattleInitialized ) {
CloseAllWindows( )
Wait( 5 )
TerminateBattle( )
} else {
set SV_EnemyTeam[ATB] =$ FirstOf(SV_EnemyTeam[MAX_ATB])
set #( VAR_GlobUInt16_33 = ( SV_PlayerTeam[MODEL_TYPE] ==$ 0 ) )
set #( VAR_GlobUInt16_33 |= ( SV_PlayerTeam[MODEL_TYPE] ==$ 1 ) )
}
return
The first check is to see if battle has ended already, that seems to be normal for most battles. Then at [else] there are some commands and one of them is setting the enemy's ATB to the MAX_ATB of the first enemy. Tirlititi will have to explain how the list assignments work because I don't fully understand them, but I know that's what's happening in that line anyway.Next we have a variable that is looking for Zidane's dagger animation model, and one that's looking for his thief sword animation model, and setting the party slot either of them is in, to VAR_GlobUInt16_33. The code does this twice for unknown reasons, the second time fully overwriting the first one.
(if you want to change this to a random party member you can change it to this
Code: [Select]
set #( VAR_GlobUInt16_33 = RandomInTeam(SV_PlayerTeam) )
now, this variable is important for later, because in that fight ONLY Zidane is supposed to start with Trance, and the game needs to know which party slot he's in, in order to target him. (the battle also tracks all the other characters this way too so there is a variable for each specific character you might want to target)Next since we already set Prison Cage to have full ATB at the start, we have the Prison Cage ATB code (I've again removed some code not related to Trance):
Code: [Select]
Function Prison_Cage_ATB
if ( !VAR_LocUInt8_3 ) {
set VAR_LocUInt8_3 = 1
set #( SV_Target = VAR_GlobUInt16_33 )
Attack( 8 )
return
}
return
VAR_LocUInt8_3 is for tracking the cutscene progression for Zidane and Steiner explaining what Trance is. To begin with, its not set, so the battle checks if it doesn't exist yet (it doesn't) and then it sets it to 1, sets the SV_Target variable to the VAR_GlobUInt16_33, which it previously set as the party slot for Zidane, so now the next attack to execute will hit Zidane. Finally, it executes Attack( 8 ) which in this battle is Transfer, which fills up a character's Trance meter completely, and then returns out of the [if] and then processes some other things I removed for brevity, and then returns again to allow the game to continue into the next cycle.If you wanted to change the character to say, Freya, in the prison cage fight, the game locates her model and stores it in VAR_GlobUInt16_45 using this code
Code: [Select]
set #( VAR_GlobUInt16_45 = ( SV_PlayerTeam[MODEL_TYPE] ==$ 12 ) )
just like it did for Zidane in UInt16_33A full list of character models can be seen in the Function List, under Var Code > [DATA ACCESS]
Code: [Select]
[MODEL_TYPE]
Zidane : 0 or 1
Vivi : 2
Dagger : 3, 4, 5 or 6
Steiner : 7 or 8
Quina : 9
Eiko : 10 or 11
Freya : 12
Amarant : 13
Cinna : 14
Marcus : 15
Blank : 16 or 17
Beatrix : 18
Note, that if the character you want to target is not in the battle, the code may freeze while it looks for that character specifically, or it may skip right over the Transfer attack completely. I don't know the exact effects, but if the variables aren't set correctly in the PSX version, the battle will just stall as the game tries to attack something that doesn't exist. Tirlititi may have advice on doing other things with targetting.
Battle code is all pretty new to me, but I did just look into this last night, ironically, so I figured I'd explain what I already figured out.