The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page [Archive] Script help thread

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
Closed Thread
 
Thread Tools
  #2401   Link to this post, but load the entire thread.  
Old November 21st, 2008 (9:12 PM).
Dratii's Avatar
Dratii Dratii is offline
Working on something new...
 
Join Date: Aug 2008
Nature: Careful
Posts: 195
Quote:
Originally Posted by machomuu View Post
Nowhere in the script did you use "lock" or "faceplayer"
Boxset 0x2 doesn't need "lock" or "faceplayer" it does it automatically.
__________________
Fun


  #2402   Link to this post, but load the entire thread.  
Old November 21st, 2008 (9:15 PM).
Vrai's Avatar
Vrai Vrai is offline
can you feel my heart?
 
Join Date: Jun 2008
Age: 28
Gender: Male
Nature: Adamant
Posts: 2,896
Quote:
Originally Posted by machomuu View Post
Nowhere in the script did you use "lock" or "faceplayer"
Is that really needed? I used boxset 0x2, which gives the same effect as lock and faceplayer. Do I need to have them in a person script altogether?

Edit: I guess I just type too slow.
__________________
  #2403   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (5:14 AM).
machomuu's Avatar
machomuu machomuu is offline
Stuck in Hot Girl Summer
 
Join Date: Apr 2008
Location: Take a left, turn right at the next stop, bear left for a few mil
Gender: Female
Nature: Relaxed
Posts: 10,505
Quote:
Originally Posted by Vrai View Post
Is that really needed? I used boxset 0x2, which gives the same effect as lock and faceplayer. Do I need to have them in a person script altogether?

Edit: I guess I just type too slow.
I think I found it
Spoiler:

#dynamic 0x2DD0F8

#org @start
#raw 0x8F 0x0B 0x00
compare 0x800D 0x0
if 0x1 goto @getenoughexercise '"I get enough exercise..."
compare 0x800D 0x1
if 0x1 goto @whentheresawill '"When there's a will..."
compare 0x800D 0x2
if 0x1 goto @idiotproof '"Make something idiot-proof..."
compare 0x800D 0x3
if 0x1 goto @youreunique '"Always remember that you're unique..."
compare 0x800D 0x4
if 0x1 goto @threekindsofpeople '"There are three kinds of people..."
compare 0x800D 0x5
if 0x1 goto @abbreviation '"Why is abbreviation such a long word?"
compare 0x800D 0x6
if 0x1 goto @handle '"I used to have a handle on life..."
compare 0x800D 0x7
if 0x1 goto @completeidiot '"I'm not a complete idiot..."
compare 0x800D 0x8
if 0x1 goto @mayitakeyourorder '"May I take your order?"
compare 0x800D 0x9
if 0x1 goto @liveforever '"I intend to live forever..."
compare 0x800D 0xA
if 0x1 goto @bodyohagod '"I have the body of a god..."
end

#org @getenoughexercise
msgbox @pushingmyluck
boxset 0x2
release
end

#org @whentheresawill
msgbox @iwanttobeinit
boxset 0x2
release
end

#org @idiotproof
msgbox @betteridiot
boxset 0x2
release
end

#org @youreunique
msgbox @justlike
boxset 0x2
release
end

#org @threekindsofpeople
msgbox @twokinds
boxset 0x2
release
end

#org @abbreviation
msgbox @suchalongword
boxset 0x2
release
end

#org @handle
msgbox @ibrokeit
boxset 0x2
release
end

#org @completeidiot
msgbox @missingparts
boxset 0x2
release
end

#org @mayitakeyourorder
msgbox @cani?
boxset 0x5
compare LASTRESULT 0x1
if 0x1 goto @closed
if 0x0 goto @rudepeoplebugme
release
end

#org @liveforever
msgbox @sofarsogood
boxset 0x2
release
end

#org @bodyohagod
msgbox @buddha
boxset 0x2
release
end

#org @closed
msgbox @wereclosed
boxset 0x2
release
end

#org @rudepeoplebugme
msgbox @you
boxset 0x2
release
end

#org @you
= Meanie.

#org @wereclosed
= I'm sorry, but we're closed.

#org @buddha
= I have the body of a god... \pBuddha.

#org @cani?
= May I take your order?

#org @missingparts
= I'm not a complete idiot...\psome parts are missing.

#org @ibrokeit
= I used to have a handle \non life...\pbut then I broke it.

#org @suchalongword
= Why is "abbreviation" such a long word?

#org @twokinds
= There are three kinds of people... \pThose who can count, and those\nwho can't.

#org @justlike
= Always remember that you're unique...\pjust like everyone else.

