The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Lilycove City Department Store Vending Machine Items

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old April 2nd, 2019 (7:54 PM). Edited April 6th, 2019 by PokemonXO.
PokemonXO PokemonXO is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 44
Where is the script to edit the items that you can obtain from the vending machine? Thanks.

So, I found the script for it.

Spoiler:
'---------------
#org 0x220295
lockall
preparemsg 0x822056D '"It's a Vending Machine.\nWhich dri..."
waitmsg
showmoney 0x0 0x0 0x0
goto 0x82202A6

'---------------
#org 0x2202A6
multichoice 0x10 0x0 0x2A 0x0
copyvar 0x4001 LASTRESULT
copyvar 0x8000 0x4001
compare 0x8000 0x0
if 0x1 goto 0x82202E4
compare 0x8000 0x1
if 0x1 goto 0x82202EF
compare 0x8000 0x2
if 0x1 goto 0x82202FA
msgbox 0x8220603 MSG_KEEPOPEN '"Decided against buying a drink."
goto 0x822045E

'---------------
#org 0x2202E4
setvar 0x4000 0x1A
goto 0x822032F

'---------------
#org 0x2202EF
setvar 0x4000 0x1B
goto 0x822032F

'---------------
#org 0x2202FA
setvar 0x4000 0x1C
goto 0x822032F

'---------------
#org 0x22045E
hidemoney 0x0 0x0
releaseall
end

'---------------
#org 0x22032F
compare 0x4001 0x0
if 0x1 call 0x8220305
compare 0x4001 0x1
if 0x1 call 0x822030C
compare 0x4001 0x2
if 0x1 call 0x8220313
compare LASTRESULT 0x0
if 0x1 goto 0x8220442
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8220450
compare 0x4001 0x0
if 0x1 call 0x822031A
compare 0x4001 0x1
if 0x1 call 0x8220321
compare 0x4001 0x2
if 0x1 call 0x8220328
updatemoney 0x0 0x0 0x0
bufferitem 0x0 0x4000
sound 0x6A
msgbox 0x82205A1 MSG_KEEPOPEN '"Clang!\pA can of [buffer1] dropped..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
random 0x40
compare LASTRESULT 0x0
if 0x5 goto 0x8220436
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8220450
sound 0x6A
msgbox 0x82205C2 MSG_KEEPOPEN '"Clang!\pScore! An extra can of [bu..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
random 0x40
compare LASTRESULT 0x0
if 0x5 goto 0x8220436
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8220450
sound 0x6A
msgbox 0x82205C2 MSG_KEEPOPEN '"Clang!\pScore! An extra can of [bu..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
goto 0x8220436

'---------------
#org 0x220305
checkmoney 0xC8 0x0
return

'---------------
#org 0x22030C
checkmoney 0x12C 0x0
return

'---------------
#org 0x220313
checkmoney 0x15E 0x0
return

'---------------
#org 0x220442
msgbox 0x82205F1 MSG_KEEPOPEN '"Not enough money[.]"
goto 0x822045E

'---------------
#org 0x220450
msgbox 0x8272A89 MSG_KEEPOPEN '"The Bag is full[.]"
goto 0x822045E

'---------------
#org 0x22031A
paymoney 0xC8 0x0
return

'---------------
#org 0x220321
paymoney 0x12C 0x0
return

'---------------
#org 0x220328
paymoney 0x15E 0x0
return

'---------------
#org 0x220436
preparemsg 0x822056D '"It's a Vending Machine.\nWhich dri..."
waitmsg
goto 0x82202A6


'---------
' Strings
'---------
#org 0x22056D
= It's a Vending Machine.\nWhich drink would you like?

#org 0x220603
= Decided against buying a drink.

#org 0x2205A1
= Clang!\pA can of [buffer1] dropped down.

#org 0x272A9A
= [player] put away the [buffer2]\nin the [buffer3] Pocket.

#org 0x2205C2
= Clang!\pScore! An extra can of [buffer1]\ndropped down!

#org 0x2205F1
= Not enough money[.]

#org 0x272A89
= The Bag is full[.]


With this, you can have only Lemonade, Soda Pop, and Fresh Water.

What would I do to add Moomoo Milk (500P ea) and Berry Juice (100P ea)
__________________
If your interested in tutoring me on how to use the scripting and answering all my questions, send me a PM and we can discuss contacting each other in further details.

A little info about me and my goals:

I am burned out on Pokemon games, which, since emerald, have gradually grown worse to me. I am a fan of Generation 3 and earlier. I have some creature ideas I'd rather keep to myself and friends, due to personal reasons. Thus, I want to make my first game encompassing them. I do not know how to program, so I'll learn by using pokemon essentials. Once I complete the game, I'll enjoy it, and work on an entirely new project.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old April 3rd, 2019 (2:57 PM).
PokemonXO PokemonXO is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 44
So, apparently, this requires a multichoice editor or something similar to hex editing. How would I find the exact location for this?

