BH/RECV/X SCD SCRIPTING

Moderators: pcwzrd13, deluxux, VasiliyRS

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#41 » Thu Jan 25, 2024 12:07 pm

time to set our "if" statement whit the conditional and the action to do when the conditional is met.
for this example it will be:
if enemy status is dead set the text trigger in line 1 of the trigger table into a door to send you to area 5 room 54 spawning you at coordinate set 1 of that room, using transition door 3 and stop reading opcodes
this equals to:
0112 040300000000 25000000 05360002 0000
Attachments
ifset.jpg
Last edited by cbnj on Fri Jan 26, 2024 11:42 am, edited 1 time in total.

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#42 » Thu Jan 25, 2024 12:18 pm

finally we setup our "else" statement which will tell the game what to do while the "if" conditional is not met.
in this example will be like this:
else set the trigger in the trigger table to execute its normal function and loop it to keep executing its normal function.
equals to:
020C 25000080 00000000 0300

(obviously this will remain looped until the "if" conditional is met, when it will switch to do what the "if" conditional instructed)
Attachments
elsesettledup.jpg
Last edited by cbnj on Thu Jan 25, 2024 12:29 pm, edited 1 time in total.

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#43 » Thu Jan 25, 2024 12:28 pm

and that's how we finish our new R0_5530 hand made script!
At least for now as we will add it the excluded lines and more lines to make different things.

I attach a R0_5530_SCD_Example folder containing two folders:
Game_Ready: which contain a R0_5530.RDX file ready to drop in your "gamename" extracted folder and rebuild the GDI
RDXTool_Ready: which contain the dissected file to rebuild the rdx file using RDXTool - and here you can open the subfile 4_01.yxy whit a hex editor so you can see the script is exactly the same one build piece by piece here in this guide.

Try assigning a different enemy or multiple enemies to the script "if" conditional and share your results in the cv scd experiments section: viewtopic.php?f=52&t=17138
you can also make any question related to this guide there too, where ill focus to do my best to dissipate any doubts you can have the best i can ;)


NOTE
Since we dont settled up the rest of the lines in the script yet, this room dont have its own BGM track assigned, it will use any bgm track assigned by a previous room, locked doors will display text but wont play locked door sound, the green herb in this room can be picked up infinite times.
Attachments
R0_5530_SCD_Example.7z
(6.29 MiB) Downloaded 15 times

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#44 » Fri Jan 26, 2024 7:51 pm

Time to continue!
Now we have a fully working battle game room, you kill the explosive barrel and the door unlocks, its time to polish it a adding some of those opcodes we left out previously, opening our R0_5530 script in a hex editor we get this.

i will copy and paste it into a text file for you to see what going on later.
Attachments
GUIDESCRIPT1.jpg
Last edited by cbnj on Fri Jan 26, 2024 8:09 pm, edited 1 time in total.

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#45 » Fri Jan 26, 2024 7:58 pm

lets add a bgm track for this room, that require the bgm opcode 95xx0000 to be used, this opcode is always found at the start of every room which holds a specific bgm track the xx is the hex number of your desired bgm track which will be read from bgm.afs file range 00 to 78, since this opcode goes first of everything else in the script we will set it up before to declare out enemy is alive opcode, for this room i dont want the normal battle game track wich is the number 37 or 25hex (95250000), but i want the normal game version whit the girl voice saying "the self destruct system has been activated, all personnel evacuate immediately" so i will chose the track 10 instead wich is 0A hex (950A0000), as result my script change as follows
Attachments
ADDBGM.jpg
Last edited by cbnj on Sat Jan 27, 2024 7:27 am, edited 1 time in total.

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#46 » Sat Jan 27, 2024 2:54 am

Next steep is to set the item to be "alive" and its "dead" checker, this will cause the item to vanish after being picked up, the set item is the opcode 050700000001, and its dead chcker is 0E000000, both of them share the same configuration as the enemy ones.
The set item opcode will take place in the set area of the script sharing space whit the set enemy alive opcode, and the item dead checker will share space in the enemy dead checker/linker area, giving as result the next script configuration.
Attachments
additem.jpg
Last edited by cbnj on Sat Jan 27, 2024 7:25 am, edited 1 time in total.

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#47 » Sat Jan 27, 2024 3:24 am

everything is ready, copy the modified script from the text file and paste it into the hex editor overwriting our original script we made before and save the changes to continue whit the last step.
Attachments
BEFORE.jpg
after.jpg

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#48 » Sat Jan 27, 2024 3:31 am

the last thing to do is to fix our pointer table to reflect the changes we just made, the only affected function in this example is the second one since there is no more functions in our script, else we would have to adjust every consecutive pointer accordingly.
the previous pointer of the second function was aiming to offset 10, where the 0D check enemy dead/linker opcode starts, that opcode starts now at offset 1A, thats the offset we will write to replace the previous 10 one
Attachments
nwoffset.jpg
updated pointer.jpg
Last edited by cbnj on Sat Jan 27, 2024 7:23 am, edited 1 time in total.

cbnj
brutal
Posts: 248

Re: BH/RECV/X SCD SCRIPTING

Post#49 » Sat Jan 27, 2024 3:39 am

congrats!, youve just got a working herb item which will disappear when is picked up and called a different bgm track to be played in the room, save your work, rebuild the room and test it in game.
(from where that item comes from is something we check up in following examples).

I attach the file containing this new modifications we made to our file.
Attachments
R0_5530_Example_bgm+item.7z
(6.29 MiB) Downloaded 17 times

  • Similar Topics
    Replies
    Views
    Last post

Return to “Modifications”

Who is online

Users browsing this forum: No registered users