• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

Crocky

SuperScarlet!
97
Posts
15
Years
  • Seen Jul 23, 2020
This script is for FireRed. For some reason it works, but it doesn't set the flag so it doesn't repeat and the characters all re appear after you take one step. I can't figure out why this is happening.
I also used advancemap and put the Var Number as 1945, unknown as 3.
For the characters I put person ID as 1945.

Spoiler:
 
1
Posts
10
Years
  • Seen Jun 21, 2013
Can Somebody Please Help With My Script, It Keeps Doing Something Weird, Every Time I Compile It Then Re open It It Says Something Completely Different, Its supposed To Have An NPC Walk Up, Look Up, Wait, Walk Right, Look Up, Wait, Walk Left, Walk Down Look Up And Speak To Other NPC's I Cant Figure Out Whats Wrong But It Keeps Screwing Up In Multiple Ways Please Help And Thank You!

'---------------
#org 0x6B7FD8

#dynamic 0x6B7FD8

checkflag 0x1000
if 0x1 call @next
compare PLAYERFACING 0x1
if 0x1 goto 0x8123456
closeonkeypress
setflag 0x60
compare PLAYERFACING 0x3
if 0x1 call 0x81A38C3
compare PLAYERFACING 0x4
if 0x1 call 0x81A38C3
compare PLAYERFACING 0x2
if 0x1 call 0x81A38C3
msgbox 0x81A35C5 MSG_KEEPOPEN '"In honor for what you two have\nDo..."
release
end

#org @123456
msgbox @msg 0x2
release
end

#org @1A38C3
applymovement LASTTALKED 0x123654
msgbox @msg2 0x2
release
end

#org @next
faceplayer
msgbox @msg3 0x2
release
end

'-----------
'Strings
'-----------
#org @msg
= MOVE!

#org @msg2
= In honor for what you two have\nDone...I present you\pThe Badge Of Heroism!\pYou two have done the kingdom\nA great favore and I shall personally\pSee to it that you two are promoted\ntoo the highest ranking knights\p.... I thank you for everything!

#org @msg3
= Don't you dare even speak to me!\nThis wouldn't have happened\pif it weren't for you.\I hope your satisfied!

'-----------
' Movements
'-----------
#org @123654
#raw 0x5 'Step Up (Slow)
#raw 0x1 'Face Up
#raw 0x14 'Delay5
#raw 0x1 'Face Up
#raw 0x14 'Delay5
#raw 0x7 'Step Right (Slow)
#raw 0x1 'Face Up
#raw 0x14 'Delay5
#raw 0x1 'Face Up
#raw 0x1 'Face Up
#raw 0x6 'Step Left (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
'---------------
#org 0x6B7FD8

#dynamic 0x6B7FD8

checkflag 0x1000 use a different flag
if 0x1 call @next
compare PLAYERFACING 0x1
if 0x1 goto @123456
closeonkeypress
setflag 0x60
compare PLAYERFACING 0x3
if 0x1 call @1A38C3
compare PLAYERFACING 0x4
if 0x1 call @1A38C3
compare PLAYERFACING 0x2
if 0x1 call @1A38C3
msgbox @1A35C5 MSG_KEEPOPEN '"In honor for what you two have\nDo..."
release
end

#org @123456
msgbox @msg 0x2
release
end

#org @1A38C3
applymovement LASTTALKED 0x123654
msgbox @msg2 0x2
release
end

#org @next
faceplayer
msgbox @msg3 0x2
release
end

'-----------
'Strings
'-----------
#org @msg
= MOVE!

#org @msg2
= In honor for what you two have\nDone...I present you\pThe Badge Of Heroism!\pYou two have done the kingdom\nA great favore and I shall personally\pSee to it that you two are promoted\ntoo the highest ranking knights\p.... I thank you for everything!

#org @msg3
= Don't you dare even speak to me!\nThis wouldn't have happened\pif it weren't for you.\I hope your satisfied!

'-----------
' Movements
'-----------
#org @123654
#raw 0x5 'Step Up (Slow)
#raw 0x1 'Face Up
#raw 0x14 'Delay5
#raw 0x1 'Face Up
#raw 0x14 'Delay5
#raw 0x7 'Step Right (Slow)
#raw 0x1 'Face Up
#raw 0x14 'Delay5
#raw 0x1 'Face Up
#raw 0x1 'Face Up
#raw 0x6 'Step Left (Slow)
#raw 0x4 'Step Down (Slow)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

The problem is that you called offset 123456 which does not contain your script! That's data already used by Gamefreak. You could corrupt something important by overwriting data used by Gamefreak. Offsets 720000 and forward are not, except for the EC0000's.
 
69
Posts
11
Years
  • Seen Nov 17, 2013
Whenever I try to add scripts to Leaf Green they wont save. How exactly do you add scripts to the game using pksv? I understand how to make them and how to edit the ones that are already in the game, but not how to add them. What do I do after I add the person in advance map and make the script?
 
