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

[TehTehTehTeh's] XSE Basic/Medium tutorial

Status
Not open for further replies.
13
Posts
15
Years
for 0x2FB51C it gave me 0x305AFD when i compiled it
does it matter if Unknown and people ID in a-map is 00?

can you give me your script and let me try if it works?
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
for 0x2FB51C it gave me 0x305AFD when i compiled it
does it matter if Unknown and people ID in a-map is 00?

can you give me your script and let me try if it works?

Okay, I suppose it's the same offset you put in AM, is it right?
Can you post the decompiled script too?
 
13
Posts
15
Years
when i decompile it do i type the new offset or the one i typed?
and everytime when i compile the script again it gives me another new offset

this is what i get when i decompile

'-----------------------
#org 0x305AFE
lock
faceplayer
msgbox 0x8305B0B '" "
callstd 0x6
release
end

'---------
' Strings
'---------
#org 0x305B0B
=
 
Last edited:

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
when i decompile it do i type the new offset or the one i typed?
and everytime when i compile the script again it gives me another new offset

The fact you always get a different offset is normal. Try compiling this:

Code:
#dynamic 0x2FB51C

#org @start
lock
faceplayer
msgbox @talk
boxset 0x6
release
end

#org @talk
= hi.

Let me know if it worked or not.
 

GTAPlayer

Six Star Evasion
28
Posts
15
Years
What's wrong with this script?:
#org 0x71A308
lock
faceplayer
startwildbattle 0xF3 0x32 0x0
checksound
cry 0xF3 0x2
pause 0x28
waitcry
setflag 0x305
setflag 0x861
special 0x138
waitstate
clearflag 0x861
release
end
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
What's wrong with this script?:
Spoiler:

You should say what you suppose that script to do. And what the script does instead.
Nex time it would be better asking such questions in the proper thread.
 

Banjora Marxvile

hOI!!!!!! i'm tEMMIE!!
3,496
Posts
15
Years
  • Age 30
  • Seen Apr 10, 2024
Um... I need help. I'm not a good scripter, but I put a givepokemon script in my practice hack. Hoe do I end it as it starts again if I talk to the pokeball to get the pokemon? This is the script (I know it's bad, but I don't understand many scripting tutorials, as they don't give advice for what I want...)

#org 0x800000
givepokemon 0xFC 0x28 0x0 0x0 0x0 0x0
movesprite2 0x1 0x0 0x0
hidesprite 0x1
release
end

... I'm not a good scripter (I'm a better mapper) but any help will be very much appreciated!
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Um... I need help. I'm not a good scripter, but I put a givepokemon script in my practice hack. Hoe do I end it as it starts again if I talk to the pokeball to get the pokemon? This is the script (I know it's bad, but I don't understand many scripting tutorials, as they don't give advice for what I want...)

Spoiler:


... I'm not a good scripter (I'm a better mapper) but any help will be very much appreciated!

You simply need to use checkflag/setflag. Check the Script Help thread for further info and examples. I posted something a couple of days ago.
 
61
Posts
15
Years
  • Seen Oct 12, 2012
hi boy where is a script guide need to me to do a hack room you can help me?
 
185
Posts
16
Years
EDIT: Nvm, found my mistake

Well, pretty basic I would say.. :P
Anyway, I'll give you a tip: save bytes whenever possible.

Example:



It doesn't make a lot of sense to compare the LASTRESULT variable two times, indeed. It can be only 0x0 or 0x1 (using callstd/boxset 0x5, of course). So, if it's 0x0 it can't be 0x1 and vice-versa. The optimized version would be:



Since you're using XSE you can even do this, if you want:



Basically it's just the same once compiled, but I think it makes more sense then a simple goto when reading the scipt.

I tried that, with the "else goto" thing, and XSE told me it's an incorrect line. Here's my full script:

Code:
#Dynamic 0x86962E

#ORG @start
lock
faceplayer
msgbox @pokeball
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
else goto @no
release
end

#org @pokeball
= This POKéBALL is lying on the\nground. Maybe someone left it\lbehind ...\lPick it up?

#org @yes
msgbox @cyndaquil
boxset 6
fanfare  0x13E
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
waitfanfare
hidesprite 0x7
release
end