#org @betteridiot
= Make something idiot-proof...\pand someone will make a \nbetter idiot.

#org @iwanttobeinit
= When there's a will...\pI want to be in it.

#org @pushingmyluck
= I get enough exercise just \npushing my luck.

#org @sofarsogood
= I intend to live forever... \pso far, so good.

You don't need the release at @start, because it's all commanding what the script should n do next, it hasn't said anything until after @start so it releases the script before it can get to the actual script or even acknowledge you.
  #2404   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (6:08 AM).
Sierraffinity's Avatar
Sierraffinity Sierraffinity is offline
Retiring from Pokémon ROM hacking
 
Join Date: Dec 2007
Location: Somewhere the rains of Africa can be blessed
Age: 26
Gender: Female
Nature: Naive
Posts: 1,071
Quote:
Originally Posted by Vrai View Post
Alright, everybody. I made a pretty big script that is supposed to define a random thing to talk about, and then talk about it. When I put the script on A-Map, and then talk to the person in the emulator, nothing happens. What did I do wrong?

Here's the script...
Spoiler:
#dynamic 0x2DD0F8

#org @start
#raw 0x8F 0x0B 0x00
compare 0x800D 0x0
if 0x1 goto @getenoughexercise
compare 0x800D 0x1
if 0x1 goto @whentheresawill
compare 0x800D 0x2
if 0x1 goto @idiotproof
compare 0x800D 0x3
if 0x1 goto @youreunique
compare 0x800D 0x4
if 0x1 goto @threekindsofpeople
compare 0x800D 0x5
if 0x1 goto @abbreviation
compare 0x800D 0x6
if 0x1 goto @handle
compare 0x800D 0x7
if 0x1 goto @completeidiot
compare 0x800D 0x8
if 0x1 goto @mayitakeyourorder
compare 0x800D 0x9
if 0x1 goto @liveforever
compare 0x800D 0xA
if 0x1 goto @bodyohagod
end

#org @getenoughexercise
msgbox @pushingmyluck
boxset 0x2
release
end

#org @whentheresawill
msgbox @iwanttobeinit
boxset 0x2
release
end

#org @idiotproof
msgbox @betteridiot
boxset 0x2
release
end

#org @youreunique
msgbox @justlike
boxset 0x2
release
end

#org @threekindsofpeople
msgbox @twokinds
boxset 0x2
release
end

#org @abbreviation
msgbox @suchalongword
boxset 0x2
release
end

#org @handle
msgbox @ibrokeit
boxset 0x2
release
end

#org @completeidiot
msgbox @missingparts
boxset 0x2
release
end

#org @mayitakeyourorder
msgbox @cani
boxset 0x5
compare LASTRESULT 0x1
if 0x1 goto @closed
if 0x0 goto @rudepeoplebugme
release
end

#org @liveforever
msgbox @sofarsogood
boxset 0x2
release
end

#org @bodyohagod
msgbox @buddha
boxset 0x2
release
end

#org @closed
msgbox @wereclosed
boxset 0x2
release
end

#org @rudepeoplebugme
msgbox @you
boxset 0x2
release
end

#org @you
= Meanie.

#org @wereclosed
= I'm sorry, but we're closed.

#org @buddha
= I have the body of a god... \pBuddha.

#org @cani
= May I take your order?

#org @missingparts
= I'm not a complete idiot...\psome parts are missing.

#org @ibrokeit
= I used to have a handle\non life...\pbut then I broke it.

#org @suchalongword
= Why is "abbreviation" such\na long word?

#org @twokinds
= There are three kinds of people...\pThose who can count, and those\nwho can't.

#org @justlike
= Always remember that you're\nunique...\pjust like everyone else.

#org @betteridiot
= Make something idiot-proof...\pand someone will make a \nbetter idiot.

#org @iwanttobeinit
= When there's a will...\pI want to be in it.

#org @pushingmyluck
= I get enough exercise just \npushing my luck.

#org @sofarsogood
= I intend to live forever...\pso far, so good.

Be warned, it's quite long.
Fixed, if you still have some trouble with it after your fix.
__________________
Restarted and revamped.

Public alpha out now!
  #2405   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (6:22 AM).
machomuu's Avatar
machomuu machomuu is offline
Stuck in Hot Girl Summer
 
Join Date: Apr 2008
Location: Take a left, turn right at the next stop, bear left for a few mil
Gender: Female
Nature: Relaxed
Posts: 10,505
Quote:
Originally Posted by diegolovespika View Post
Fixed, if you still have some trouble with it after your fix.
I just said that!
*sigh*
  #2406   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (6:31 AM).
