• 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.

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
@shadix:
The fourth parameter must be set to 0x1 for the block to be blocked off. That's the problem with the second screen.
And for the tiles to be set permanently, you're going to have to make it a level script.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Hello.I have a question what exactly is the setvar function?

setvar means "set variable." A variable is a 4-digit number, like 0x5000. All variables are set to 0 when the game starts. The setvar command sets them to a different number. So:

setvar 0x5000 0x1

sets the variable to 1. What this does is allows scripts to be activated when you want them to be. If a script in A-Map is set to variable 5000 and 0000, it will activate whenever you first step on it, because variable 0x5000 is set to 0x0 from the start. However, if in the script you put "setvar 0x5000 0x1" the script won't activate any time afterwards, because it will now be set to 1, and the script in A-Map is saying to only activate when it's set to 0.

I hope that makes some sense.
 
3
Posts
13
Years
  • Seen Apr 27, 2010
Hey,
I don't have the time to read through the thread to see if this has been asked before and I'm panicking right now, so please just answer my question. PLEASE.
I downloaded your AdvanceIntroEd, and used it to remove the truck from Ruby. Now whenever I start the rom, I'm stuck in the truck. I need to know how to reverse this, or all my hard work has just been flushed down the toilet. :(
 
20
Posts
14
Years
  • Seen Apr 24, 2010
setvar means "set variable." A variable is a 4-digit number, like 0x5000. All variables are set to 0 when the game starts. The setvar command sets them to a different number. So:

setvar 0x5000 0x1

sets the variable to 1. What this does is allows scripts to be activated when you want them to be. If a script in A-Map is set to variable 5000 and 0000, it will activate whenever you first step on it, because variable 0x5000 is set to 0x0 from the start. However, if in the script you put "setvar 0x5000 0x1" the script won't activate any time afterwards, because it will now be set to 1, and the script in A-Map is saying to only activate when it's set to 0.

I hope that makes some sense.


Can you give an example of a script? :

To human 2 said something else after talking with the human 1
 

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
Can you give an example of a script? :

To human 2 said something else after talking with the human 1
It's nothing hard ;)
The setvar 0x**** (random numbers) 0x1 can be put right after #org @something command ;)
And as for the explanation... Just think of it as a setflag command for tile scripts :D
So once you put it into the script and you activate that script, that script will disappear from game =)
Just like setflag for NPC :)
 
20
Posts
14
Years
  • Seen Apr 24, 2010
It's nothing hard ;)
The setvar 0x**** (random numbers) 0x1 can be put right after #org @something command ;)
And as for the explanation... Just think of it as a setflag command for tile scripts :D
So once you put it into the script and you activate that script, that script will disappear from game =)
Just like setflag for NPC :)

Can you specify a script? Example?
 
Last edited:

Collen

I have returned.
71
Posts
14
Years
  • Seen Jan 1, 2015
Ok, so I'm starting to make scripts, and I've ran into something.
I can insert one line scrips, but when I do multi-line scripts (/n /l /p), It makes this weird box show up in the top left corner, and when I press the A button, it goes away and the game freezes. I'm entering everything like I saw on the tutorial and then insert it like I would insert a normal script (like the tutorial said), but it just doesn't work!
Here's the script:
Spoiler:

Does anyone know what I'm doing wrong?
 
Last edited:
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Ok, so I'm starting to make scripts, and I've ran into something.
I can insert one line scrips, but when I do multi-line scripts (/n /l /p), It makes this weird box show up in the top left corner, and when I press the A button, it goes away and the game freezes. I'm entering everything like I saw on the tutorial and then insert it like I would insert a normal script (like the tutorial said), but it just doesn't work!
Here's the script:
Spoiler:

Does anyone know what I'm doing wrong?

If you use XSE to script you can input your text into its Text adjuster which works out where the /n etc. bits go.

If you still want to script pokéscript style than that works too, but you might want to download XSE just to use the Text Adjuster ;) it's a life saver.

Spoiler:
 

Collen

I have returned.
71
Posts
14
Years
  • Seen Jan 1, 2015
This time, instead of doing anything, it just mkaes the sound and nothing happens.
 
13
Posts
14
Years
  • Seen Jan 2, 2016
i seem to have come up with an error.
Spoiler:


this script should cause my character to jump up two spaces when i step on the tile. however, it flat out doesn't work. whats wrong?
 

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
@mariovstoad

Spoiler:
 
20
Posts
14
Years
  • Seen Apr 24, 2010
Help script

Hello. I still can not grasp the setvar function. Can someone explain how to use and give an example of the two forms?

Please help me :((
 

Collen

I have returned.
71
Posts
14
Years
  • Seen Jan 1, 2015
Ok, I forgot to burn the script. Now it makes that weird box appear like the other scripts I tried.

It looks like I won't be able to hack it....
ugh.
 

Zeffy

g'day
6,402
Posts
15
Years
  • Age 27
  • Seen Feb 7, 2024
Hello. I still can not grasp the setvar function. Can someone explain how to use and give an example of the two forms?

Please help me :((
If you want to know more about the setvar function try reading a tutorial.
 
Last edited by a moderator:

Ninja Caterpie

AAAAAAAAAAAAA
5,979
Posts
16
Years
ehh... I don't undertand. Please take me the example. :(
Vars are like flags, except you can set them to more than just on or off. You can also do basic maths with them.

For example, say you have three starters and want your rival to have different starters accordingly.

Instead of wasting three flags setting them for each different starter, you can use one variable and set it to a different amount for a different starter. Variables are very useful around scripts that have multiple stages and/or outcomes.

Setvar sets the var as a number. Addvar and subtractvar add and subtract from vars. You might need something like that if you're trying to set a var according to another one or something like that.

If you want a script example, go decompile some in-game scripts.
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
Question, can you use a script to change a map's palette? Just curious. Also, there's a script for changing the player OW in one of the hacking newsletters; does anyone know if it's any good (I could check myself of course, and probably will, but first I will ensure that I have made every effort to facilitate laziness)?
 
Status
Not open for further replies.
Back
Top