DEV Community

HALO
HALO

Posted on

ADV Development with GOKI2 [ModCGMemory Intro]: Implementing CG/Recollection Mode and Data Management via Excel

Download

Avalanches & GOKI2 can download the latest environment from the Assets link of Avalanches-GOKI2-Release2.x.y.y.zip based on the release tag on the following site (written as Avalanches (GOKI2) release version 2.x.y.y).

https://github.com/halo1234/Avalanches/releases

CG/Reminiscence

In GOKI2, ModCGMemory implements the CG/Reminiscence screen.

First, load the module.

; CG/Reminiscence screen
@load_module name=ModCGMemory
Enter fullscreen mode Exit fullscreen mode

With this, the CG/Reminiscence screen can be used.

CG/Reminiscence Data

First, you need the data for the CGs or reminiscences to be shown on the CG/Reminiscence screen.

In Avalanches, you can input the data using Excel.

First, please open the following file.

/src/data/cgmemory/list.xlsx

For now, the default content is as follows.

image.png

Do not edit the headers. (Strictly speaking, it is okay to edit them, but there is a procedure, so it will be omitted here.)

thum_CG_A is the file name of the thumbnail.

Do not enter the extension.

CG_A000/CG_A001 are the file names of the CGs to be displayed on the screen.

Do not enter the file extension here either.

Specify one file per line for each CG.

ModImageTest specifies the scenario file name to be played back as a replay.

Do not enter the file extension here either.

The sheet name will be the output file name.

You can add as many sheets as you like, so for example, if you want to switch CG screens for each character, it is good to separate the sheets.

Data Output

There is a tool that converts the input Excel data into a format that Kirikiri can read.

If you enter data into the default /src/data/cgmemory/list.xlsx, you can use the following batch as it is.

/tools/make_cgmem/run.bat

If you change the file name or create an Excel file from scratch, you need to update the batch contents to the new file path.

Running /tools/make_cgmem/run.bat will generate *.dic files from Excel.

Execution screen

image.png

By default, the following two files are generated:

main.dic

sub.dic

Copy the generated files to the project folder.

You can copy them to any folder that is included in the automatic search path.

CG/Recall Screen Layout

We will write the GOKI2 script.
First, we will load the CG/recall data we created earlier.

@load_cgmemory key=halo storage=ハロ.dic
@load_cgmemory key=2nd storage=2番目のCG
Enter fullscreen mode Exit fullscreen mode

The key attribute and storage attribute are required attributes.
Be sure to specify them.
The key attribute should be any string that serves as the data key.
The storage attribute specifies the generated CG/recall data.
The file extension is optional.

Next, we define the UI.

@cgmemory_option item_width=120 item_height=120
@cgmemory_option blank_thumbnail=thum_blank memory_button=memory_button
@cgmemory_option item_count=8 memory_count=3
Enter fullscreen mode Exit fullscreen mode

First, item_width=120 item_height=120 specifies the size of each item.
This is the size that will contain the CG thumbnail and recall button.
Next, blank_thumbnail=thum_blank memory_button=memory_button specifies the images for the thumbnail (unopened) and the recall button.
Please refer to the manual for image formats.
Finally, item_count=8 memory_count=3 specifies the number of items per page and the number of recall buttons.

There were two CG/recall data created initially. We will place buttons to select each of those data.

@cgmemory halo_left=370 halo_top=270 halo_caption=Halo's CG halo_width=60 halo_height=20
@cgmemory 2nd_left=370 2nd_top=300 2nd_caption=2nd's CG 2nd_width=60 2nd_height=20
Enter fullscreen mode Exit fullscreen mode

Here, the value of the key attribute specified in load_cgmemory appears. Each attribute is specified in the format key_xxx. For instance, for the left position attribute of Halo's CG button, it is halo_left.

The recall buttons will be displayed below the CG thumbnails.

@cgmemory mem0_left=10 mem0_top=100 mem1_left=30 mem1_top=100 mem2_left=50 mem2_top=100
Enter fullscreen mode Exit fullscreen mode

This specifies the positions of the CG thumbnails.

@cgmemory item0_left=20 item0_top=10
@cgmemory item1_left=160 item1_top=10
@cgmemory item2_left=300 item2_top=10
@cgmemory item3_left=440 item3_top=10
@cgmemory item4_left=20 item4_top=200
@cgmemory item5_left=160 item5_top=200
@cgmemory item6_left=300 item6_top=200
@cgmemory item7_left=440 item7_top=200
Enter fullscreen mode Exit fullscreen mode

It is indicated as itemN_xxxx, but this N can be specified from 0 up to the number specified in cgmemory_option item_count=8 minus 1. Here, it will be arranged in 4 columns and 2 rows.

With this, the CG/recollection screen has been defined.

Registering CGs

If entered in Excel, the CG file name will be automatically registered. To open it, use the load_cg tag to display the CG.

@load_cg layer=cg_layer_0 storage=CG_A001.png visible
Enter fullscreen mode Exit fullscreen mode

If you use the above tag to display the CG, it will open in the CG/recollection screen.

Recollection Script

You need to specify the script range that will be played in recollection (from which part of the script to which part is recollection). First, write the open_memory tag at the starting position. Keep in mind that this tag must be written immediately after some label. The ending position can be specified arbitrarily using the end_memory tag.

*label|
@open_memory

[Hello] This is during recollection.

[Hello] It's ending.

@end_memory
Enter fullscreen mode Exit fullscreen mode

With this, you have specified the recollection range. Once the script enclosed by this tag is executed even once, the button will be activated on the CG/recollection screen.

Top comments (0)