The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Script help. (https://www.pokecommunity.com/showthread.php?t=353869)

Kostas August 11th, 2015 11:41 PM

Script help.
 
Hey.
I use XSE and i tried to make just a simple script with a guy giving a pokemon.
I tried it a long time ago and worked perfectly.
Alright, the script is like this.
I dont know why is not working, i just copied the script for testing it.
It has a problem with the command "compare" i think.

Spoiler:

#dynamic 0x800554

#org @start
lock
faceplayer
checkflag 0x1200
if 0x1 goto @done
msgbox @question 0x5
compare LASTRESULT 0x1
if 0x1 goto @givepokemon
msgbox @nothanks 0x6
release
end

#org @done
msgbox @checkup 0x6
release
end

#org @givepokemon
msgbox @thanks 0x6
givepokemon 0x19 0xA 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recieved 0x6
waitfanfare
setflag 0x1200
msgbox @thanks2 0x6
release
end

#org @question
= Hey there!\pYou seem like a nice person!\nWould you like this Pikachu?

#org @nothanks
= Oh? That's to bad.\pCome back if you change your mind.

#org @thanks
= Oh! That's GREAT!\pHere you go!

#org @thanks2
= Thanks again! I think it will have\nmore fun with you than with me.

#org @recieved
= \v\h01 recieved a PIKACHU!

#org @checkup


Also if you can help me with another script i would appreciate that.
I made a new town in A-map and i just want to make sure the player does not go in wild grass until he had obtained a Pokemon.
Thank you!

FamiliaWerneck August 12th, 2015 2:03 AM

Quote:

Originally Posted by Kwstaspaokara (Post 8887082)
Hey.
I use XSE and i tried to make just a simple script with a guy giving a pokemon.
I tried it a long time ago and worked perfectly.
Alright, the script is like this.
I dont know why is not working, i just copied the script for testing it.
It has a problem with the command "compare" i think.

Spoiler:

#dynamic 0x800554

#org @start
lock
faceplayer
checkflag 0x1200
if 0x1 goto @done
msgbox @question 0x5
compare LASTRESULT 0x1
if 0x1 goto @givepokemon
msgbox @nothanks 0x6
release
end

#org @done
msgbox @checkup 0x6
release
end

#org @givepokemon
msgbox @thanks 0x6
givepokemon 0x19 0xA 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recieved 0x6
waitfanfare
setflag 0x1200
msgbox @thanks2 0x6
release
end

#org @question
= Hey there!\pYou seem like a nice person!\nWould you like this Pikachu?

#org @nothanks
= Oh? That's to bad.\pCome back if you change your mind.

#org @thanks
= Oh! That's GREAT!\pHere you go!

#org @thanks2
= Thanks again! I think it will have\nmore fun with you than with me.

#org @recieved
= \v\h01 recieved a PIKACHU!

#org @checkup


Also if you can help me with another script i would appreciate that.
I made a new town in A-map and i just want to make sure the player does not go in wild grass until he had obtained a Pokemon.
Thank you!

The message box for question has to be a yesno message box. You are comparing your 01 (Yes, I want a Pikachu) with a last result that didn't happen (You don't actually ask if you want or not a Pikachu,code-wise).
Also, I believe you have to have a message there for "@checkup". I could be wrong.
And is flag 1200 ok to use?

Kostas August 12th, 2015 2:08 AM

Quote:

Originally Posted by FamiliaWerneck (Post 8887154)
The message box for question has to be a yesno message box. You are comparing your 01 (Yes, I want a Pikachu) with a last result that didn't happen (You don't actually ask if you want or not a Pikachu,code-wise).
Also, I believe you have to have a message there for "@checkup". I could be wrong.
And is flag 1200 ok to use?

Unfortunately, i suck at scripting and i have no idea about what is wrong.
Actually i remember using it a long time ago.
I copied the script which i found it and like i said before it worked perefectly.

FamiliaWerneck August 12th, 2015 2:20 AM

Quote:

Originally Posted by Kwstaspaokara (Post 8887159)
Unfortunately, i suck at scripting and i have no idea about what is wrong.
Actually i remember using it a long time ago.
I copied the script which i found it and like i said before it worked perefectly.

Yeah, it's pretty close to diegoisawesome's Give Pokémon script.
Where does it stop working?
You press "Yes" and get no Pikachu, or you get the Pikachu, but the boxes won't close... Where does it go bananas?

Shadowraze August 12th, 2015 2:23 AM

