Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#401 2017-06-16 23:45:56

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 424/450
Website

Re: Simple Questions & Answers

kaitokid wrote:

How can I make the Pokemon from this script shiny?

faceplayer
opentext
checkevent EVENT_GOT_HP_UP_FROM_RANDY
iftrue .gothpup
checkevent EVENT_GAVE_KENYA
iftrue .questcomplete
checkevent EVENT_GOT_KENYA
iftrue .alreadyhavekenya
writetext UnknownText_0x69ddd
yesorno
iffalse .refused
writetext UnknownText_0x69e48
buttonsound
waitsfx
checkcode VAR_PARTYCOUNT
if_equal PARTY_LENGTH, .partyfull
writetext UnknownText_0x69eb8
playsound SFX_KEY_ITEM
waitsfx
givepoke SPEAROW, 10, NO_ITEM, 1, GiftSpearowName, GiftSpearowOTName
givepokeitem GiftSpearowMail
setevent EVENT_GOT_KENYA

Thanks

The DVs for that Pokemon are generated here: https://github.com/pret/pokecrystal/blo … #L182-L185. This belongs to the TryAddMonToParty function, which is called by the GivePoke function with MonType containing 0.

I would suggest setting bit 7 of the level argument, then checking it in TryAddMonToParty to generate custom DVs instead. In the givePoke script, the level goes into the CurPartyLevel address. You would have to and all the CurPartyLevel reads with 0x7F, and ideally reset bit 7 for CurPartyLevel altogether after the DVs are set.

Of course, there are many ways you can do this. You could probably find another spare memory address to use without risking undesired side effects, or even create a second givepoke script that ensures shiny DVs if you want to use it for other Pokemon too.

Last edited by Crystal_ (2017-06-16 23:46:55)

Offline

#402 2017-06-17 00:03:46

Rangi
Member
Registered: 2016-05-09
Post 722/951

Re: Simple Questions & Answers

Crystal_ wrote:

The DVs for that Pokemon are generated here: https://github.com/pret/pokecrystal/blo … #L182-L185. This belongs to the TryAddMonToParty function, which is called by the GivePoke function with MonType containing 0.

I would suggest setting bit 7 of the level argument, then checking it in TryAddMonToParty to generate custom DVs instead. In the givePoke script, the level goes into the CurPartyLevel address. You would have to and all the CurPartyLevel reads with 0x7F, and ideally reset bit 7 for CurPartyLevel altogether after the DVs are set.

Of course, there are many ways you can do this. You could probably find another spare memory address to use without risking undesired side effects, or even create a second givepoke script that ensures shiny DVs if you want to use it for other Pokemon too.

My own approach would be to add "special MakeLastMonShiny" after the "givepoke" and "givepokeitem" commands. MakeLastMonShiny would be an asm routine that gets the last party Pokémon's DVs (since Kenya will definitely be last in the party) and sets them to ATKDEFDV_SHINY and SPDSPCDV_SHINY (the same values used for Red Gyarados). This routine would have to be registered with "add_special MakeLastMonShiny" in engine/specials.asm.

(Why not a script command "makelastmonshiny"? Because adding a new script command is slightly more complicated than adding a new special, plus the advantage of script commands is that it's easy to pass arguments to them, and MakeLastMonShiny doesn't need any.)

Last edited by Rangi (2017-06-17 00:10:25)

Offline

#403 2017-06-17 00:22:11

Maniac379
Member
Registered: 2015-01-15
Post 92/124

Re: Simple Questions & Answers

Rangi wrote:

EVENT_SAW_BIRDS can be true or false. EVENT_FOUGHT_ZAPDOS can be true or false. Try running the script in your head; make a table of all four possibilities, whether Zapdos will appear or not. There's a certain combination that it handles incorrectly.

I think I'm messing up on syntax.  I've been staring at this for so long.  Once it hits the return in .AppearZapdos does it completely exit out of the callback or go back to the rest of the script?  I mean if I move the EVENT_FOUGHT_ZAPDOS check into the AppearZapdos script then it doesn't even show Zapdos....


---
Pokémon White Crystal
A simple quality of life and gameplay improved hack

Offline

#404 2017-06-17 00:46:01