I see that 0x2A is the indicator for multichoice. But where do I edit this?

In LSA's multichoice editor, the table is pointed at 0858AEC0

The rest goes like this:

0858AEC3 FRESH WATER\cÛ [$]200
0858AED6 SODA POP\cÛ [$]300
0858AEE9 LEMONADE\cÛ [$]350
0858AEEA Exit

I want the table to look like this:

0858AEC3 BERRY JUICE\cÛ [$]100
0858AED6 FRESH WATER\cÛ [$]200
0*85EAEE9‬ SODA POP\cÛ [$]300
0858AEFB LEMONADE\cÛ [$]350
*0858AF0D‬ MOOMOO MILK\cÛ [$]
*0858AF22 ‬Exit

However, if I input those values and click save, they get repointed.
__________________
If your interested in tutoring me on how to use the scripting and answering all my questions, send me a PM and we can discuss contacting each other in further details.

A little info about me and my goals:

I am burned out on Pokemon games, which, since emerald, have gradually grown worse to me. I am a fan of Generation 3 and earlier. I have some creature ideas I'd rather keep to myself and friends, due to personal reasons. Thus, I want to make my first game encompassing them. I do not know how to program, so I'll learn by using pokemon essentials. Once I complete the game, I'll enjoy it, and work on an entirely new project.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old April 4th, 2019 (8:38 AM).
PokemonXO PokemonXO is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 44
Ok, so, I got the multi-choice selections down. Now I just need help implementing the script.

This is the new formula. I used Hex Maniac to edit the locations of the tables.

Multi Choice 0x2A
Table 085EAEC0
08FF8030 Berry Juice\cÛ $100
085EAEC3 Fresh Water\cÛ $200
*085EAED6 Soda Pop\cÛ $300
*085EAEE6 Lemonade\cÛ $400
*08FF8043‬ Moomoo Milk\cÛ$500
085EB7EA Exit



Here's the script once more.

Spoiler:
'---------------
#org 0x220295
lockall
preparemsg 0x822056D '"It's a Vending Machine.\nWhich dri..."
waitmsg
showmoney 0x0 0x0 0x0
goto 0x82202A6

'---------------
#org 0x2202A6
multichoice 0x10 0x0 0x2A 0x0
copyvar 0x4001 LASTRESULT
copyvar 0x8000 0x4001
compare 0x8000 0x0
if 0x1 goto 0x82202E4
compare 0x8000 0x1
if 0x1 goto 0x82202EF
compare 0x8000 0x2
if 0x1 goto 0x82202FA
msgbox 0x8220603 MSG_KEEPOPEN '"Decided against buying a drink."
goto 0x822045E

'---------------
#org 0x2202E4
setvar 0x4000 0x1A
goto 0x822032F

'---------------
#org 0x2202EF
setvar 0x4000 0x1B
goto 0x822032F

'---------------
#org 0x2202FA
setvar 0x4000 0x1C
goto 0x822032F

'---------------
#org 0x22045E
hidemoney 0x0 0x0
releaseall
end

'---------------
#org 0x22032F
compare 0x4001 0x0
if 0x1 call 0x8220305
compare 0x4001 0x1
if 0x1 call 0x822030C
compare 0x4001 0x2
if 0x1 call 0x8220313
compare LASTRESULT 0x0
if 0x1 goto 0x8220442
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8220450
compare 0x4001 0x0
if 0x1 call 0x822031A
compare 0x4001 0x1
if 0x1 call 0x8220321
compare 0x4001 0x2
if 0x1 call 0x8220328
updatemoney 0x0 0x0 0x0
bufferitem 0x0 0x4000
sound 0x6A
msgbox 0x82205A1 MSG_KEEPOPEN '"Clang!\pA can of [buffer1] dropped..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
random 0x40
compare LASTRESULT 0x0
if 0x5 goto 0x8220436
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8220450
sound 0x6A
msgbox 0x82205C2 MSG_KEEPOPEN '"Clang!\pScore! An extra can of [bu..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
random 0x40
compare LASTRESULT 0x0
if 0x5 goto 0x8220436
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8220450
sound 0x6A
msgbox 0x82205C2 MSG_KEEPOPEN '"Clang!\pScore! An extra can of [bu..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
goto 0x8220436

'---------------
#org 0x220305
checkmoney 0xC8 0x0
return

'---------------
#org 0x22030C
checkmoney 0x12C 0x0
return

'---------------
#org 0x220313
checkmoney 0x15E 0x0
return

'---------------
#org 0x220442
msgbox 0x82205F1 MSG_KEEPOPEN '"Not enough money[.]"
goto 0x822045E

