Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Help/Question
  • → A Yes/No script that can generate different item/Pokémon received ?

#1 2012-11-03 06:34:19

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 116/331
Website

A Yes/No script that can generate different item/Pokémon received ?

scripta.png

Maybe someone could understand this pic.

So, I want to make a Give Pokemon with yes/no question, which can generate different Pokémon from what you Answer, For Example with that pic.
If we Answer Yes and Yes it will give you Bulbasaur
If we answer No then Yes it will give you Charmander
... Maybe we should use same text pointer and manipulate script, Is this Script can made in Gold/Silver?
Someone may explain it.

Thanks before


my FB

Lurking somewhere here...

Offline

#2 2012-11-03 07:01:41

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,852/3,508

Re: A Yes/No script that can generate different item/Pokémon received ?

Yeah, that's very doable. You could re-use text pointers for the duplicate questions, and so long as you keep all your pointers straight for each fork, it should work. It would probably end up looking something like this (pseudo code):

Msgbox :Q1
Yes/no
If 'Yes' goto :Yes1  //Jumps to answering "Yes" the first time, if no it runs the next line.
Msgbox :Q2
Yes/no
If 'Yes' goto :Yes3  //This is for answering "Yes" after answering "No" the first time, so it jumps to the code to give Pokemon 3, otherwise
Give Poke 4           //You answered "No" both times, you receive Pokemon 4.
Ret                       //End of script

:Yes1
Msgbox :Q2
Yes/no
If 'Yes' goto :Yes2  //This would be answering "Yes" both times, so it jumps to the code to give Pokemon 1, otherwise
Give Poke2            //You chose "No" after choosing "Yes", so it gives Pokemon 2.
Ret                       //End of script

:Yes2
Give Poke1            //The code to give Pokemon 1 goes here.
Ret                       //End of Script

:Yes3
Give Poke3           //The code to give Pokemon 3 goes here.
Ret                      //End of Script 

:Q1
= TextHere           //Text for Question 1

:Q2
= TextHere           //Text for Question 2

Someone might want to double-check me on the way that is organized, since it is almost 2am, but I believe that should get done what you want to do up there. Again, this is not something you could plug into PKSV and go with, just a way of showing how to organize the different scripts and subscripts to get this done. I tried to use labels the way PKSV would, but the fake command names I used are anywhere between PKSV and VB6.

Last edited by Mateo (2012-11-03 07:13:44)

Offline

#3 2012-11-03 07:03:40

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 117/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

Thanks but,
Is that using PKSV? or something?


my FB

Lurking somewhere here...

Offline

#4 2012-11-03 07:06:28

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,853/3,508

Re: A Yes/No script that can generate different item/Pokémon received ?

That is not any real language (hence why I said pseudo-code). I used labels in basically the same way PKSV would use them, but those aren't really the actual commands you would type in. I just wrote down a simplified version to get the order right, then explained what it was about in the commented part. I figured since your initial question was vague, for a way to do this basic thing with Items or Pokemon or something, a more generalized approach was what you were looking for.

EDIT:
The actual commands would be documented in the compendium or the thread that lists the equivalents to the compendium for PKSV. I figured this would be a guide for the way you could organize the code to run properly, without presenting it as straight hex codes or as PKSV scripts because I didn't know which one you preferred to use. Like I say, just an outline to help you out, not an actual script to plug in and go. Hopefully this will be of some help in that regard, and hopefully it actually made sense to anyone besides me lol.

Last edited by Mateo (2012-11-03 07:15:11)

Offline

#5 2012-11-03 07:17:32

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 118/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

._. But thanks :D


my FB

Lurking somewhere here...

Offline

#6 2012-11-03 07:21:55

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,854/3,508

Re: A Yes/No script that can generate different item/Pokémon received ?

No problem. And I'll tell you what- if you aren't able to figure it out like this, I'll re-write this using actual PKSV code for the actual structural part (When I'm more awake), that way you would just fill in the code for giving Pokemon or giving items or whatever you want each result to be. I would do that now, but I'm about to go to sleep and didn't want to accidentally tell you wrong on something specific like that.

