View Single Post
  #257    
Old January 13th, 2009, 05:30 AM
Andryandrew
Italian Asm Hacker
 
Join Date: Mar 2007
Age: 21
Gender:
Nature: Timid
Quote:
Originally Posted by NeoNemesis View Post
I just learned how to make level scripts, and everything is working fine except for one problem I'm running into. You see I set a flag in the beginning of the game to hide a sprite in one of the houses in pallet town. That flag was 112. So the sprite was hidden. Then I went and made a script that when I talk to a man he leads him to his house, and in his house I put a level script where he gives me a Pokemon (celebi). It all works fine, and I get the Celebi and everything. I made it so that the flag I set in the beginning of the game is cleared when I talk to the man, because I want the sprite in the house that he's leading me to to be visible again. So, the sprite is visible again and all works fine. HOWEVER, my problem is that when I go into the house without talking to the old man, as soon as I enter the house, the game freezes... Or at least the character freezes. I've been trying to solve this for like 2 weeks but to no avail... any help?

Here are my 2 scripts:

The first one, when the old man leads me to his house (this one works fine)

Spoiler:
#Dynamic 0x802000

#org @start
checkflag 0x109
if b_true goto @done
lock
faceplayer
message @1
boxset 5
compare LASTRESULT 1
if 1 goto @wierd
message @letsgo
boxset 6
release
end

#org @wierd
message @3
boxset 6
setflag 0x109
applymovement 0x04 @movehouse
applymovement 0xFF @moveplayer
waitmovement 0x0
setdooropened 0xF 0x7
doorchange
applymovement 0x04 @11
applymovement 0xFF @11h
waitmovement 0x0
hidesprite 0x04 0x00
applymovement 0xFF @11h2
waitmovement 0x0
setdoorclosed 0xF 0x7
doorchange
clearflag 0x112
warp 0x4 0x2 0x0 0x26C 0x1000
release
end

#org @11
#RAW 0x11 0xFE

#org @11h
#RAW 0x12 0xFE

#org @11h2
#RAW 0x11 0xFE

#org @1
= Hey, do you want to come\nsee my house?

#org @movehouse
#RAW 0x0 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x01 0xFE

#org @moveplayer
#RAW 0x0 0x10 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0xFE

#org @letsgo
= Man, you sure are wierd!

#org @3
= Ok, follow me!

#org @done
release
end


Here is the LEVEL script:

Spoiler:
#dynamic 0x804000

#org @start
checkflag 0x112
if b_true goto @done
checkflag 0x119
if b_true goto @done
movesprite 0x03 0x4 0x7
applymovement 0x03 @moveinh
applymovement 0xFF @moveinhp
waitmovement 0x0
message @give
boxset 6
givepokemon 0x1 0xFB 0x0 0x0 0x0 0x0
fanfare 0x13E
message @given
boxset 6
message @nickname
boxset 5
compare LASTRESULT 1
if 1 gosub @name
message @6
boxset 6
setflag 0x119
setvar 0x4033 0x1
release
end

#org @moveinh
#RAW 0x11 0x11 0x00 0xFE

#org @moveinhp
#RAW 0x11 0x11 0xFE

#org @give
= Here, take this Pokemon as a\ngift for following me.

#org @nickname
= Would you like to rename Celebi?

#org @name
call 0x1A74EB
return

#org @done
release
end

#org @given
= \v\h01 Received a Celebi!

#org @6
= \c\h01\h06\v\h01 : Thanks!

#org @moveinh2
#RAW 0x11 0x13 0xFE


NOTE: I'm probably 100% sure that the problem isn't with the script, rather with the way I'm setting up the level script. The type of level script I'm using is the one "02 Validates Values, loads handler to 0x0300EB0" And I put the "Flag" as 4033 and the "Value" as 0000. Every time I try to put this same level script using a different type, the game freezes.


Now, I have two more questions: How do I make a script where if I.. say.. for example push a button, like the one behind the poster in celadon game corner in FR, and when the button is pushed I want a staircase to appear. How would that work?

How would I make it so each time you enter a map, different wild pokemon appear, like in GSC when you solve the puzzle and each time you solve it more unown appear in the cavern.
mmm... for the house, the problem is probably that var 0x4033 is setted to a wrong value when you enter the house... you can try to change the var (for example Var: 5000 Value: 0000) and of course change it in the script too...

For the stairs to appear, you have to use this command (you can see it also in XSE command help):
setmaptile [XXXX position] [YYYY position] [ZZZZ block number] [AAAA movement permission]
__________________

Sorry for my bad English... I'm Italian
Anybody that is a GBA ASM hacker is cool!
I'm a GBA ASM hacker --> I'm cool :D

Made Day-Night Routine! You can find the thread HERE