'---------------
#org 0x220450
msgbox 0x8272A89 MSG_KEEPOPEN '"The Bag is full[.]"
goto 0x822045E

'---------------
#org 0x22031A
paymoney 0xC8 0x0
return

'---------------
#org 0x220321
paymoney 0x12C 0x0
return

'---------------
#org 0x220328
paymoney 0x15E 0x0
return

'---------------
#org 0x220436
preparemsg 0x822056D '"It's a Vending Machine.\nWhich dri..."
waitmsg
goto 0x82202A6


'---------
' Strings
'---------
#org 0x22056D
= It's a Vending Machine.\nWhich drink would you like?

#org 0x220603
= Decided against buying a drink.

#org 0x2205A1
= Clang!\pA can of [buffer1] dropped down.

#org 0x272A9A
= [player] put away the [buffer2]\nin the [buffer3] Pocket.

#org 0x2205C2
= Clang!\pScore! An extra can of [buffer1]\ndropped down!

#org 0x2205F1
= Not enough money[.]

#org 0x272A89
= The Bag is full[.]
__________________
If your interested in tutoring me on how to use the scripting and answering all my questions, send me a PM and we can discuss contacting each other in further details.

A little info about me and my goals:

I am burned out on Pokemon games, which, since emerald, have gradually grown worse to me. I am a fan of Generation 3 and earlier. I have some creature ideas I'd rather keep to myself and friends, due to personal reasons. Thus, I want to make my first game encompassing them. I do not know how to program, so I'll learn by using pokemon essentials. Once I complete the game, I'll enjoy it, and work on an entirely new project.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old April 4th, 2019 (4:50 PM). Edited April 4th, 2019 by DrFuji.
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Here's a version of the vending machine script that should work with the longer multichoice that you've made. The text is a bit weird whenever you receive the Berry Juice/ MooMoo Milk as the script says that you get a can, when the sprites are a coconut(?) and bottle respectively. You could change the text string to something like "You received a [ITEM]!" or something like that, but it should still work either way.

Spoiler:
#dynamic 0x9C0B20

#org @Start
lockall
preparemsg @VendingMachine
waitmsg
showmoney 0x0 0x0 0x0
goto @Continue

#org @Continue
multichoice 0x10 0x0 0x2A 0x0
copyvar 0x4001 0x800D
copyvar 0x8000 0x4001
compare 0x8000 0x0
if 0x1 goto @BerryJuiceSet
compare 0x8000 0x1
if 0x1 goto @FreshWaterSet
compare 0x8000 0x2
if 0x1 goto @SodaPopSet
compare 0x8000 0x3
if 0x1 goto @LemonadeSet
compare 0x8000 0x4
if 0x1 goto @MooMooMilkSet
msgbox @DontBuy 0x6
goto @Exit

#org @BerryJuiceSet
setvar 0x4000 0x2C
goto @Continue2

#org @FreshWaterSet
setvar 0x4000 0x1A
goto @Continue2

#org @SodaPopSet
setvar 0x4000 0x1B
goto @Continue2

#org @LemonadeSet
setvar 0x4000 0x1C
goto @Continue2

#org @MooMooMilkSet
setvar 0x4000 0x1D
goto @Continue2

#org @Exit
hidemoney 0x0 0x0
releaseall
end

#org @Continue2
compare 0x4001 0x0
if 0x1 call @BerryJuiceMoneyCheck
compare 0x4001 0x1
if 0x1 call @FreshWaterMoneyCheck
compare 0x4001 0x2
if 0x1 call @SodaPopMoneyCheck
compare 0x4001 0x3
if 0x1 call @LemonadeMoneyCheck
compare 0x4001 0x4
if 0x1 call @MooMooMilkMoneyCheck
compare 0x800D 0x0
if 0x1 goto @NotEnoughMoney
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
compare 0x4001 0x0
if 0x1 call @BerryJuiceMoneyPay
compare 0x4001 0x1
if 0x1 call @FreshWaterMoneyPay
compare 0x4001 0x2
if 0x1 call @SodaPopMoneyPay
compare 0x4001 0x3
if 0x1 call @LemonadeMoneyPay
compare 0x4001 0x4
if 0x1 call @MooMooMilkMoneyPay
updatemoney 0x0 0x0 0x0
bufferitem 0x0 0x4000
sound 0x6A
msgbox @GetDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
random 0x40
compare 0x800D 0x0
if 0x5 goto @NextDrinkSelection
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
sound 0x6A
msgbox @ExtraDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
random 0x40
compare 0x800D 0x0
if 0x5 goto @NextDrinkSelection
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
sound 0x6A
msgbox @ExtraDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
goto @NextDrinkSelection

#org @BerryJuiceMoneyCheck
checkmoney 0x64 0x0
return

#org @FreshWaterMoneyCheck
checkmoney 0xC8 0x0
return