Offline

#7 2012-11-03 07:35:44

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 119/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

Okay, just continue your sleep or start sleep, Happy Sleep xD


my FB

Lurking somewhere here...

Offline

#8 2012-11-03 19:42:52

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,859/3,508

Re: A Yes/No script that can generate different item/Pokémon received ?

faceplayer
loadfont
checkbit1 0x0 ' Needs to be a free bitno. Will be used by all the give pokemon scripts.
if true :done ' Checks if you have already received one of the Pokemon
2writetext :Q1 'Asks first question
yesorno
if true :Yes1 ' Jumps to answering "Yes" the first time, else it runs the next line.
2writetext :Q2 ' Asks second question
yesorno
if true :Yes3 ' Jumps to answering "Yes" after answering "No" the first time, else it runs next line.
' Code for giving Pokemon 4 or Item 4 (and checking to make sure pack or party isn't full, if necessary) goes here
closetext
loadmovesprites
setbit1 0x0 ' Needs to be an actual free bitno. and will be used by all give pokemon scripts.
end

:Yes1
2writetext :Q2
yesorno
if true :Yes2 ' This would be answering "Yes" both times, so it jumps to the code to give Pokemon 1, else next line.
' Code for giving Pokemon 2 or Item 2 (and checking to make sure pack or party isn't full, if necessary) goes here
closetext
loadmovesprites
setbit1 0x0 ' Needs to be an actual free bitno. and will be used by all give pokemon scripts.
end

:Yes2
' Code for giving Pokemon 1 or Item 1 (and checking to make sure pack or party isn't full, if necessary) goes here
closetext
loadmovesprites
setbit1 0x0 ' Needs to be an actual free bitno. and will be used by all give pokemon scripts.
end

:Yes3
' Code for giving Pokemon 2 or Item 2 (and checking to make sure pack or party isn't full, if necessary) goes here
closetext
loadmovesprites
setbit1 0x0 ' Needs to be an actual free bitno. and will be used by all give pokemon scripts.
end

:done
2writetext :TextDone
closetext
loadmovesprites
end

:Q1
= Text here.\nCan be any question.\e ' You would put the first question here.

:Q2
= Text here.\nCan be any question.\e ' You would put the second question here.

:TextDone
= Text here.\nCan be anything.\e ' Here you would put what he says when you've already received a Pokemon.

That should be the same thing I posted above, but in PKSV code instead of pseudo code. Everything should be commented properly, so anyone feel free to point out a better way to do this if you see a problem with this.

If you are doing this for a starter Pokemon, you wouldn't have to worry about checking if the party is full for each of the give Pokemon scripts, but if it is later in the game, you would need to do that too. The same goes for giving an item that doesn't go in the key pocket. You would need to check to make sure there is room. I want to think there is already documentation on checking the number of Pokemon in the party and if the pack is full, so I didn't explain those here. I can go back and do it though if it turns out there isn't adequate documentation.

With this, you'll want to go ahead and repoint the event to some blank space before having PKSV compile your code, but it should dynamically find offsets for each of the sub scripts and texts, that's why we used labels. You might also want to make each of the give pokemon scripts say "[Player] received (pokemon name)!" because the give pokemon script code doesn't load that text automatically like verbosegiveitem would. You would call that text the same way we called the other text strings though, so it is simple. I hope this helps.

Offline

#9 2012-11-03 23:02:26

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 121/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

Yeah, thanks I will try it, I will use it for A starter Generator, like in Pokémon Nusantara a FireRed hack,
,and a simple question. What to click in Pksv if we are done so we can put the script in the Rom?
#a noob question, cause I never use pksv xD


my FB

Lurking somewhere here...

Offline

#10 2012-11-04 07:42:12

Miksy91
Member
Registered: 2010-10-16
Post 1,223/2,317

Re: A Yes/No script that can generate different item/Pokémon received ?

y0r124 wrote:

Yeah, thanks I will try it, I will use it for A starter Generator, like in Pokémon Nusantara a FireRed hack,
,and a simple question. What to click in Pksv if we are done so we can put the script in the Rom?
#a noob question, cause I never use pksv xD