Rangi
Member
Registered: 2016-05-09
Post 723/951

Re: Simple Questions & Answers

Maniac379 wrote:
Rangi wrote:

EVENT_SAW_BIRDS can be true or false. EVENT_FOUGHT_ZAPDOS can be true or false. Try running the script in your head; make a table of all four possibilities, whether Zapdos will appear or not. There's a certain combination that it handles incorrectly.

I think I'm messing up on syntax.  I've been staring at this for so long.  Once it hits the return in .AppearZapdos does it completely exit out of the callback or go back to the rest of the script?  I mean if I move the EVENT_FOUGHT_ZAPDOS check into the AppearZapdos script then it doesn't even show Zapdos....

I think you can guess which of those things "return" is doing. Hint: which behavior would perfectly explain your problem? Also, look at how other maps' callbacks work, see how they use "return".

Offline

#405 2017-06-17 00:51:26

Maniac379
Member
Registered: 2015-01-15
Post 93/124

Re: Simple Questions & Answers

Rangi wrote:
Maniac379 wrote:
Rangi wrote:

EVENT_SAW_BIRDS can be true or false. EVENT_FOUGHT_ZAPDOS can be true or false. Try running the script in your head; make a table of all four possibilities, whether Zapdos will appear or not. There's a certain combination that it handles incorrectly.

I think I'm messing up on syntax.  I've been staring at this for so long.  Once it hits the return in .AppearZapdos does it completely exit out of the callback or go back to the rest of the script?  I mean if I move the EVENT_FOUGHT_ZAPDOS check into the AppearZapdos script then it doesn't even show Zapdos....

I think you can guess which of those things "return" is doing. Hint: which behavior would perfectly explain your problem? Also, look at how other maps' callbacks work, see how they use "return".

I'm honestly asking this because I have tried various combinations for at least a couple of hours.  The closest map I have to look at is one that I previously edited which does not even have return in the other scripts which leads me to believe that the scripts just run after each other and seems a little iffy (but works).  I feel like I should be using a term other than return to end the script.  If you want to suggest a map for me to look at I can keep trying but I really would like to stop banging my head against the wall.


---
Pokémon White Crystal
A simple quality of life and gameplay improved hack

Offline

#406 2017-06-17 00:57:44

Rangi
Member
Registered: 2016-05-09
Post 724/951

Re: Simple Questions & Answers

Maniac379 wrote:

I'm honestly asking this because I have tried various combinations for at least a couple of hours.  The closest map I have to look at is one that I previously edited which does not even have return in the other scripts which leads me to believe that the scripts just run after each other and seems a little iffy (but works).  I feel like I should be using a term other than return to end the script.  If you want to suggest a map for me to look at I can keep trying but I really would like to stop banging my head against the wall.