#org @SodaPopMoneyCheck
checkmoney 0x12C 0x0
return

#org @LemonadeMoneyCheck
checkmoney 0x190 0x0
return

#org @MooMooMilkMoneyCheck
checkmoney 0x1F4 0x0
return

#org @NotEnoughMoney
msgbox @NoMoney 0x6
goto @Exit

#org @NotEnoughSpace
msgbox @BagFull 0x6
goto @Exit

#org @BerryJuiceMoneyPay
paymoney 0x64 0x0
return

#org @FreshWaterMoneyPay
paymoney 0xC8 0x0
return

#org @SodaPopMoneyPay
paymoney 0x12C 0x0
return

#org @LemonadeMoneyPay
paymoney 0x190 0x0
return

#org @MooMooMilkMoneyPay
paymoney 0x1F4 0x0
return

#org @NextDrinkSelection
preparemsg @VendingMachine
waitmsg
goto @Continue

#org @VendingMachine
= It's a Vending Machine.\nWhich drink would you like?

#org @DontBuy
= Decided against buying a drink.

#org @GetDrink
= Clang!\pA can of [buffer1] dropped down.

#org @PutAway
= [player] put away the [buffer2]\nin the [buffer3] Pocket.

#org @ExtraDrink
= Clang!\pScore! An extra can of [buffer1]\ndropped down!

#org @NoMoney
= Not enough money[.]

#org @BagFull
= The Bag is full[.]
__________________
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old April 4th, 2019 (4:59 PM). Edited April 5th, 2019 by PokemonXO.
PokemonXO PokemonXO is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 44
Quote:
Originally Posted by DrFuji View Post
Here's a version of the vending machine script that should work with the longer multichoice that you've made. The text is a bit weird whenever you receive the Berry Juice/ MooMoo Milk as the script says that you get a can, when the sprites are a coconut(?) and bottle respectively. You could change the text string to something like "You received a [ITEM]!" or something like that, but it should still work either way.

Spoiler:
#dynamic 0x9C0B20

#org @Start
lockall
preparemsg @VendingMachine
waitmsg
showmoney 0x0 0x0 0x0
goto @Continue

#org @Continue
multichoice 0x10 0x0 0x2A 0x0
copyvar 0x4001 0x800D
copyvar 0x8000 0x4001
compare 0x8000 0x0
if 0x1 goto @BerryJuiceSet
compare 0x8000 0x1
if 0x1 goto @FreshWaterSet
compare 0x8000 0x2
if 0x1 goto @SodaPopSet
compare 0x8000 0x3
if 0x1 goto @LemonadeSet
compare 0x8000 0x4
if 0x1 goto @MooMooMilkSet
msgbox @DontBuy 0x6
goto @Exit

#org @BerryJuiceSet
setvar 0x4000 0x2C
goto @Continue2

#org @FreshWaterSet
setvar 0x4000 0x1A
goto @Continue2

#org @SodaPopSet
setvar 0x4000 0x1B
goto @Continue2

#org @LemonadeSet
setvar 0x4000 0x1C
goto @Continue2

#org @MooMooMilkSet
setvar 0x4000 0x1D
goto @Continue2

#org @Exit
hidemoney 0x0 0x0
releaseall
end

#org @Continue2
compare 0x4001 0x0
if 0x1 call @BerryJuiceMoneyCheck
compare 0x4001 0x1
if 0x1 call @FreshWaterMoneyCheck
compare 0x4001 0x2
if 0x1 call @SodaPopMoneyCheck
compare 0x4001 0x3
if 0x1 call @LemonadeMoneyCheck
compare 0x4001 0x4
if 0x1 call @MooMooMilkMoneyCheck
compare 0x800D 0x0
if 0x1 goto @NotEnoughMoney
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
compare 0x4001 0x0
if 0x1 call @BerryJuiceMoneyPay
compare 0x4001 0x1
if 0x1 call @FreshWaterMoneyPay
compare 0x4001 0x2
if 0x1 call @SodaPopMoneyPay
compare 0x4001 0x3
if 0x1 call @LemonadeMoneyPay
compare 0x4001 0x4
if 0x1 call @MooMooMilkMoneyPay
updatemoney 0x0 0x0 0x0
bufferitem 0x0 0x4000
sound 0x6A
msgbox @GetDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
random 0x40
compare 0x800D 0x0
if 0x5 goto @NextDrinkSelection
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
sound 0x6A
msgbox @ExtraDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
random 0x40
compare 0x800D 0x0
if 0x5 goto @NextDrinkSelection
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
sound 0x6A
msgbox @ExtraDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
goto @NextDrinkSelection

#org @BerryJuiceMoneyCheck
checkmoney 0x64 0x0
return

#org @FreshWaterMoneyCheck
checkmoney 0xC8 0x0
return

#org @SodaPopMoneyCheck
checkmoney 0x12C 0x0
return