Last edited:

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
Use XSE and A FR ROM. Nobody will play your hack if it's LG. Plus EVERYTHING on here is for FR, not LG. That's a start.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
Get the offset you compiled to, then in advance map put that offset on the person's script offset.
 
788
Posts
17
Years
  • Age 29
  • Seen yesterday
Ok I got xse and a fr rom, but what do I do after I compile the script?
Depends on what your script does. If I had to guess, it's just a talking script, in which case, you need to assign it to a particular person.

To do this, download a program called Advance Map. Don't go for the newest version (1.9.5), as it is very buggy and unstable. Download 1.9.2. Then, open your ROM in it, and go to whatever map you want your person (and the attached script) to be on.

Switch to the 'Event' tab, and scroll down. You will see some fields, such has Signpost. One of them will be Sprites, or something similar. Raise that number by one and they will appear in the map. It may be necessary to go into the View menu (in the top left of the window) and enable "Show sprites".

Move that sprite to where you want it to be (just drag it), and in the sidebar, you can assign how they walk (if they stand still, walk around, look around, etc). It should be labeled well enough to be fairly self-explanatory. You can also change their sprite.

Go to the field entitled 'script offset'. This is where your script will go. After compiling your script to the ROM, XSE should've had a small popup. At the bottom of it, it will list your script offset (or often, offsets). Just copy and paste the first one into the Script Offset in Advancemap, and save the map.

Sorry for the textwall.

Edit: Not overly surprised, but "beaten".
 
69
Posts
11
Years
  • Seen Nov 17, 2013
Thanks everyone! Advance map 1.95 was the problem. I'm using 1.92 now.
Also what's so special about xse?

Thanks everyone! Advance map 1.95 was the problem. I'm using 1.92 now.
Also what's so special about xse?
 
Last edited:
53
Posts
11
Years
  • Seen Feb 1, 2014
Hi!

I'm using PKSV for scripting, but i've some trouble with a script that start with a trainerbattle and then continue with some other things like msgboxes, applymovement and disappears.

My first idea is:

lockall
trainerbattle
copyvar PLAYERFACING 0x800C
jump @offset

in @offset do something other.

Then i put the person event as a trainer with a certain view radius. When i go in front of trainer, he saw me, a msgbox open and the game go in crash.

So i've moved the lockall under the trainerbattle. In this way the battle starts correctly, but at the end nothing happen and the player can continue the game....if return speaking with the trainer the second part of the script was executed...but it isn't what i want.

Some ideas?
 
82
Posts
13
Years
hello I need help with one of my scipts I dont know if its already answered , tryed to google it couldnt find any good help so I came here.
The problems is i set the person to disappear but when i re-entered the map the person would appear again

#org 0x8740ED6
'-----------------------------------
lock
faceplayer
applymovement 0x1 0x8740F01 ' say_! walk_left walk...
pauseevent 0x0
message 0x8740F07 ' Good Morning son!\nI...
callstd MSG_NOCLOSE ' Non-closing message
pause 0xA
closemsg
applymovement 0x1 0x8740F74 ' walk_down walk_down ...
pauseevent 0x0
disappear 0x4
setflag 0x1004
setvar 0x6001 0x1
release
end


#org 0x8740F07
= Good Morning son!\nI see you read the letter\ldad send you.\lI know exactly what he wants\lfrom you...Take care!

#org 0x8740F01
M say_! walk_left walk_left walk_left look_up end

#org 0x8740F74
M walk_down walk_down walk_down walk_down walk_down walk_left walk_left walk_left walk_left walk_left walk_left walk_left end
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
hello I need help with one of my scipts I dont know if its already answered , tryed to google it couldnt find any good help so I came here.
The problems is i set the person to disappear but when i re-entered the map the person would appear again

#org 0x8740ED6
'-----------------------------------
lock
faceplayer
applymovement 0x1 0x8740F01 ' say_! walk_left walk...
pauseevent 0x0
message 0x8740F07 ' Good Morning son!\nI...
callstd MSG_NOCLOSE ' Non-closing message
pause 0xA
closemsg
applymovement 0x1 0x8740F74 ' walk_down walk_down ...
pauseevent 0x0
disappear 0x4
setflag 0x1004
setvar 0x6001 0x1
release
end


#org 0x8740F07
= Good Morning son!\nI see you read the letter\ldad send you.\lI know exactly what he wants\lfrom you...Take care!

#org 0x8740F01
M say_! walk_left walk_left walk_left look_up end

#org 0x8740F74
M walk_down walk_down walk_down walk_down walk_down walk_left walk_left walk_left walk_left walk_left walk_left walk_left end

Unless you are using Jambo's glag hack, No Flags over 0x900.

Also, did you take the flag you set and out it as the Person ID in A-Map? If you did, then that means the RAM used by flag 0x1004 is temporary and is changed upon leaving or entering the map. Again, another reason why those flags aren't safe.

Hi!

I'm using PKSV for scripting, but i've some trouble with a script that start with a trainerbattle and then continue with some other things like msgboxes, applymovement and disappears.

My first idea is:

lockall
trainerbattle
copyvar PLAYERFACING 0x800C
jump @offset

in @offset do something other.

