You are not logged in.
Pages: 1
I want to create a loadmenu data. but idon't know where can I exactly begin.I studying some of the loadmenu script that are already have in the rom.But I know how can I create one. Can someone tell me how create one?
わたし の なまえ わ レン レン でづ
Offline
The compendium has some documentation on this but it is a bit confusing.
It depends on what you're trying to do. For a simple choice selection the best example is Crystal's Extremespeed Dratini quiz.
DragonShrineQuiz1Script: ; 0x18d030
; this is just the first part. the other questions have their own menudata
setbit1 $0001
2writetext UnknownText_0x18d3bc ; "What are #MON to you?"
keeptextopen
loadmenudata DragonShrineQuiz1MenuData
interpretmenu2 ; load menu and wait until you select an option
writebackup ; lets you check the option you just selected
if_equal $1, UnknownScript_0x18d0a9 ; PalScript
if_equal $2, UnknownScript_0x18d0cb ; UnderlingScript
if_equal $3, UnknownScript_0x18d0a9 ; FriendScript
end
; 0x18d049
...
DragonShrineQuiz1MenuData: ; 0x18d215
db %01000000 ; not sure
db $04, $08 ; top left corner coords (y, x)
db $0b, $13 ; bottom right corner coords (y, x)
dw DragonShrineQuiz1MenuData2
db $01 ; option 1 selected by default
; 0x18d21d
DragonShrineQuiz1MenuData2: ; 0x18d21d
db %10000001 ; bit7: left margin; bit0: can't press b
db $03 ; # items
db "PAL@"
db "UNDERLING@"
db "FRIEND@"
; 0x18d234
; DragonShrineQuiz1MenuData
40 04 08 0b 13 1d 52 01
; DragonShrineQuiz1MenuData2
81 03
8f a0 ab 50 ; PAL@
94 ad a3 a4 b1 ab a8 ad a6 50 ; UNDERLING@
85 b1 a8 a4 ad a3 50 ; FRIEND@
interpretmenu2's parameters are a bit more straightforward than interpretmenu's. Take this script and tinker around with it to see how it works. That'll help more than anything else, and probably be faster too.
Offline
I did this not too long ago.
IntroScriptText1:
db 0
db "Choose a starter.", $57
StarterMenu:
db $40, $00, $07, $0d, $13
dw StarterMenuChoices
db $01
StarterMenuChoices:
db $81, $06
db "BULBASAUR@"
db "CHARMANDER@"
db "SQUIRTLE@"
db "CHIKORITA@"
db "CYNDAQUIL@"
db "TOTODILE@"
IntroScript:
loadfont
2writetext IntroScriptText1
keeptextopen
loadmenudata StarterMenu
interpretmenu2
writebackup
if_equal $1, GiveStarter1
if_equal $2, GiveStarter2
if_equal $3, GiveStarter3
if_equal $4, GiveStarter4
if_equal $5, GiveStarter5
if_equal $6, GiveStarter6
; 0x7acf1
GiveStarter1:
pokenamemem BULBASAUR, $0
2writetext ReceivedStarterText
playsound $0002
waitbutton
keeptextopen
givepoke BULBASAUR, 5, BERRY, 0
2jump StarterGiven
GiveStarter2:
pokenamemem CHARMANDER, $0
2writetext ReceivedStarterText
playsound $0002
waitbutton
keeptextopen
givepoke CHARMANDER, 5, BERRY, 0
2jump StarterGiven
GiveStarter3:
pokenamemem SQUIRTLE, $0
2writetext ReceivedStarterText
playsound $0002
waitbutton
keeptextopen
givepoke SQUIRTLE, 5, BERRY, 0
2jump StarterGiven
GiveStarter4:
pokenamemem CHIKORITA, $0
2writetext ReceivedStarterText
playsound $0002
waitbutton
keeptextopen
givepoke CHIKORITA, 5, BERRY, 0
2jump StarterGiven
GiveStarter5:
pokenamemem CYNDAQUIL, $0
2writetext ReceivedStarterText
playsound $0002
waitbutton
keeptextopen
givepoke CYNDAQUIL, 5, BERRY, 0
2jump StarterGiven
GiveStarter6:
pokenamemem TOTODILE, $0
2writetext ReceivedStarterText
playsound $0002
waitbutton
keeptextopen
givepoke TOTODILE, 5, BERRY, 0
2jump StarterGiven
IntroScriptTextEnd:
db 0
db "Begin.", $57
StarterGiven:
warp GROUP_UNION_CAVE_1F, MAP_UNION_CAVE_1F, 17, 2
jumptextfaceplayer IntroScriptTextEnd
Last edited by Sanqui (2012-11-25 12:29:32)
Offline
Pages: 1