#org @LemonadeMoneyCheck
checkmoney 0x190 0x0
return

#org @MooMooMilkMoneyCheck
checkmoney 0x1F4 0x0
return

#org @NotEnoughMoney
msgbox @NoMoney 0x6
goto @Exit

#org @NotEnoughSpace
msgbox @BagFull 0x6
goto @Exit

#org @BerryJuiceMoneyPay
paymoney 0x64 0x0
return

#org @FreshWaterMoneyPay
paymoney 0xC8 0x0
return

#org @SodaPopMoneyPay
paymoney 0x12C 0x0
return

#org @LemonadeMoneyPay
paymoney 0x190 0x0
return

#org @MooMooMilkMoneyPay
paymoney 0x1F4 0x0
return

#org @NextDrinkSelection
preparemsg @VendingMachine
waitmsg
goto @Continue

#org @VendingMachine
= It's a Vending Machine.\nWhich drink would you like?

#org @DontBuy
= Decided against buying a drink.

#org @GetDrink
= Clang!\pA can of [buffer1] dropped down.

#org @PutAway
= [player] put away the [buffer2]\nin the [buffer3] Pocket.

#org @ExtraDrink
= Clang!\pScore! An extra can of [buffer1]\ndropped down!

#org @NoMoney
= Not enough money[.]

#org @BagFull
= The Bag is full[.]
Oh wow.

So, I've edited the rom so it can verify that the actual multiple choice is pointing to the Moomoo Milk and Berry Juice.

[URL Removed]

I've worked with a script already established in the game. But everytime I attempt to edit it, it reverts most of the script to only 4 choices instead of 6

Spoiler:
'---------------
#org 0x220295
lockall
preparemsg 0x822056D '"It's a Vending Machine.\nWhich dri..."
waitmsg
showmoney 0x0 0x0 0x0
goto 0x8FF8100

'---------------
#org 0xFF8100
multichoice 0x10 0x0 0x2A 0x0
copyvar 0x4001 LASTRESULT
copyvar 0x8000 0x4001
compare 0x8000 0x0
if 0x1 goto 0x8FF8136
compare 0x8000 0x1
if 0x1 goto 0x8FF8141
compare 0x8000 0x2
if 0x1 goto 0x8FF814C
compare 0x8000 0x3
if 0x1 goto 0x8FF8157
compare 0x8000 0x4
if 0x1 goto 0x8FF8162
msgbox 0x8220603 MSG_KEEPOPEN '"Decided against buying a drink."
goto 0x8FF8359

'---------------
#org 0xFF8136
setvar 0x4000 0x2C
goto 0x8FF81BD

'---------------
#org 0xFF8141
setvar 0x4000 0x1A
goto 0x8FF81BD

'---------------
#org 0xFF814C
setvar 0x4000 0x1B
goto 0x8FF81BD

'---------------
#org 0xFF8157
setvar 0x4000 0x1C
goto 0x8FF81BD

'---------------
#org 0xFF8162
setvar 0x4000 0x1D
goto 0x8FF81BD

'---------------
#org 0xFF8359
hidemoney 0x0 0x0
releaseall
end

'---------------
#org 0xFF81BD
compare 0x4001 0x0
if 0x1 call 0x8FF816D
compare 0x4001 0x1
if 0x1 call 0x8FF8175
compare 0x4001 0x2
if 0x1 call 0x8FF817D
compare 0x4001 0x3
if 0x1 call 0x8FF8185
compare 0x4001 0x4
if 0x1 call 0x8FF818D
compare LASTRESULT 0x0
if 0x1 goto 0x8FF833D
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8FF834B
compare 0x4001 0x0
if 0x1 call 0x8FF8195
compare 0x4001 0x1
if 0x1 call 0x8FF819D
compare 0x4001 0x2
if 0x1 call 0x8FF81A5
compare 0x4001 0x3
if 0x1 call 0x8FF81AD
compare 0x4001 0x4
if 0x1 call 0x8FF81B5
updatemoney 0x0 0x0 0x0
bufferitem 0x0 0x4000
sound 0x6A
msgbox 0x82205A1 MSG_KEEPOPEN '"Clang!\pA can of [buffer1] dropped..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
random 0x40
compare LASTRESULT 0x0
if 0x5 goto 0x8FF8331
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8FF834B
sound 0x6A
msgbox 0x82205C2 MSG_KEEPOPEN '"Clang!\pScore! An extra can of [bu..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
random 0x40
compare LASTRESULT 0x0
if 0x5 goto 0x8FF8331
checkitemroom 0x4000 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x8FF834B
sound 0x6A
msgbox 0x82205C2 MSG_KEEPOPEN '"Clang!\pScore! An extra can of [bu..."
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox 0x8272A9A MSG_KEEPOPEN '"[player] put away the [buffer2]\ni..."
goto 0x8FF8331