#org #no
msgbox @untouched
boxset 6
release
end

#org @cyndaquil
= [player] received a CYNDAQUIL.

#org @untouched
= You leave the POKéBALL untouched.

What's wrong with it?
 
Last edited:

Hiche..

 
979
Posts
15
Years
  • Seen Dec 27, 2014
Dark Salamance, try this:

Spoiler:
 
185
Posts
16
Years
EDIT2: I found it! Now I know why the checkflag/setflag didn't work for me!`

Explanation: I never knew you had to insert the hex number you used for setflag in the PersonID thing in A-map, that's why it didn't work.

Here's the final script:
Code:
#Dynamic 0x86981D

#ORG @start
checkflag 0x200
if b_true goto @gone
lock
faceplayer
msgbox @pokeball
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
else goto @no
boxset 6
release
end

#org @pokeball
= This POKéBALL is lying on the\nground. Maybe someone left it\lbehind ...\lPick it up?

#org @yes
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @cyndaquil
boxset 6
waitfanfare
hidesprite 0x7
setflag 0x200
release
end

#org @no
msgbox @untouched
boxset 6
release
end

#org @untouched
= You leave the POKéBALL untouched.

#org @cyndaquil
= [player] received a CYNDAQUIL.

#org @gone
hidesprite 0x7
end

Yay!
 
Last edited:

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
Ok guys, thanks for posting your scripts here, but just in case you don't get an answer here remember about the script help thread ;)

Chapter 4, Flags

Finally the flags tut is here.

Ok lets start off, flags are based off into 3 basics groups

Code:
setflag
checkflag
clearflag

Most of the time you don't see clearflag come up... it is needed sometimes though. You will understand how to use the flags after this!

Lets start with something way simple. Code the normal base to your script from the other parts of the tut.

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer

Now for the flags. add these lines of code

Code:
checkflag 0x200
if b_true goto @flag

This is to check if the flag 0x200 is set and if so going to @flag
Now enter a simple message line in.. whatever the message may be just add it after this. After that we will add our setflag, before that here is how far we should be in the script...

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6

Now for the setflag... for flags do not use any number but the flags 200 and up and 900 and up.

Add this line of code now!

Code:
setflag 0x200

now we should have


Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200

Now end this part of the scrip and now add your message for hi.

Time for the @flag part. before this here is what you should have...

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
release
end

#org @hi
= Hello there.

Now after that add the #org @flag part of this part of the script.

Time for what we want the flag to go to.
Lets make it a message

Code:
#org @flag
message @woot
boxset 6
release
end

#org @woot
= What you want????

Now for the finished product!

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
release
end

#org @hi
= Hello there.

#org @flag
message @woot
boxset 6
release
end

#org @woot
= What you want????
 
Last edited:
185
Posts
16
Years
You forgot one thing panda. If you want the checkflag/setflag to work correctly, remember this: When inserting a person event, there's a thing called PersonID on your right (when you clicked at that event). Make sure to insert the numbers you used for setflag, which means 200 in this case. Otherwise, flags wouldn't work correctly.
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
You forgot one thing panda. If you want the checkflag/setflag to work correctly, remember this: When inserting a person event, there's a thing called PersonID on your right (when you clicked at that event). Make sure to insert the numbers you used for setflag, which means 200 in this case. Otherwise, flags wouldn't work correctly.

I am pretty sure I covered that but i will look it over once again.
 
43
Posts
15
Years
What did i do wrong error 13 type mismatch

Hey i typed this script and it said error 13 type mismatch on line 8

#dynamic 0x16A7C8

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 1
if b_true goto @yes
compare LASTRESULT 0
if b_true goto @no
release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @no
message @pressno
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
Hey i typed this script and it said error 13 type mismatch on line 8

#dynamic 0x16A7C8

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 1
if b_true goto @yes
compare LASTRESULT 0
if b_true goto @no
release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @no
message @pressno
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

Mine compiled fine, try to change the compare LASTRESULT 0 and 1 to or just keep trying is that an open offset?

Code:
Compare LASTRESULT 0x0
Code:
Compare LASTRESULT 0x1
 
Status
Not open for further replies.
Back
Top