Decompile ="load a script from address"
Compile ="save data in addresses (under #orgs)"

Last edited by Miksy91 (2012-11-04 07:42:22)

Offline

#11 2012-11-04 08:21:06

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 124/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

Under #orgs are some byte, then we should place this byte in script in Johtomap? Anyway thanks Miksy91, i'll try it.


my FB

Lurking somewhere here...

Offline

#12 2012-11-06 07:18:11

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 129/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

Sorry for double post, anyone have free bitno list?
And bitno here, how many byte?

Last edited by y0r124 (2012-11-06 07:23:54)


my FB

Lurking somewhere here...

Offline

#13 2012-11-06 17:39:16

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,874/3,508

Re: A Yes/No script that can generate different item/Pokémon received ?

You can find information about these by checking out the threads linked to in kkj1116's Global FAQ and Resource Thread by scrolling down to the Gen II Scripting Engine section of the post.

Offline

#14 2012-11-06 23:32:44

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 130/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

Oh, yeah I forgot that resource thread, even I see it today xD


my FB

Lurking somewhere here...

Offline

#15 2012-11-10 06:39:45

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 134/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

Hei, what is the use bitcheck at line 2?

Because when I compile them . It says something like "wrong command"

#sorry for double post then


my FB

Lurking somewhere here...

Offline

#16 2012-11-10 06:55:19

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,909/3,508

Re: A Yes/No script that can generate different item/Pokémon received ?

I'm not sure why it says its a wrong command. It's supposed to check whichever flag you have the script set after it gives you a Pokemon, so that if you've already received one it will do something else. I'll look into this.

Offline

#17 2012-11-10 07:00:13

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 135/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

Or maybe I put the script wrong ?
. I put the bitcheck same as Elm .0x24, because I want to change Elm script so I put all bit set from Elm script.


my FB

Lurking somewhere here...

Offline

#18 2012-11-10 08:41:15

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 1,910/3,508

Re: A Yes/No script that can generate different item/Pokémon received ?

Well if it was the same as Elm's, it should be a valid one. When you copy and pasted, did you paste in the comments too? If you accidentally deleted one of the ' marks, it would give errors because it wouldn't ignore the comment.

Offline

#19 2012-11-10 09:42:37

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 136/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

I wrote them, not copy pasting,
i wrote like other script,
but the bitcheck i wrote something like

"bitcheck 0x24"
without the quote

0x24 was Elm's bitcheckno.

For other script (or sub-script) i wrote,

"2writetext ' [2-byte pointer to offset] [offset]" or
"2writetext [2-byte pointer to offset] ' [offset]"
#i didn't remember correctly

is that right?

#If you need more specific Information just tell me, i will show the script.


my FB

Lurking somewhere here...

Offline

#20 2012-11-10 12:17:13

Miksy91
Member
Registered: 2010-10-16
Post 1,235/2,317

Re: A Yes/No script that can generate different item/Pokémon received ?

You can't write "anything you want" with a script editor.
PKSV functions so that when a command is written in the right form, it will write it in the rom as byte form.
What you wanted to write there is probably "checkbit1 0x24".

Offline

#21 2012-11-10 12:35:58

y0r124
Member
From: Anywhere.
Registered: 2012-09-12
Post 137/331
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

OMG, maybe I lost the "1"
Maybe I'm only write "checkbit" without the 1's

Thanks, Man.


my FB

Lurking somewhere here...

Offline

#22 2012-11-15 00:37:08

hacker
Member
From: Batam Grove City
Registered: 2011-07-30
Post 355/548
Website

Re: A Yes/No script that can generate different item/Pokémon received ?

How to make person after battle, he will give hiro pokemon or item?
I know how to make person battle script, but what I must write to give hiro Pokemon and where can I place the script? after battle script?


[POKÉMON JOURNEY] hacking planning 2012
Visit my website  www.pokemonhackingblog.blogspot.com

Offline

  • Index
  • → Help/Question
  • → A Yes/No script that can generate different item/Pokémon received ?

Board footer

Powered by FluxBB