'---------------
#org 0xFF816D
checkmoney 0x64 0x0
return

'---------------
#org 0xFF8175
checkmoney 0xC8 0x0
return

'---------------
#org 0xFF817D
checkmoney 0x12C 0x0
return

'---------------
#org 0xFF8185
checkmoney 0x190 0x0
return

'---------------
#org 0xFF818D
checkmoney 0x1F4 0x0
return

'---------------
#org 0xFF833D
msgbox 0x82205F1 MSG_KEEPOPEN '"Not enough money[.]"
goto 0x8FF816D

'---------------
#org 0xFF834B
msgbox 0x8272A89 MSG_KEEPOPEN '"The Bag is full[.]"
goto 0x8FF816D

'---------------
#org 0xFF8195
paymoney 0x64 0x0
return

'---------------
#org 0xFF819D
paymoney 0xC8 0x0
return

'---------------
#org 0xFF81A5
paymoney 0x12C 0x0
return

'---------------
#org 0xFF81AD
paymoney 0x190 0x0
return

'---------------
#org 0xFF81B5
paymoney 0x1F4 0x0
return

'---------------
#org 0xFF8331
preparemsg 0x822056D '"It's a Vending Machine.\nWhich dri..."
waitmsg
goto 0x8FF8100


'---------
' Strings
'---------
#org 0x22056D
= It's a Vending Machine.\nWhich drink would you like?

#org 0x220603
= Decided against buying a drink.

#org 0x2205A1
= Clang!\pA can of [buffer1] dropped down.

#org 0x272A9A
= [player] put away the [buffer2]\nin the [buffer3] Pocket.

#org 0x2205C2
= Clang!\pScore! An extra can of [buffer1]\ndropped down!

#org 0x2205F1
= Not enough money[.]

#org 0x272A89
= The Bag is full[.]
__________________
If your interested in tutoring me on how to use the scripting and answering all my questions, send me a PM and we can discuss contacting each other in further details.

A little info about me and my goals:

I am burned out on Pokemon games, which, since emerald, have gradually grown worse to me. I am a fan of Generation 3 and earlier. I have some creature ideas I'd rather keep to myself and friends, due to personal reasons. Thus, I want to make my first game encompassing them. I do not know how to program, so I'll learn by using pokemon essentials. Once I complete the game, I'll enjoy it, and work on an entirely new project.
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old April 4th, 2019 (5:14 PM). Edited April 4th, 2019 by PokemonXO.
PokemonXO PokemonXO is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 44
Quote:
Originally Posted by DrFuji View Post
Here's a version of the vending machine script that should work with the longer multichoice that you've made. The text is a bit weird whenever you receive the Berry Juice/ MooMoo Milk as the script says that you get a can, when the sprites are a coconut(?) and bottle respectively. You could change the text string to something like "You received a [ITEM]!" or something like that, but it should still work either way.

Spoiler:
#dynamic 0x9C0B20

#org @Start
lockall
preparemsg @VendingMachine
waitmsg
showmoney 0x0 0x0 0x0
goto @Continue

#org @Continue
multichoice 0x10 0x0 0x2A 0x0
copyvar 0x4001 0x800D
copyvar 0x8000 0x4001
compare 0x8000 0x0
if 0x1 goto @BerryJuiceSet
compare 0x8000 0x1
if 0x1 goto @FreshWaterSet
compare 0x8000 0x2
if 0x1 goto @SodaPopSet
compare 0x8000 0x3
if 0x1 goto @LemonadeSet
compare 0x8000 0x4
if 0x1 goto @MooMooMilkSet
msgbox @DontBuy 0x6
goto @Exit

#org @BerryJuiceSet
setvar 0x4000 0x2C
goto @Continue2

#org @FreshWaterSet
setvar 0x4000 0x1A
goto @Continue2

#org @SodaPopSet
setvar 0x4000 0x1B
goto @Continue2

#org @LemonadeSet
setvar 0x4000 0x1C
goto @Continue2

#org @MooMooMilkSet
setvar 0x4000 0x1D
goto @Continue2

#org @Exit
hidemoney 0x0 0x0
releaseall
end