Yes, "return" terminates the whole callback, just as "end" terminates a whole script. (If it didn't terminate the callback, how would you ever stop one?)

Now imagine how your callback works when EVENT_SAW_BIRDS and EVENT_FOUGHT_ZAPDOS are both true, and compare the intended behavior to the actual behavior.

Offline

#407 2017-06-17 01:08:02

Maniac379
Member
Registered: 2015-01-15
Post 94/124

Re: Simple Questions & Answers

Rangi wrote:
Maniac379 wrote:

I'm honestly asking this because I have tried various combinations for at least a couple of hours.  The closest map I have to look at is one that I previously edited which does not even have return in the other scripts which leads me to believe that the scripts just run after each other and seems a little iffy (but works).  I feel like I should be using a term other than return to end the script.  If you want to suggest a map for me to look at I can keep trying but I really would like to stop banging my head against the wall.

Yes, "return" terminates the whole callback, just as "end" terminates a whole script. (If it didn't terminate the callback, how would you ever stop one?)

Now imagine how your callback works when EVENT_SAW_BIRDS and EVENT_FOUGHT_ZAPDOS are both true, and compare the intended behavior to the actual behavior.

I feel like I have no choice but to split the callback into 2 call backs then.  Since I cannot use return.

.MapCallbacks:
db 2

dbw MAPCALLBACK_OBJECTS, .ZapdosCheck
dbw MAPCALLBACK_OBJECTS, .FoughtZapdosCheck

.ZapdosCheck:
disappear ROUTE10NORTH_ZAPDOS
checkevent EVENT_SAW_BIRDS
iftrue .AppearZapdos
return

.FoughtZapdosCheck:
checkevent EVENT_FOUGHT_ZAPDOS
iftrue .DisappearZapdos
return

.AppearZapdos
appear ROUTE10NORTH_ZAPDOS
return

.DisappearZapdos
disappear ROUTE10NORTH_ZAPDOS
return

I must be blind because in my eyes if both EVENTS are true this series occurs:
Disappear Zapdos (Default)
Appear Zapdos (EVENT_SAW_BIRDS True)
Disappear Zapdos (EVENT_FOUGHT_ZAPDOS True)


---
Pokémon White Crystal
A simple quality of life and gameplay improved hack

Offline

#408 2017-06-17 01:15:27

Rangi
Member
Registered: 2016-05-09
Post 725/951

Re: Simple Questions & Answers

Maniac379 wrote:

I feel like I have no choice but to split the callback into 2 call backs then.  Since I cannot use return.

.MapCallbacks:
db 2

dbw MAPCALLBACK_OBJECTS, .ZapdosCheck
dbw MAPCALLBACK_OBJECTS, .FoughtZapdosCheck

.ZapdosCheck:
disappear ROUTE10NORTH_ZAPDOS
checkevent EVENT_SAW_BIRDS
iftrue .AppearZapdos
return

.FoughtZapdosCheck:
checkevent EVENT_FOUGHT_ZAPDOS
iftrue .DisappearZapdos
return

.AppearZapdos
appear ROUTE10NORTH_ZAPDOS
return

.DisappearZapdos
disappear ROUTE10NORTH_ZAPDOS
return

I must be blind because in my eyes if both EVENTS are true this series occurs:
Disappear Zapdos (Default)
Appear Zapdos (EVENT_SAW_BIRDS True)
Disappear Zapdos (EVENT_FOUGHT_ZAPDOS True)

Why do you think you can't use return? Also, I'm not even sure if there's a fixed order to callbacks. For simplicity's sake alone, you should definitely not try manipulating one sprite with more than one callback.

Read your original callback again, line by line. 1: Zapdos disappears. 2: since EVENT_SAW_BIRDS is true, Zapdos appears. 3: return. So what if EVENT_FOUGHT_ZAPDOS is true? You've already returned, that event is never checked.

Take a step back and reconsider what overall behavior you want. I'm guessing this:

• EVENT_SAW_BIRDS false, EVENT_FOUGHT_ZAPDOS false: disappear
• EVENT_SAW_BIRDS false, EVENT_FOUGHT_ZAPDOS true: impossible
• EVENT_SAW_BIRDS true, EVENT_FOUGHT_ZAPDOS false: appear
• EVENT_SAW_BIRDS true, EVENT_FOUGHT_ZAPDOS true: disappear

You could just write out all those cases explicitly, but it's not necessary. You can simplify the conditions. That first script was just a failed attempt at doing so.

Maybe imagine how you would explain the desired behavior to a person, and then write that out with script commands.

Edit: I might see the source of your confusion. "iftrue" and "iffalse" act like "jump", not like "scall". When you execute "iftrue .AppearZapdos", it's not going to continue executing the lines after that one when the .AppearZapdos block reaches a "return".

Last edited by Rangi (2017-06-17 01:19:39)

Offline

#409 2017-06-17 01:24:03

Maniac379
Member
Registered: 2015-01-15
Post 95/124

Re: Simple Questions & Answers

I DO NOT understand why this does not work.  Up to this point (with returns mistakes out of the equation), when EVENT_SAW_BIRDS is true - Zapdos is visible.

checkevent EVENT_FOUGHT_ZAPDOS
iftrue .DisappearZapdos
return

.DisappearZapdos
disappear ROUTE10NORTH_ZAPDOS
return

If EVENT_FOUGHT_ZAPDOS is true from my encounter script, this should make Zapdos disappear.


---
Pokémon White Crystal
A simple quality of life and gameplay improved hack

Offline

#410 2017-06-17 22:21:18

Maniac379
Member
Registered: 2015-01-15
Post 99/124

Re: Simple Questions & Answers

My Zapdos sprite now works correctly after changing the flag it is attributed to at the end of its .PersonEvents section.

Now my other birds are not correctly hiding.

For example, this map callback will correctly hide my sprites:
.HideBirds:
disappear SILVERCAVEOUTSIDE_ARTICUNO
disappear SILVERCAVEOUTSIDE_ZAPDOS
disappear SILVERCAVEOUTSIDE_MOLTRES1
disappear SILVERCAVEOUTSIDE_MOLTRES2
return

But if I add in the following, now all of a sudden all 4 sprites are visible by default.

.HideBirds:
disappear SILVERCAVEOUTSIDE_ARTICUNO
disappear SILVERCAVEOUTSIDE_ZAPDOS
disappear SILVERCAVEOUTSIDE_MOLTRES1
disappear SILVERCAVEOUTSIDE_MOLTRES2
checkevent EVENT_SAW_BIRDS
iftrue .AppearMoltres
return

.AppearMoltres
appear SILVERCAVEOUTSIDE_MOLTRES2
checkevent EVENT_FOUGHT_MOLTRES
iftrue .DisappearMoltres
return

.DisappearMoltres
disappear SILVERCAVEOUTSIDE_MOLTRES2
return

It is rather infuriating


---
Pokémon White Crystal
A simple quality of life and gameplay improved hack

Offline

#411 2017-06-18 16:21:29

MajinCubyan
New member
Registered: 2017-06-18
Post 1/9

Re: Simple Questions & Answers

Hey guys, had a quick question. Added a new map, got everything set up but I've been running into this error nonstop.

I moved the blockdata and got everything set up as it should be, I think. I assume I'm probably not doing something right, so any help would be appreciated.

Error;
Unknown symbol 'ROUTE_101_WIDTH'

Thanks yo!

Offline

#412 2017-06-18 19:20:06

rbroab
Member
Registered: 2017-06-13
Post 13/100

Re: Simple Questions & Answers

When going to build the rom, I enter 'make' but some times it skips files.

I've made changes to 'main.asm' also sprite files, but they aren't being applied.

It's weird because I can still make the rom, the rom still plays, but the changes aren't being made. Things like changing the default player names and the player sprites. Anyone else experience this? I can look in the cygwin window while the rom is being built and see that cygwin looks at almost all the files except for ones I've changed. I've made changes and built the rom before, so this is completely new to me.

Offline

#413 2017-06-23 18:56:50

Maniac379
Member
Registered: 2015-01-15
Post 100/124

Re: Simple Questions & Answers

I think I am having trouble because of how my PersonEvent is set up

person_event SPRITE_ZAPDOS, 10, 11, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, PERSONTYPE_SCRIPT, 0, ZapdosBattle, EVENT_SAW_ZAPDOS

What do all of the numbers effect (not the position numbers) and what does the flag at the end do?


---
Pokémon White Crystal
A simple quality of life and gameplay improved hack

Offline

#414 2017-06-27 11:50:04

JaceDeane
Member
From: 'Straya
Registered: 2017-01-28
Post 19/29

Re: Simple Questions & Answers

I'm not sure if I'm alone in this, but in trying to install and use Crowdmap, when reaching the stage where I copy the code into the Cygwin terminal, it tells me that:

"bash: python: command not found"

and does not let me proceed. Any advice for helping me deal with this would be super appreciated!

Last edited by JaceDeane (2017-06-27 11:50:34)

Offline

#415 2017-06-27 14:15:56

NitroHedgehog
Member
Registered: 2017-06-25
Post 5/53

Re: Simple Questions & Answers

Simple question, but I dunno if it has been answered yet... how can I dissassemble a Pokemon Gen 1 rom? I want to make a Green version of the Red/Blue full color roms (Vanilla) to enjoy but the source code on Github is for the GSC, but when looking in its files, they said things such as enabling or disabling the GSC sprites and palettes. Is it possible to do so?

Offline

#416 2017-06-27 14:54:30

Volt-Ikazuchi
Member
Registered: 2015-07-08
Post 13/23

Re: Simple Questions & Answers

NitroHedgehog wrote:

Simple question, but I dunno if it has been answered yet... how can I dissassemble a Pokemon Gen 1 rom? I want to make a Green version of the Red/Blue full color roms (Vanilla) to enjoy but the source code on Github is for the GSC, but when looking in its files, they said things such as enabling or disabling the GSC sprites and palettes. Is it possible to do so?

I think so, there is a disassembly of Red after all. Unless you're talking about porting Red to the Crystal Disassembly so we can play it with the GSC engine. Then I hope it's possible, because I want to do it as well.


Anyway, I got a question.

This might be a bit of a long post, but please bear with me.

I'm sick of watching people playing hacks and just level grinding through tougher fights like Gym Leaders and hackers just picking more powerful teams just to counter that as a fake difficulty. So I had an idea. Adding some equality rules could force people to stop grinding and actually build a team instead of just brute forcing through challenges.

It's easier to explain with an example. Let's assume a player will face Falkner, and Falkner has a Lv. 12 Hoothoot, a Lv. 13 Pidgey and a Lv. 14 Pidgeotto.

I'd like to have rules like the Stadium Cup rules which force restrictions on level and number of pokémons, so in this case:

The player is only allowed to fight Falkner if:
Its team only has 3 members (including Eggs - That forces a 3v3 match),
there isn't any pokémons exceeding Lv. 14 (the highest leveled pokémon in Falkner's Team - Invalidates grinding as an advantage.),
and all the combined levels of the team do not exceed 39. (sum of all levels from Falkner's Team - Can't run 3 Lv. 14 Pokémons.)



What do I need to implement that? I believe this would help a lot of hackers to make polished hacks with actual difficulty instead of grindfests.

Last edited by Volt-Ikazuchi (2017-06-27 14:56:49)


Hacking Stadium 2. Could really use some help though. Join the Discord!

Offline

#417 2017-06-27 17:14:58

Jirachii.
New member
Registered: 2017-06-25
Post 2/2

Re: Simple Questions & Answers

Is it possible to create an item to change the DVs of a Pokemon in your party so it becomes shiny?

Offline

#418 2017-06-27 19:55:57

rbroab
Member
Registered: 2017-06-13
Post 41/100

Re: Simple Questions & Answers

Does anyone know where to find the values of Pack space in pokecrystal?
Trying to increase max capacity but can't find it.

Offline

#419 2017-06-27 21:16:57

Volt-Ikazuchi
Member
Registered: 2015-07-08
Post 14/23

Re: Simple Questions & Answers

Jirachii. wrote:

Is it possible to create an item to change the DVs of a Pokemon in your party so it becomes shiny?


Come to think of it. A DV checker could be useful. I wonder if it's possible to implement it in the Stat Screen besides the actual stats or at least have an NPC that tell it. An NPC that tells the EV's could be useful too. (But not too much.)

Speaking of EV's, how do you increase the limit for EV boosting items like Proteins? Having the possibility to spam items until a stat is maxed could be useful to cut grinding for Stadium.

Last edited by Volt-Ikazuchi (2017-06-27 21:17:31)


Hacking Stadium 2. Could really use some help though. Join the Discord!

Offline

#420 2017-06-29 14:55:33

Zwyft
New member
Registered: 2017-06-23
Post 5/9

Re: Simple Questions & Answers

Hi everybody! I'm hacking Red and changed the trainer data so that the rival picks the starter weak to yours and his team develops accordingly. That being said, I'd like to 'recycle' the unused Oak Battle script so that the last Gym Leader's team changes based on the starter you chose (Has the starter that beats yours). But I can't seem to work out how to link those battles. If anyone could lend a hand, it would be nice.

Offline

#421 2017-06-29 21:55:18

mattmikemo
New member
Registered: 2017-06-29
Post 1/2

Re: Simple Questions & Answers

I can't for the life of me figure out how to decompress the 2bpp.lz files for the Pokemon sprites in the crystal assembly. I have tried on Mac and PC.

When I put "python gfx.py png gfx/folderyouwant/fileyouwant.2bpp.lz" into a shell, it either returns with a "can't open file 'gfx.py': [Errno 2] No such file or directory"

or "command not found".

Thanks in advance for the help guys.

Offline

#422 2017-06-30 06:30:57

wisejustin
Member
From: Kanto
Registered: 2015-01-04
Post 129/137

Re: Simple Questions & Answers

I dont know if this would be a simple question but how would i go about writinf a script that gives the player a kanto starter from oak based off of what johto starter you chose?
For example:
Cyndaquil=Squirtle
Totodile=Bulbasaur
Chikorita=Charmander

Kinda like in gen 3 how whatever starter you chose thats what legendary dog you found? I was looking at the event for picking a starter i just dont know how id implenent it based off what starter you chose you can getoa counterpart starter from oak

Offline

#423 2017-06-30 13:02:17

value chain
Member
Registered: 2016-09-25
Post 33/43

Re: Simple Questions & Answers

Hey!
You might try something like this:
TX_ASM
ld a, [wRivalStarter]
cp STARTER2 ; These are stored in constants/starter_mons.asm
jr nz, .getcynda
ld hl, .notcynda
call PrintText
jp TextScriptEnd

.getcynda
;here you add a getting pokemon code, you might adapt it from the lapras guy
ld hl, wsomething
set 0, [hl] ;it might be any bit, but i'm using 0 as an example
jp TextScriptEnd

.notcynda
ld a, [wRivalStarter]
cp STARTER3
jr nz, .getchiko
ld hl, .gettoto
call PrintText
jp TextScriptEnd

Then in .getchiko and .gettoto you add the corresponding getting pokemon codes. Then, at the beginning of the code add something like this:

TX_ASM
ld a, [wsomething]
bit 0, a
jr nz, .aftertext
ld hl, .beforetext
call PrintText
jp TextScriptEnd

.aftertext
;Here goes a routine that displays the text after the pokemon is given to you
jp TextScriptEnd

.beforetext
;here goes the code i put earlier

I hope i was clear enough :)