The script should be working properly. You probably don't have rbh files that supports LASTRESULT change it to 0x800D compile and try it out in-game to see if it works. :)

Kostas August 12th, 2015 2:23 AM

Quote:

Originally Posted by FamiliaWerneck (Post 8887170)
Yeah, it's pretty close to diegoisawesome's Give Pokémon script.
Where does it stop working?
You press "Yes" and get no Pikachu, or you get the Pikachu, but the boxes won't close... Where does it go bananas?

I can't compile the script. It keeps saying that ther is a problem in the line which is the command "compare".
I tried to give it a try with no compare command, i can compile the script but if i choose "yes" it is like i choose no.
So there is no "Yes" answer.

Kostas August 12th, 2015 2:28 AM

"Error 13 'type mismatch' on line 9. Missing #define." That is what it keeps me saying.

Shadowraze August 12th, 2015 2:43 AM

Quote:

Originally Posted by Kwstaspaokara (Post 8887178)
"Error 13 'type mismatch' on line 9. Missing #define." That is what it keeps me saying.

Can you post the one that you're compiling?

Kostas August 12th, 2015 2:51 AM


Shadowraze August 12th, 2015 2:56 AM

I told you on the previous post to change LASTRESULT to 0x800D lol. It should work once you've changed it.

Kostas August 12th, 2015 3:02 AM

Quote:

Originally Posted by Shadowraze (Post 8887200)
I told you on the previous post to change LASTRESULT to 0x800D lol. It should work once you've changed it.

Hahaha sorry man i forgot this. Aaaaand it worked. Thank you very much.
Also if you want and you can help me with the other thing i wrote at the first post you rock.
Thanks again!

Shadowraze August 12th, 2015 3:13 AM

Quote:

Originally Posted by Kwstaspaokara (Post 8887082)
Also if you can help me with another script i would appreciate that.
I made a new town in A-map and i just want to make sure the player does not go in wild grass until he had obtained a Pokemon.
Thank you!

You mean this one?

Well there are different ways to approach this you can go with script tiles or simply npc's blocking the path. You can like do a hidesprite for the npc's if you are going with those and use the flag 0x828 since it's the one that activates the pokemon menu or maybe a level script to change the position of the npc. Since you're a beginner a script tile would probably be your best go although I can't make an example atm I'll edit the post once I finish what I'm currently doing lol.

EDIT:
TOTALLY FORGOT TO EDIT THIS LOL
Anyways just put this script on a script tile with var 0x5000 just put that in the var number, tho I'm not sure if that's a safe var just change it lol.
Spoiler:
#dynamic 0x800000

#org @main
checkflag 0x828
if 0x0 goto @gtfo
setvar 0x5000 0x1
end

#org @gtfo
msgbox @nomon 0x6
applymovement 0xff @gb
waitmovement 0x0
return

#org @nomon
= I don't have a Pokemon yet.\nI should wait until I have one.

#org @gb
#raw 0x8
#raw 0xfe

I didn't really test this so tell me if something's wrong. :)

Kostas August 12th, 2015 5:00 AM

Quote:

Originally Posted by Shadowraze (Post 8887207)
You mean this one?

Well there are different ways to approach this you can go with script tiles or simply npc's blocking the path. You can like do a hidesprite for the npc's if you are going with those and use the flag 0x828 since it's the one that activates the pokemon menu or maybe a level script to change the position of the npc. Since you're a beginner a script tile would probably be your best go although I can't make an example atm I'll edit the post once I finish what I'm currently doing lol.

EDIT:
TOTALLY FORGOT TO EDIT THIS LOL
Anyways just put this script on a script tile with var 0x5000 just put that in the var number, tho I'm not sure if that's a safe var just change it lol.
Spoiler:
#dynamic 0x800000

#org @main
checkflag 0x828
if 0x0 goto @gtfo
setvar 0x5000 0x1
end

#org @gtfo
msgbox @nomon 0x6
applymovement 0xff @gb
waitmovement 0x0
return

#org @nomon
= I don't have a Pokemon yet.\nI should wait until I have one.

#org @gb
#raw 0x8
#raw 0xfe

I didn't really test this so tell me if something's wrong. :)

Man, you are the best. It worked like a charm. Thanks again.

Shadowraze August 12th, 2015 5:03 AM

Quote:

Originally Posted by Kwstaspaokara (Post 8887289)
Man, you are the best. It worked like a charm. Thanks again.

Np mate, remember to change the flags to 0x828 on the previous script so it'll work accordingly. :)


All times are GMT -8. The time now is 2:30 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.