#org @Continue2
compare 0x4001 0x0
if 0x1 call @BerryJuiceMoneyCheck
compare 0x4001 0x1
if 0x1 call @FreshWaterMoneyCheck
compare 0x4001 0x2
if 0x1 call @SodaPopMoneyCheck
compare 0x4001 0x3
if 0x1 call @LemonadeMoneyCheck
compare 0x4001 0x4
if 0x1 call @MooMooMilkMoneyCheck
compare 0x800D 0x0
if 0x1 goto @NotEnoughMoney
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
compare 0x4001 0x0
if 0x1 call @BerryJuiceMoneyPay
compare 0x4001 0x1
if 0x1 call @FreshWaterMoneyPay
compare 0x4001 0x2
if 0x1 call @SodaPopMoneyPay
compare 0x4001 0x3
if 0x1 call @LemonadeMoneyPay
compare 0x4001 0x4
if 0x1 call @MooMooMilkMoneyPay
updatemoney 0x0 0x0 0x0
bufferitem 0x0 0x4000
sound 0x6A
msgbox @GetDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
random 0x40
compare 0x800D 0x0
if 0x5 goto @NextDrinkSelection
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
sound 0x6A
msgbox @ExtraDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
random 0x40
compare 0x800D 0x0
if 0x5 goto @NextDrinkSelection
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
sound 0x6A
msgbox @ExtraDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
goto @NextDrinkSelection

#org @BerryJuiceMoneyCheck
checkmoney 0x64 0x0
return

#org @FreshWaterMoneyCheck
checkmoney 0xC8 0x0
return

#org @SodaPopMoneyCheck
checkmoney 0x12C 0x0
return

#org @LemonadeMoneyCheck
checkmoney 0x190 0x0
return

#org @MooMooMilkMoneyCheck
checkmoney 0x1F4 0x0
return

#org @NotEnoughMoney
msgbox @NoMoney 0x6
goto @Exit

#org @NotEnoughSpace
msgbox @BagFull 0x6
goto @Exit

#org @BerryJuiceMoneyPay
paymoney 0x64 0x0
return

#org @FreshWaterMoneyPay
paymoney 0xC8 0x0
return

#org @SodaPopMoneyPay
paymoney 0x12C 0x0
return

#org @LemonadeMoneyPay
paymoney 0x190 0x0
return

#org @MooMooMilkMoneyPay
paymoney 0x1F4 0x0
return

#org @NextDrinkSelection
preparemsg @VendingMachine
waitmsg
goto @Continue

#org @VendingMachine
= It's a Vending Machine.\nWhich drink would you like?

#org @DontBuy
= Decided against buying a drink.

#org @GetDrink
= Clang!\pA can of [buffer1] dropped down.

#org @PutAway
= [player] put away the [buffer2]\nin the [buffer3] Pocket.

#org @ExtraDrink
= Clang!\pScore! An extra can of [buffer1]\ndropped down!

#org @NoMoney
= Not enough money[.]

#org @BagFull
= The Bag is full[.]

Also, I have this in the script. Is it ok to overwrite?

'---------------
#org 0x9C0B20
nop1
clearflag 0x0
if 0x0 call 0x1C01001F
nop
nop
nop1
nop
end

Or am I doing this wrong? Because by dynamic 9C0B20, you want me to place the script in $009C0B20, right or no?

Err, scratch that. I have a lot more data in other areas nearby. And FF32E0 and beyond are all FFs.

Actually, I just realized, after expanding the ROM to 32 MB, I still wind up with a Not Enough Free Space Error after using #dynamic 1000000
__________________
If your interested in tutoring me on how to use the scripting and answering all my questions, send me a PM and we can discuss contacting each other in further details.

A little info about me and my goals:

I am burned out on Pokemon games, which, since emerald, have gradually grown worse to me. I am a fan of Generation 3 and earlier. I have some creature ideas I'd rather keep to myself and friends, due to personal reasons. Thus, I want to make my first game encompassing them. I do not know how to program, so I'll learn by using pokemon essentials. Once I complete the game, I'll enjoy it, and work on an entirely new project.
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old April 4th, 2019 (6:48 PM).
PokemonXO PokemonXO is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 44
Quote:
Originally Posted by DrFuji View Post
Here's a version of the vending machine script that should work with the longer multichoice that you've made. The text is a bit weird whenever you receive the Berry Juice/ MooMoo Milk as the script says that you get a can, when the sprites are a coconut(?) and bottle respectively. You could change the text string to something like "You received a [ITEM]!" or something like that, but it should still work either way.

Spoiler:
#dynamic 0x9C0B20

#org @Start
lockall
preparemsg @VendingMachine
waitmsg
showmoney 0x0 0x0 0x0
goto @Continue

#org @Continue
multichoice 0x10 0x0 0x2A 0x0
copyvar 0x4001 0x800D
copyvar 0x8000 0x4001
compare 0x8000 0x0
if 0x1 goto @BerryJuiceSet
compare 0x8000 0x1
if 0x1 goto @FreshWaterSet
compare 0x8000 0x2
if 0x1 goto @SodaPopSet
compare 0x8000 0x3
if 0x1 goto @LemonadeSet
compare 0x8000 0x4
if 0x1 goto @MooMooMilkSet
msgbox @DontBuy 0x6
goto @Exit

#org @BerryJuiceSet
setvar 0x4000 0x2C
goto @Continue2

#org @FreshWaterSet
setvar 0x4000 0x1A
goto @Continue2

