While we are at it, does anyone have any problems with field script? What I mean is... what else could I add to the engine?
At moment I have added materia delete, Set character ID - and I am also adding Check character HP and Change any byte of the Savemap.
Are there any other things I can add that would help modders?
I've added the Savemap changer instead of the char ID change. It covers it and a whole lot more.
Procedure ChangeSaveMap905608; stdcall; //New opcode 1A
Begin
asm
xor eax,eax
mov al,[$CC0964]
xor ecx,ecx
mov cx,[eax*2+$CC0CF8]
mov edx,[$CBF5E8]
mov ax,word ptr [edx+ecx+01] // Offset
mov edx,[edx+ecx+03] // Value
mov cl,byte ptr [edx+ecx+07] // flag (0 = 8 bit, 1 = 16 bit, 2 or above = 32 bit)
cmp ax, 04
jl @label1 // jump if the offset is the checksum
cmp ax, $10F4
jg @label1 // jump if not the SaveMap
cmp cl, $00
jne @label2
mov [$DBFD38 + eax], dl // Store 8 bit value
jmp @label1
@LABEL2:
cmp cl, $01
jne @label3
mov [$DBFD38 + eax], dx // Store 16 bit value
jmp @label1
@LABEL3:
mov [$DBFD38 + eax], edx // Store 32 bit value
@LABEL1:
xor edx,edx
mov dl,[$CC0964]
add [edx*2+$CC0CF8],8 //advance script by 8 bytes
mov eax,1
end;
End;
edit. Allow for value to be a Byte, Word, or DWord.
One example would be the changing of the time value using this opcode to 1000 seconds. This would be script
1A (Change Save Map). Parameters (0xB80, 0x3E8, 2).
B80 is the time. As per the SaveMap offset. 00 being the checksum. See the wiki.
3E8= 1000.
2 = Set 4 bytes, 32 bit unsigned value.