Sierraffinity's Avatar
Sierraffinity Sierraffinity is offline
Retiring from Pokémon ROM hacking
 
Join Date: Dec 2007
Location: Somewhere the rains of Africa can be blessed
Age: 26
Gender: Female
Nature: Naive
Posts: 1,071
Quote:
Originally Posted by machomuu View Post
I just said that!
*sigh*
No, actually, look closely. It's different.
__________________
Restarted and revamped.

Public alpha out now!
  #2407   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (6:48 AM). Edited November 22nd, 2008 by machomuu.
machomuu's Avatar
machomuu machomuu is offline
Stuck in Hot Girl Summer
 
Join Date: Apr 2008
Location: Take a left, turn right at the next stop, bear left for a few mil
Gender: Female
Nature: Relaxed
Posts: 10,505
Quote:
Originally Posted by diegolovespika View Post
No, actually, look closely. It's different.
Then only Vrai will declare the winner :badsmile:!
Good luck on Opal by the way.
  #2408   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (9:18 AM).
Vrai's Avatar
Vrai Vrai is offline
can you feel my heart?
 
Join Date: Jun 2008
Age: 28
Gender: Male
Nature: Adamant
Posts: 2,896
Quote:
Originally Posted by machomuu View Post
Then only Vrai will declare the winner :badsmile:!
Good luck on Opal by the way.
Well, I guess I'd be the winner. :)

Before either of you posted, I edited my post to say that I magically fixed it. Hehe.

Anyways, I got another job for you peoples.

I have a trainerbattle script that I want to continue after the battle. But, as soon as the battle is over, the script ends. How could I make that work?

Here's the script:
Spoiler:
#dynamic 0x71B284

#org @start
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0x03 @move
waitmovement 0x0
msgbox @before
boxset 0x2
call @battle
msgbox @beaten
boxset 0x2
msgbox @player
boxset 0x2
msgbox @rival
boxset 0x2
msgbox @youreceived
boxset 0x2
applymovement 0x03 @move2
waitmovement 0x0
#raw 0x53 0x03 0x00
setflag 0x829
release
end

#org @battle
trainerbattle 0x01 0x001 0x0 @before2 @after
return

#org @before
= Hey! I want a battle!

#org @before2
= Are you ready?

#org @after
= I didn't think you'd\nbe so good...

#org @beaten
= \v\h06:What's your name?

#org @player
= \c\h01\h06My name is \v\h01.

#org @rival
= \v\h06:Really? I'll have to \nremember that... \pHey. Here's a little gift,\lto show what a good person\lI am. Cya 'round.

#org @youreceived
= You received a Pokèdex!

#org @move
#raw 0x13 0x13 0x13 0x13 0xFE

#org @move2
#raw 0x12 0x12 0x12 0x12 0x11 0x12 0x11 0xFE

#org @move3
#raw 0x54 0x62 0xFE
__________________
  #2409   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (9:25 AM).
Sierraffinity's Avatar
Sierraffinity Sierraffinity is offline
Retiring from Pokémon ROM hacking
 
Join Date: Dec 2007
Location: Somewhere the rains of Africa can be blessed
Age: 26
Gender: Female
Nature: Naive
Posts: 1,071
Quote:
Originally Posted by Vrai View Post
Well, I guess I'd be the winner. :)

Before either of you posted, I edited my post to say that I magically fixed it. Hehe.

Anyways, I got another job for you peoples.

I have a trainerbattle script that I want to continue after the battle. But, as soon as the battle is over, the script ends. How could I make that work?

Here's the script:
Spoiler:
#dynamic 0x71B284

#org @start
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0x03 @move
waitmovement 0x0
msgbox @before
boxset 0x2
trainerbattle 0x9 0x001 0x0 @before2 @after
goto @later
end


#org @later
msgbox @beaten
boxset 0x2
msgbox @player
boxset 0x2
msgbox @rival
boxset 0x2
msgbox @youreceived
boxset 0x2
applymovement 0x03 @move2
waitmovement 0x0
#raw 0x53 0x03 0x00
setflag 0x829
release
end

#org @before
= Hey! I want a battle!

#org @before2
= Are you ready?

#org @after
= I didn't think you'd\nbe so good...

#org @beaten
= \v\h06:What's your name?

#org @player
= \c\h01\h06My name is \v\h01.

#org @rival
= \v\h06:Really? I'll have to \nremember that... \pHey. Here's a little gift,\lto show what a good person\lI am. Cya 'round.

#org @youreceived
= You received a Pokèdex!

#org @move
#raw 0x13 0x13 0x13 0x13 0xFE

#org @move2
#raw 0x12 0x12 0x12 0x12 0x11 0x12 0x11 0xFE