#org @SodaPopSet
setvar 0x4000 0x1B
goto @Continue2

#org @LemonadeSet
setvar 0x4000 0x1C
goto @Continue2

#org @MooMooMilkSet
setvar 0x4000 0x1D
goto @Continue2

#org @Exit
hidemoney 0x0 0x0
releaseall
end

#org @Continue2
compare 0x4001 0x0
if 0x1 call @BerryJuiceMoneyCheck
compare 0x4001 0x1
if 0x1 call @FreshWaterMoneyCheck
compare 0x4001 0x2
if 0x1 call @SodaPopMoneyCheck
compare 0x4001 0x3
if 0x1 call @LemonadeMoneyCheck
compare 0x4001 0x4
if 0x1 call @MooMooMilkMoneyCheck
compare 0x800D 0x0
if 0x1 goto @NotEnoughMoney
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
compare 0x4001 0x0
if 0x1 call @BerryJuiceMoneyPay
compare 0x4001 0x1
if 0x1 call @FreshWaterMoneyPay
compare 0x4001 0x2
if 0x1 call @SodaPopMoneyPay
compare 0x4001 0x3
if 0x1 call @LemonadeMoneyPay
compare 0x4001 0x4
if 0x1 call @MooMooMilkMoneyPay
updatemoney 0x0 0x0 0x0
bufferitem 0x0 0x4000
sound 0x6A
msgbox @GetDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
random 0x40
compare 0x800D 0x0
if 0x5 goto @NextDrinkSelection
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
sound 0x6A
msgbox @ExtraDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
random 0x40
compare 0x800D 0x0
if 0x5 goto @NextDrinkSelection
checkitemroom 0x4000 0x1
compare 0x800D 0x0
if 0x1 goto @NotEnoughSpace
sound 0x6A
msgbox @ExtraDrink 0x6
additem 0x4000 0x1
bufferitem 0x1 0x4000
bufferstd 0x2 0xE
msgbox @PutAway 0x6
goto @NextDrinkSelection

#org @BerryJuiceMoneyCheck
checkmoney 0x64 0x0
return

#org @FreshWaterMoneyCheck
checkmoney 0xC8 0x0
return

#org @SodaPopMoneyCheck
checkmoney 0x12C 0x0
return

#org @LemonadeMoneyCheck
checkmoney 0x190 0x0
return

#org @MooMooMilkMoneyCheck
checkmoney 0x1F4 0x0
return

#org @NotEnoughMoney
msgbox @NoMoney 0x6
goto @Exit

#org @NotEnoughSpace
msgbox @BagFull 0x6
goto @Exit

#org @BerryJuiceMoneyPay
paymoney 0x64 0x0
return

#org @FreshWaterMoneyPay
paymoney 0xC8 0x0
return

#org @SodaPopMoneyPay
paymoney 0x12C 0x0
return

#org @LemonadeMoneyPay
paymoney 0x190 0x0
return

#org @MooMooMilkMoneyPay
paymoney 0x1F4 0x0
return

#org @NextDrinkSelection
preparemsg @VendingMachine
waitmsg
goto @Continue

#org @VendingMachine
= It's a Vending Machine.\nWhich drink would you like?

#org @DontBuy
= Decided against buying a drink.

#org @GetDrink
= Clang!\pA can of [buffer1] dropped down.

#org @PutAway
= [player] put away the [buffer2]\nin the [buffer3] Pocket.

#org @ExtraDrink
= Clang!\pScore! An extra can of [buffer1]\ndropped down!

#org @NoMoney
= Not enough money[.]

#org @BagFull
= The Bag is full[.]
Well, shoot, I tried your method, I even used the same script location as the Dynamic address, and the code still doesn't work.
__________________
If your interested in tutoring me on how to use the scripting and answering all my questions, send me a PM and we can discuss contacting each other in further details.

A little info about me and my goals:

I am burned out on Pokemon games, which, since emerald, have gradually grown worse to me. I am a fan of Generation 3 and earlier. I have some creature ideas I'd rather keep to myself and friends, due to personal reasons. Thus, I want to make my first game encompassing them. I do not know how to program, so I'll learn by using pokemon essentials. Once I complete the game, I'll enjoy it, and work on an entirely new project.
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old April 5th, 2019 (11:49 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
I tested my script on the link you had before it was deleted (no linking to ROMs please, we only allow patches) and it worked just fine.

Spoiler:


You've correctly edited the multichoice box which is great, but you don't need to insert the script at 0x9C0B20 exactly, its just the beginning of some free space in Emerald. Whatever you have at that specific offset seems to be corrupt so just compile my script and C+P the resulting offset into a signpost script in A-Map. Whenever I compiled my script it was inserted 0x9C2634 so don't worry if something similar happens to you.
__________________
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:13 AM.