Then i put the person event as a trainer with a certain view radius. When i go in front of trainer, he saw me, a msgbox open and the game go in crash.

So i've moved the lockall under the trainerbattle. In this way the battle starts correctly, but at the end nothing happen and the player can continue the game....if return speaking with the trainer the second part of the script was executed...but it isn't what i want.

Some ideas?

This is the info about JPAN's trainer flag script running, but it has a lot of useful info in it:

JPAN said:
The trainer scripts have a few "myths" that must be cleared up in order to fully understand this modification:

First of all, no script is activated when the trainer spots you. That is the true reason why trying to place a normal script in that location (instead of a TrainerBattle starting one) would crash the game. The game, in fact, loads the second byte to find the type, the two following bytes for the trainer number, and so on, as activating a TrainerBattle command would normally do, even if the first bit is different. As the game error checking for the Trainer battles have been programmed to return badly if the trainer doesn't exist, the game crashes because it loads an invalid command parameter.

Second, the Trainer flag is not really a flag. In fact, the game checks for only two possibilities in that byte: if it's 1 or if it's 3. 1 it's the basic trainer activation, and the behavior we are used to see in-game. 3 is the reverse of 1, in the sense that it only detects you if you go behind the Overworld, and not facing it.

Third, the characteristic !, followed by walking to you, is not a in-game response, but rather one special, special 0x37. It usually does nothing, as when you can activate it in a script, it hasn't got a person number, and when you have a person number, it's because you talked to that person, and it doesn't need to walk towards you. But the trainer routine deals with that, using a routine to set the last checked OW as the OW using the script.

Foruth, the trainer flag is checked not only when you are in front of them, but rather whenever the sprite is loaded into memory, but only runs when several conditions are met. Besides the obvious check for you in a clear path from them, it also checks for your pokémon number, and if you have at least one, it checks if you have at least one pokémon able to battle. If all conditions match, it tries to load the script data.

But, if it accesses a script, there must be a way to make it run it. As such, this hack came to be. Basically, what was done was add one extra option, where it checks if the Person event last two bytes as a flag number. If 0, it's a normal trainer sprite, but if it's greater than that, then it's a flag, and it will check if it's active. If not, runs the script asked. If it's set, it ignores the person script. The real reason there is a flag here now is to prevent staying in a loop, where you would be constantly "harassed" by the OW. The flag is automatically set as soon as the script is placed to run, so you don't need to place a setflag in the start of every script. Also, as an added bonus, the game will also perform automatically run a small "pre-script" that has the specials needed, making it look just like a regular trainer event.

Trainer battles do not work the way you wish. You can try trainer battle type 0x3 which usually continues the script, but it may not. The best way to get around your problem is to use a script tile.
 
Last edited:
82
Posts
13
Years
hi again, Im confused while using green script boxes. here is a simple script I made:
#dyn 0x740000
#org @main
lock
faceplayer
message @talk
callstd MSG_NORMAL
setvar 0x8001 0x1
release
end

#org @talk
= \v\h01: Good Morning.

First of all what does setvar do and what does 0x8001 mean and 0x1 I know that they are the var number and var value but i dont know what they do and how to use them properly.
Second everytime i step on the script box I trigger it. How can I make it trigger only once? Do I need a second script box for that. Please explain, anyone. Thanks in advance
 
69
Posts
11
Years
  • Seen Nov 17, 2013
I've been experimenting with a few scripts and I've gotten the hang of things. One thing I'm still wondering about are the codes. I know of the \n, \p, and \e. Are there any others?
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
hi again, Im confused while using green script boxes. here is a simple script I made:
#dyn 0x740000
#org @main
lock
faceplayer
message @talk
callstd MSG_NORMAL
setvar 0x8001 0x1
release
end

#org @talk
= \v\h01: Good Morning.

First of all what does setvar do and what does 0x8001 mean and 0x1 I know that they are the var number and var value but i dont know what they do and how to use them properly.
Second everytime i step on the script box I trigger it. How can I make it trigger only once? Do I need a second script box for that. Please explain, anyone. Thanks in advance

I wrote a tutorial on this.... Google "Flags, Vars, & Script Tiles".

I've been experimenting with a few scripts and I've gotten the hang of things. One thing I'm still wondering about are the codes. I know of the \n, \p, and \e. Are there any others?

\l is like \p but it doesn't create a new page, it just goes one more line when you hit A.
 
Last edited:

xboxmandude

Rom Hacker
95
Posts
10
Years
Look I've read the rules... And I'm not asking for a script.
I want a tutorial on how to make oak give you the national dex.
I know what I have to put its some specialx something. I just don't know how or what else I have to type. Yes.. I am infact a noob.
I know how to make someone else give the national dex.
But I want oak to give it.
If anyone van help me please pm me I will give credit when my hack is completed
 
53
Posts
11
Years
  • Seen Feb 1, 2014
But if i use a script tile, and i want a trainer with view radius = 7, i need to apply seven different movement depending on where the hero is...or is there a better way to do this?
 
Status
Not open for further replies.
Back
Top