#org @move3
#raw 0x54 0x62 0xFE
That's how it works for my game. It should work for you.
__________________
Restarted and revamped.

Public alpha out now!
  #2410   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (11:24 AM).
Vrai's Avatar
Vrai Vrai is offline
can you feel my heart?
 
Join Date: Jun 2008
Age: 28
Gender: Male
Nature: Adamant
Posts: 2,896
Erm, unless I'm doing this wrong...

I have this script:

Spoiler:
#org @start
checkflag 0x1005
if 0x1 goto @end
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0x03 @move
waitmovement 0x0
msgbox @before
boxset 0x2
trainerbattle 0x1 0x001 0x0 @before2 @after
setflag 0x1005
release
end


Well, it's part of a script.

The script works all fine and dandy, but then, it comes up again every time I step on the tile. Is there something I'm forgetting?
__________________
  #2411   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (11:40 AM).
machomuu's Avatar
machomuu machomuu is offline
Stuck in Hot Girl Summer
 
Join Date: Apr 2008
Location: Take a left, turn right at the next stop, bear left for a few mil
Gender: Female
Nature: Relaxed
Posts: 10,505
Quote:
Originally Posted by Vrai View Post
Erm, unless I'm doing this wrong...

I have this script:

Spoiler:
#org @start
checkflag 0x1005
if 0x1 goto @end
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0x03 @move
waitmovement 0x0
msgbox @before
boxset 0x2
trainerbattle 0x1 0x001 0x0 @before2 @after
setflag 0x1005
release
end


Well, it's part of a script.

The script works all fine and dandy, but then, it comes up again every time I step on the tile. Is there something I'm forgetting?
Spoiler:
#dynamic 0xoffset

#org @start
checkflag 0x1005
if 0x1 goto @end
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0x03 @move
waitmovement 0x0
msgbox @before
boxset 0x2
trainerbattle 0x1 0x001 0x0 @before2 @after
setflag 0x1005
release
end


and make sure you put in the person event number and not the person number
  #2412   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (11:44 AM).
Vrai's Avatar
Vrai Vrai is offline
can you feel my heart?
 
Join Date: Jun 2008
Age: 28
Gender: Male
Nature: Adamant
Posts: 2,896
I already have the #dynamic b\c its part of another script

And it shouldn't have anything to do with the person number.
__________________
  #2413   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (11:50 AM).
machomuu's Avatar
machomuu machomuu is offline
Stuck in Hot Girl Summer
 
Join Date: Apr 2008
Location: Take a left, turn right at the next stop, bear left for a few mil
Gender: Female
Nature: Relaxed
Posts: 10,505
Quote:
Originally Posted by Vrai View Post
I already have the #dynamic b\c its part of another script

And it shouldn't have anything to do with the person number.
No, you put applymovement 0x3, meaning that must be a persons event number
  #2414   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (11:53 AM).
Vrai's Avatar
Vrai Vrai is offline
can you feel my heart?
 
Join Date: Jun 2008
Age: 28
Gender: Male
Nature: Adamant
Posts: 2,896
Quote:
Originally Posted by machomuu View Post
No, you put applymovement 0x3, meaning that must be a persons event number
Graarg.

The script works fine. Don't pay any attention to that. The problem is, is that even after the whole script is done, this part continues after I step on the tile. I think it might have something to do with the flags, but I'm not sure.
__________________
  #2415   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (12:06 PM).
Teddiursa™ Teddiursa™ is offline
Never Give up
 
Join Date: Jan 2008
Location: Mt. Silver, i somtimes battle RED!
Age: 30
Gender:
Nature: Adamant
Posts: 185
Quote:
Originally Posted by Vrai View Post
Graarg.

The script works fine. Don't pay any attention to that. The problem is, is that even after the whole script is done, this part continues after I step on the tile. I think it might have something to do with the flags, but I'm not sure.

Vrai.. I Tested that Rival Script .. And when i win the battle,
The Script Froze on me. This is weird because for you it
just happens over and over..


Here it is:

#org @start
checkflag 0x200
if 0x1 goto @end
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0x03 @move
waitmovement 0x0
msgbox @before
boxset 0x2
trainerbattle 0x1 0x001 0x0 @before2 @after
setflag 0x200
release
end

#org @end
release
end

#org @later
msgbox @beaten
boxset 0x2
applymovement 0x03 @move2
waitmovement 0x0
#raw 0x53 0x03 0x00
applymovement 0xFF @move3
waitmovement 0x0
msgbox @player
boxset 0x2
fanfare 0x13E
msgbox @youreceived
boxset 0x2
waitfanfare
#raw 0x68
setflag 0x829
release
end