Edit: hehe, i got what you wanted backwards, but the same principle applies... you should name them .getbulba, .getcharm and .getsquirt instead.

Last edited by value chain (2017-06-30 13:08:53)

Offline

#424 2017-06-30 14:27:52

mattmikemo
New member
Registered: 2017-06-29
Post 2/2

Re: Simple Questions & Answers

Now I am getting this when trying to extract png in Pokecrystal assembly.

USCHwau-MMORRISON:polishedcrystal matthew.morrison$ python gfx.py unlz gfx/pics/quilava/front.2bpp.lz
Traceback (most recent call last):
  File "gfx.py", line 8, in <module>
    from extras.pokemontools import gfx, lz
  File "/Users/matthew.morrison/polishedcrystal/extras/pokemontools/__init__.py", line 2, in <module>
    import crystal
  File "/Users/matthew.morrison/polishedcrystal/extras/pokemontools/crystal.py", line 1456, in <module>
    event_flags = wram.read_constants(os.path.join(conf.path, 'constants/event_flags.asm'))
  File "/Users/matthew.morrison/polishedcrystal/extras/pokemontools/wram.py", line 208, in read_constants
    return scrape_constants(lines)
  File "/Users/matthew.morrison/polishedcrystal/extras/pokemontools/wram.py", line 196, in scrape_constants
    bss.read_bss_sections(text)
  File "/Users/matthew.morrison/polishedcrystal/extras/pokemontools/wram.py", line 175, in read_bss_sections
    self.constants[name] = eval(value, self.constants)
  File "<string>", line 1, in <module>
NameError: name 'const_value' is not defined

Offline

#425 2017-07-27 21:58:08

Maniac379
Member
Registered: 2015-01-15
Post 104/124

Re: Simple Questions & Answers

I was following Rangi's commit to show quantity held in bag on the mart screen:

https://github.com/jpmac26/polishedcrys … c73ff295c9

Works great except for TMs.  I guess Rangi doesn't have any stores selling TMs.  I made mine unlimited so wouldn't mind hiding the TM count but I at least need the store to say if the player owns the TM or not.

I tried this as my best shot, it glitches.  I'm not the best with this coding:

.TMHM:
ld a, [CurItem]
cp 0
jr .owns
ret
.owns
inc hl
ret


---
Pokémon White Crystal
A simple quality of life and gameplay improved hack

Offline

Board footer

Powered by FluxBB