Im not sure, but i think its here somwhere..
__________________
Thinking about making, Pokemon Legend of Flame [Rebirth].
It was Faded Past. Expect A Final Hack from me soon..
Pokemon Legend of Flame [Rebirth]
Progress:
0%
  #2416   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (1:59 PM).
Sierraffinity's Avatar
Sierraffinity Sierraffinity is offline
Retiring from Pokémon ROM hacking
 
Join Date: Dec 2007
Location: Somewhere the rains of Africa can be blessed
Age: 26
Gender: Female
Nature: Naive
Posts: 1,071
Quote:
Originally Posted by Vrai View Post
Erm, unless I'm doing this wrong...

I have this script:

Spoiler:
#org @start
checkflag 0x1005
if 0x1 goto @end
applymovement 0xFF @move3
waitmovement 0x0
applymovement 0x03 @move
waitmovement 0x0
msgbox @before
boxset 0x2
setflag 0x1005
trainerbattle 0x1 0x001 0x0 @before2 @after
end


Well, it's part of a script.

The script works all fine and dandy, but then, it comes up again every time I step on the tile. Is there something I'm forgetting?
Now that should work. Remember: trainerbattle almost always ends the script right there and doesn't continue. That's why the script loops and the flag doesn't set.
__________________
Restarted and revamped.

Public alpha out now!
  #2417   Link to this post, but load the entire thread.  
Old November 22nd, 2008 (2:17 PM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL 0m3GA ARS3NAL is offline
Im comin' home...
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 30
Gender: Male
Nature: Gentle
Posts: 1,816
Quote:
Originally Posted by diegolovespika View Post
Now that should work. Remember: trainerbattle almost always ends the script right there and doesn't continue. That's why the script loops and the flag doesn't set.
Just to clarify to the people who don't understand trainerbattle...

trainerbattle 0x0 [trainer#] 0x0 [challenge text] [win text] This form of trainer battle will end the script

trainerbattle 0x1 [trainer#] 0x0 [challenge text] [win text] [continued script pointer]
This will allow continuation of the script

Example:
#dynamic 0x800000

#org @start
lock
faceplayer
trainerbattle 0x1 134 0x0 @iwillwin @darn @continue
end

#org @continue
message @greatbattle
boxset 6
release
end

#org @iwillwin
= I'm going to win!

#org @darn
= oh darn, I lost!

#org @greatbattle
= that was a great\nbattle [PLAYER].
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
  #2418   Link to this post, but load the entire thread.  
Old November 23rd, 2008 (6:52 AM).
score_under's Avatar
score_under score_under is offline
Inactive; Former ROM hack tool author, ❤️
 
Join Date: Aug 2005
Location: Kent, England
Age: 30
Gender: Female
Nature: Rash
Posts: 525
Quote:
Originally Posted by Vrai View Post
Code:
#raw 0x53 0x03 0x00
This won't do anything except from make it look prettier, but...
XSE has a command "hidesprite", which does this for you.
"hidesprite 3" instead of "#raw 0x53 0x03 0x00".

0m3GA AR$3NAL's solution should work fine, but it bugs me when people use needless #RAW commands, making the script editor look worse than it really is ;)
__________________
Plz not to PM me, I don't come here often enough. Email if you need me
  #2419   Link to this post, but load the entire thread.  
Old November 23rd, 2008 (11:18 AM). Edited November 23rd, 2008 by HackMew.
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
 
Join Date: Jun 2006
Posts: 1,314
Quote:
Originally Posted by Artic Wolf View Post
Thanks, it works perfectly.
You're welcome.


Quote:
Originally Posted by diegolovespika View Post
Remember: trainerbattle almost always ends the script right there and doesn't continue. That's why the script loops and the flag doesn't set.
Absolutely not. If you don't trust me, just decompile some trainerbattle scripts and watch how they work in-game.


Quote:
Originally Posted by Vrai View Post
The script works all fine and dandy, but then, it comes up again every time I step on the tile. Is there something I'm forgetting?
Yes. The fact that using a trainerbattle 0x1 requires you to use 3 pointers, and not 2 two as you did.
Next version of XSE won't even allow you to compile it like that.

The syntax for trainer battle 0x1 is the following:

Code:
trainerbattle 0x1 [TrainerNo.] [Reserved (0x0 will be fine 99.99% of the times)] [BeforeText] [AfterText] [AfterScript]
An easy fix to your script would be to change the trainerbattle type from 0x1 to 0x0:

Code:
trainerbattle 0x0 [TrainerNo.] [Reserved (same as above)] [BeforeText] [AfterText]
__________________
  #2420   Link to this post, but load the entire thread.  
Old November 23rd, 2008 (1:00 PM). Edited November 23rd, 2008 by Vrai.
Vrai's Avatar
Vrai Vrai is offline
can you feel my heart?
 
Join Date: Jun 2008
Age: 28
Gender: Male
Nature: Adamant
Posts: 2,896
Quote:
Originally Posted by HackMew View Post
You're welcome.




Absolutely not. If you don't trust me, just decompile some trainerbattle scripts and watch how they work in-game.




Yes. The fact that using a trainerbattle 0x1 requires you to use 3 pointers, and not 2 two as you did.
Next version of XSE won't even allow you to compile it like that.

The syntax for trainer battle 0x1 is the following:

Code:
trainerbattle 0x1 [TrainerNo.] [Reserved (0x0 will be fine 99.99% of the times)] [BeforeText] [AfterText] [AfterScript]
An easy fix to your script would be to change the trainerbattle type from 0x1 to 0x0:

Code:
trainerbattle 0x0 [TrainerNo.] [Reserved (same as above)] [BeforeText] [AfterText]
*headsmack*

Thanks, HackMew.

EDIT: Not sure if this is a scripting problem or a rom problem..

Sorry for making you guys busy, but I have a script that involves a character. Here's the script -

Spoiler:
#dynamic 0x3B9708

#org @start
checkflag 0x1006
if B_true goto @end
applymovement 0xFF @move
waitmovement 0x0
special 0x113
applymovement 0x7F @movecamera
applymovement 0x03 @movebrendan
waitmovement 0x0
special 0x114
msgbox @help
boxset 0x2
applymovement 0x03 @move
waitmovement 0x0
msgbox @youreatrainer?
boxset 0x2
setflag 0x1006
release
end

#org @end
release
end

#org @help
= There's a Rocket out on Route 1...\nHe was bullying another trainer...\pI got beat, bad...

#org @youreatrainer?
= Hey, wait... \nAre you a trainer? Really? \pCould you go help that kid?

#org @move
#raw 0x62 0xFE

#org @movecamera
#raw 0x12 0x12 0x12 0x12 0x11 0x11 0x10 0x10 0x13 0x13 0x13 0x13 0xFE

#org @movebrendan
#raw 0x13 0x10 0x13 0x13 0x13 0x13 0x10 0x13 0x13 0x13 0x13 0x00 0xFE


But you see, that isn't the problem. The problem is, after the script, when I talk to him, he is supposed to have a normal talking script, shown below.

Spoiler:
#dynamic 0x71D0B0

#org @start
msgbox @brendan
boxset 0x2
release
end

#org @brendan
= Please! Go beat that\nRocket!


But he actually comes up with this script, which was actually assigned to another person on the map.

Spoiler:
#dynamic 0x456734

#org @start
checkflag 0x1000
if b_true goto @end
msgbox @wait!
boxset 0x2
applymovement 0xFF @move
waitmovement 0x0
msgbox @lookatthatguy
boxset 0x2
special 0x113
applymovement 0x7F @move2
waitmovement 0x0
msgbox @hescreepy
boxset 0x2
applymovement 0x7F @move3
waitmovement 0x0
special 0x114
msgbox @youcanleave
boxset 0x2
setflag 0x1000
release
end

#org @end
release
end

#org @wait!
= \c\h01\h04Hey! Wait! \nCome over here!

#org @lookatthatguy
= \c\h01\h04Do you see that guy, up\nover there?

#org @hescreepy
= \c\h01\h04He always stares at that rock. \pIt's pretty creepy if you \nask me.

#org @youcanleave
= \c\h01\h04My friend told me that he says\nweird stuff, too. I'd stay away\lfrom him if I were you.

#org @move
#raw 0x10 0x10 0x10 0x10 0x13 0x13 0x13 0x13 0x11 0x11 0x03 0xFE

#org @move2
#raw 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0xFE

#org @move3
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0xFE


I made sure that they were assigned to different offsets, and the script that Brendan is using actually works for the person it was intended for. What did I do wrong?
__________________
  #2421   Link to this post, but load the entire thread.  
Old November 23rd, 2008 (8:50 PM).
myfavouriteax's Avatar
myfavouriteax myfavouriteax is offline
Pop Bop's Boppin' Beats
 
Join Date: Oct 2008
Location: Baltimore, Maryland
Age: 31
Posts: 338
Hey! Can anyone at all tell me what's wrong with this script?

Spoiler:
'-----------------------
#org 0x71B58D
applymovement 0x4 0x871B5D7
waitmovement 0x0
msgbox 0x871B5DB '"HEY! /pGet down from there!/nPunk!"
callstd 0x6
showsprite 0x3
applymovement 0x3 0x871B5FF
waitmovement 0x0
applymovement 0x3 0x871B5FF
waitmovement 0x0
hidesprite 0x3
applymovement MOVE_PLAYER 0x871B606
waitmovement 0x0
applymovement 0x3 0x871B602
waitmovement 0x0
msgbox 0x871B609 '"Don't do it again!"
callstd 0x6
release
end


'-----------
' Movements
'-----------
#org 0x71B5D7
#raw 62 'Exclamation Mark (!)
#raw 1 'Face Up
#raw FE 'End of Movements

#org 0x71B5FF
#raw 15 'Jump2 Up
#raw FE 'End of Movements

#org 0x71B606
#raw 14 'Jump2 Down
#raw FE 'End of Movements

#org 0x71B602
#raw 10 'Step Down (Normal)
#raw 10 'Step Down (Normal)
#raw FE 'End of Movements


'---------
' Strings
'---------
#org 0x71B5DB
= HEY! /pGet down from there!/nPunk!

#org 0x71B609
= Don't do it again!
__________________


  #2422   Link to this post, but load the entire thread.  
Old November 23rd, 2008 (10:03 PM).
Dratii's Avatar
Dratii Dratii is offline
Working on something new...
 
Join Date: Aug 2008
Nature: Careful
Posts: 195
Quote:
Originally Posted by myfavouriteax View Post
Hey! Can anyone at all tell me what's wrong with this script?

Spoiler:
'-----------------------
#org 0x71B58D
lock
applymovement 0x4 0x871B5D7
waitmovement 0x0
msgbox 0x871B5DB '"HEY! /pGet down from there!/nPunk!"
callstd 0x6
showsprite 0x3
applymovement 0x3 0x871B5FF
waitmovement 0x0
applymovement 0x3 0x871B5FF
waitmovement 0x0
hidesprite 0x3
setflag 0x(a un-used flag)
applymovement MOVE_PLAYER 0x871B606
waitmovement 0x0
applymovement 0x3 0x871B602
waitmovement 0x0
msgbox 0x871B609 '"Don't do it again!"
callstd 0x6
release
end


'-----------
' Movements
'-----------
#org 0x71B5D7
#raw 62 'Exclamation Mark (!)
#raw 1 'Face Up
#raw FE 'End of Movements

#org 0x71B5FF
#raw 15 'Jump2 Up
#raw FE 'End of Movements

#org 0x71B606
#raw 14 'Jump2 Down
#raw FE 'End of Movements

#org 0x71B602
#raw 10 'Step Down (Normal)
#raw 10 'Step Down (Normal)
#raw FE 'End of Movements


'---------
' Strings
'---------
#org 0x71B5DB
= HEY! /pGet down from there!/nPunk!

#org 0x71B609
= Don't do it again!
Okay the changes are in bold, my guess is that the person reappears when you leave the map, and your character can still move.

change the person ID of the sprite you want to disappear to the flag used in set flag
__________________
Fun


  #2423   Link to this post, but load the entire thread.  
Old November 23rd, 2008 (11:56 PM).
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
 
Join Date: Jun 2006
Posts: 1,314
Quote:
Originally Posted by Vrai View Post
*headsmack*

Thanks, HackMew.

EDIT: Not sure if this is a scripting problem or a rom problem..

Sorry for making you guys busy, but I have a script that involves a character. Here's the script -

Spoiler:
#dynamic 0x3B9708

#org @start
checkflag 0x1006
if B_true goto @end
applymovement 0xFF @move
waitmovement 0x0
special 0x113
applymovement 0x7F @movecamera
applymovement 0x03 @movebrendan
waitmovement 0x0
special 0x114
msgbox @help
boxset 0x2
applymovement 0x03 @move
waitmovement 0x0
msgbox @youreatrainer?
boxset 0x2
setflag 0x1006
release
end

#org @end
release
end

#org @help
= There's a Rocket out on Route 1...\nHe was bullying another trainer...\pI got beat, bad...

#org @youreatrainer?
= Hey, wait... \nAre you a trainer? Really? \pCould you go help that kid?

#org @move
#raw 0x62 0xFE

#org @movecamera
#raw 0x12 0x12 0x12 0x12 0x11 0x11 0x10 0x10 0x13 0x13 0x13 0x13 0xFE

#org @movebrendan
#raw 0x13 0x10 0x13 0x13 0x13 0x13 0x10 0x13 0x13 0x13 0x13 0x00 0xFE


But you see, that isn't the problem. The problem is, after the script, when I talk to him, he is supposed to have a normal talking script, shown below.

Spoiler:
#dynamic 0x71D0B0

#org @start
msgbox @brendan
boxset 0x2
release
end

#org @brendan
= Please! Go beat that\nRocket!


But he actually comes up with this script, which was actually assigned to another person on the map.

[...]

I made sure that they were assigned to different offsets, and the script that Brendan is using actually works for the person it was intended for. What did I do wrong?
Well, remember to always enter and exit a building before testing scripts in order to properly refresh the map along with its events.
Also, if you want to make a person saying something different you just need to put that in the @end part of your script, which is executed once the flag is active:

Spoiler:
#dynamic 0x3B9708

#org @start
checkflag 0x1006
if B_true goto @end
applymovement 0xFF @move
waitmovement 0x0
special 0x113
applymovement 0x7F @movecamera
applymovement 0x03 @movebrendan
waitmovement 0x0
special 0x114
msgbox @help
boxset 0x2
applymovement 0x03 @move
waitmovement 0x0
msgbox @youreatrainer?
boxset 0x2
setflag 0x1006
release
end

#org @end
msgbox @brendan
boxset 0x2

release
end

#org @help
= There's a Rocket out on Route 1...\nHe was bullying another trainer...\pI got beat, bad...

#org @youreatrainer?
= Hey, wait... \nAre you a trainer? Really? \pCould you go help that kid?

#org @brendan
= Please! Go beat that\nRocket!


#org @move
#raw 0x62 0xFE

#org @movecamera
#raw 0x12 0x12 0x12 0x12 0x11 0x11 0x10 0x10 0x13 0x13 0x13 0x13 0xFE

#org @movebrendan
#raw 0x13 0x10 0x13 0x13 0x13 0x13 0x10 0x13 0x13 0x13 0x13 0x00 0xFE


Quote:
Originally Posted by myfavouriteax View Post
Hey! Can anyone at all tell me what's wrong with this script? [...]
Care to tell us what's the script supposed to do and how it's behaving instead?
__________________
  #2424   Link to this post, but load the entire thread.  
Old November 24th, 2008 (3:09 AM).
Vrai's Avatar
Vrai Vrai is offline
can you feel my heart?
 
Join Date: Jun 2008
Age: 28
Gender: Male
Nature: Adamant
Posts: 2,896
Quote:
Originally Posted by HackMew View Post
Well, remember to always enter and exit a building before testing scripts in order to properly refresh the map along with its events.
Also, if you want to make a person saying something different you just need to put that in the @end part of your script, which is executed once the flag is active:

Spoiler:
#dynamic 0x3B9708

#org @start
checkflag 0x1006
if B_true goto @end
applymovement 0xFF @move
waitmovement 0x0
special 0x113
applymovement 0x7F @movecamera
applymovement 0x03 @movebrendan
waitmovement 0x0
special 0x114
msgbox @help
boxset 0x2
applymovement 0x03 @move
waitmovement 0x0
msgbox @youreatrainer?
boxset 0x2
setflag 0x1006
release
end

#org @end
msgbox @brendan
boxset 0x2

release
end

#org @help
= There's a Rocket out on Route 1...\nHe was bullying another trainer...\pI got beat, bad...

#org @youreatrainer?
= Hey, wait... \nAre you a trainer? Really? \pCould you go help that kid?

#org @brendan
= Please! Go beat that\nRocket!


#org @move
#raw 0x62 0xFE

#org @movecamera
#raw 0x12 0x12 0x12 0x12 0x11 0x11 0x10 0x10 0x13 0x13 0x13 0x13 0xFE

#org @movebrendan
#raw 0x13 0x10 0x13 0x13 0x13 0x13 0x10 0x13 0x13 0x13 0x13 0x00 0xFE
Ah, but that would also make the script say that after it's over..

I don't think you're seeing what I mean here.. I'm going to put up a few screens.

This is the person who is supposed to have the script that Brendan has when I talk to him.
Spoiler:


This is during Brendan's script. It is actually a script, not a person event. One where I walk on a tile and a person walks up to me. This works perfectly well. Nothing wrong with this.
Spoiler:


Now, here is the problem. Brendan, instead of having the script I gave him, he has the little girl's script.
Spoiler:


I'm really not sure if it's me or the rom..
__________________
  #2425   Link to this post, but load the entire thread.  
Old November 24th, 2008 (4:26 AM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
You can contact me in PC's discord server...
 
Join Date: May 2007
Age: 32
Gender: Male
Nature: Careful
Posts: 8,579
maybe Brendan has the same offset the girl has...
check that one out...

Spoiler:
__________________

Closed Thread

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

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:24 AM.