• 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.
33
Posts
13
Years
  • Seen Dec 12, 2020
I've given here a little above x) here it is:

Code:
'---------------
#org 0x719830
lock
faceplayer
random 0x181
copyvar 0x4060 LASTRESULT
addvar 0x4060 0x1
bufferpokemon 0x0 0x4060
msgbox 0x87198AD MSG_YESNO '"Vieil homme: Tu veux un [buffer1]?"
compare LASTRESULT 0x1
if 0x1 goto 0x871985C
goto 0x8719897

'---------------
#org 0x71985C
countpokemon
compare LASTRESULT 0x6
if 0x1 goto 0x87198A2
random 0x99
copyvar 0x4061 LASTRESULT
addvar 0x1 0x4061
msgbox 0x87198CB MSG_FACE '"[player] a recu un [buffer1]!"
givepokemon 0x4060 0x5 0x0 0x0 0x0 0x0
msgbox 0x87198DE MSG_FACE '"Vieil homme: Prends soin de [buffe..."
release
end

'---------------
#org 0x719897
msgbox 0x8719900 MSG_FACE '"Vieil homme: Tant pis pour toi!"
release
end

'---------------
#org 0x7198A2
msgbox 0x8719922 MSG_FACE '"Vieil homme: désolé, ton équipe es..."
release
end


'---------
' Strings
'---------
#org 0x7198AD
= Vieil homme: Tu veux un [buffer1]?

#org 0x7198CB
= [player] a recu un [buffer1]!

#org 0x7198DE
= Vieil homme: Prends soin de [buffer1]?

#org 0x719900
= Vieil homme: Tant pis pour toi!

#org 0x719922
= Vieil homme: désolé, ton équipe est pleine!

and for tiles scipts can you help us?
 

Zeffy

g'day
6,402
Posts
15
Years
  • Age 27
  • Seen Feb 7, 2024
I've given here a little above x) here it is:

Code:
'---------------
#org 0x719830
lock
faceplayer
random 0x181
copyvar 0x4060 LASTRESULT
addvar 0x4060 0x1
bufferpokemon 0x0 0x4060
msgbox 0x87198AD MSG_YESNO '"Vieil homme: Tu veux un [buffer1]?"
compare LASTRESULT 0x1
if 0x1 goto 0x871985C
goto 0x8719897

'---------------
#org 0x71985C
countpokemon
compare LASTRESULT 0x6
if 0x1 goto 0x87198A2
random 0x99
copyvar 0x4061 LASTRESULT
addvar 0x1 0x4061
msgbox 0x87198CB MSG_FACE '"[player] a recu un [buffer1]!"
givepokemon 0x4060 0x5 0x0 0x0 0x0 0x0
msgbox 0x87198DE MSG_FACE '"Vieil homme: Prends soin de [buffe..."
release
end

'---------------
#org 0x719897
msgbox 0x8719900 MSG_FACE '"Vieil homme: Tant pis pour toi!"
release
end

'---------------
#org 0x7198A2
msgbox 0x8719922 MSG_FACE '"Vieil homme: désolé, ton équipe es..."
release
end


'---------
' Strings
'---------
#org 0x7198AD
= Vieil homme: Tu veux un [buffer1]?

#org 0x7198CB
= [player] a recu un [buffer1]!

#org 0x7198DE
= Vieil homme: Prends soin de [buffer1]?

#org 0x719900
= Vieil homme: Tant pis pour toi!

#org 0x719922
= Vieil homme: désolé, ton équipe est pleine!
and for tiles scipts can you help us?
There's nothing wrong with it, really. It should work, but I can't be sure. I don't have XSE right now so I can't test it. :<
 
33
Posts
13
Years
  • Seen Dec 12, 2020
the problem is that I sometimes become a "?" which is a non assigned pokemon. It's a pokemon you replace when you wanna add one of yours. and it seems that theyr hex number is between 0x1 and 0x181. In fact the last pokemon hex number is 0x19B for chimecho so they've a number but the only way I see to make those pokemons impossible to give by the script is to check 25 times the random number. Is it possible to make loops in scripting?
 

Zeffy

g'day
6,402
Posts
15
Years
  • Age 27
  • Seen Feb 7, 2024
the problem is that I sometimes become a "?" which is a non assigned pokemon. It's a pokemon you replace when you wanna add one of yours. and it seems that theyr hex number is between 0x1 and 0x181. In fact the last pokemon hex number is 0x19B for chimecho so they've a number but the only way I see to make those pokemons impossible to give by the script is to check 25 times the random number. Is it possible to make loops in scripting?
You could check if it chooses the hex numbers on the "?" Pokemon and loop it by simply putting "goto @(put pointer here to where the comparing script is)".
 
33
Posts
13
Years
  • Seen Dec 12, 2020
thank you , and for the level scripts? (tilescripts) How can we make them work?
 
Last edited:
33
Posts
13
Years
  • Seen Dec 12, 2020
sorry I didn't want level scripts I'm not good in english... I want to make scripts that activates when you walk on it to work. no one I made worked. A simple script with only a msg box don't work and I don't know how to make it work.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
sorry I didn't want level scripts I'm not good in english... I want to make scripts that activates when you walk on it to work. no one I made worked. A simple script with only a msg box don't work and I don't know how to make it work.

Try calling a script from the tile like this:

#org 0xsomeoffset
goto 0xsomeotheroffset
end
 

Zeffy

g'day
6,402
Posts
15
Years
  • Age 27
  • Seen Feb 7, 2024
sorry I didn't want level scripts I'm not good in english... I want to make scripts that activates when you walk on it to work. no one I made worked. A simple script with only a msg box don't work and I don't know how to make it work.
Because in the A-Map tile (the one with the S and colored green), you need to put 4050 in Var Number and 0003 in Unknown. That'll make the script work.
 

Flandre Scarlet

Free your mind.
356
Posts
16
Years
Simply put, PLAYERFACING doesn't always work properly. This can be fixed by copybyte command;
Code:
'---------------
#org 0x808B31
msgbox 0x8808BF8 MSG_FACE '"I'm sorry, but no one is allowed\n..."
[S-HIGHLIGHT]setvar PLAYERFACING 0x0000
copybyte 0x020370D4 0x02036E58            ;Prepare the PLAYERFACING variable.
compare PLAYERFACING 0x04                       ;Is the player facing right?[/S-HIGHLIGHT]
if 0x1 goto 0x8808B99
setdooropened 0x20 0xB
doorchange
clearflag 0x1008
showsprite 0x8
applymovement 0x3 0x8808D1B
waitmovement 0x0
applymovement 0x8 0x8808D1F
waitmovement 0x0
msgbox 0x8808CA0 MSG_NORMAL '"[red_fr]???: Officer, we need you ..."
msgbox 0x8808CEB MSG_NORMAL '"[blue_fr]Okay, I'm coming in now!"
applymovement 0x8 0x8808D23
waitmovement 0x0
hidesprite 0x8
applymovement 0x3 0x8808D26
waitmovement 0x0
hidesprite 0x3
setflag 0x1009
setdoorclosed 0x20 0xB
release
end

'---------------
#org 0x808B99
setdooropened 0x20 0xB
doorchange
clearflag 0x1008
showsprite 0x8
applymovement MOVE_PLAYER 0x8808D09
waitmovement 0x0
applymovement 0x3 0x8808D0D
waitmovement 0x0
applymovement 0x8 0x8808D11
waitmovement 0x0
msgbox 0x8808CA0 MSG_NORMAL '"[red_fr]???: Officer, we need you ..."
msgbox 0x8808CEB MSG_NORMAL '"[blue_fr]Okay, I'm coming in now!"
applymovement 0x8 0x8808D14
waitmovement 0x0
hidesprite 0x8
applymovement 0x3 0x8808D17
waitmovement 0x0
hidesprite 0x3
setflag 0x1009
setdoorclosed 0x20 0xB
release
end


'---------
' Strings
'---------
#org 0x808BF8
= I'm sorry, but no one is allowed\nin here.\pWe have an evil organisation\ninside the building causing chaos.\pWe already have enough people\ninside to defeat them, sorry.

#org 0x808CA0
= [red_fr]???: Officer, we need you in\nhere!\pThings have gotten out of control!

#org 0x808CEB
= [blue_fr]Okay, I'm coming in now!


'-----------
' Movements
'-----------
#org 0x808D1B
#raw 0x13 'Step Right (Normal)
#raw 0x2 'Face Left
#raw 0xFE 'End of Movements

#org 0x808D1F
#raw 0x10 'Step Down (Normal)
#raw 0x3 'Face Right
#raw 0xFE 'End of Movements

#org 0x808D23
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org 0x808D26
#raw 0x12 'Step Left (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org 0x808D09
#raw 0x10 'Step Down (Normal)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

#org 0x808D0D
#raw 0x10 'Step Down (Normal)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

#org 0x808D11
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org 0x808D14
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org 0x808D17
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

Thanks for answering, clears a few things up, but do I only need to do this part once?

Spoiler:


Or do I need to do it like this:

Spoiler:
 

Hiche..

 
979
Posts
15
Years
  • Seen Dec 27, 2014


Thanks for answering, clears a few things up, but do I only need to do this part once?

Spoiler:


Or do I need to do it like this:

Spoiler:

Since you are only initializing/preparing the PLAYERFACING variable, you do not need to put the setvar and copybyte and its parameters before every compare command. When it is prepared, it can be used in any place in the script. When the script ends and you want to use it in another script, you need to re-prepare that variable.

Or should you? :O I'm not sure; let someone who did not stop scripting for over a year answer you.
 
1
Posts
13
Years
Scriptn move tutor help

As the script above to change the attack to teach our pokemon
eg. Seismic Toss-> MEGA DRAIN?

Code:
'---------------
#org 0x1C4BBE
lock
faceplayer
checkflag 0x2CA
if 0x1 goto 0x81C4C1C
msgbox 0x81909A3 MSG_YESNO '"The secrets of space[.]\nThe myste..."
compare LASTRESULT 0x0
if 0x1 goto 0x81C4C12
call 0x81C4F37
compare LASTRESULT 0x0
if 0x1 goto 0x81C4C12
msgbox 0x8190AD5 MSG_KEEPOPEN '"Which POKéMON wants to learn\nSEIS..."
setvar 0x8005 0x6
call 0x81C4F30
compare LASTRESULT 0x0
if 0x1 goto 0x81C4C12
setflag 0x2CA
goto 0x81C4C1C

'---------------
#org 0x1C4C1C
msgbox 0x8190B00 MSG_KEEPOPEN '"I hope you won't toss in the towel..."
release
end

'---------------
#org 0x1C4C12
msgbox 0x8190AA9 MSG_KEEPOPEN '"Is that so?\nI'm sure you'll be ba..."
release
end

'---------------
#org 0x1C4F37
textcolor 0x3
special 0x171
signmsg
msgbox 0x81A644F MSG_YESNO '"This move can be learned only\nonc..."
normalmsg
call 0x81A6675
return

'---------------
#org 0x1C4F30
special 0x18D
waitstate
lock
faceplayer
return

'---------------
#org 0x1A6675
copyvar 0x8012 0x8013
return


'---------
' Strings
'---------
#org 0x1909A3
= The secrets of space[.]\nThe mysteries of earth[.]\pThere are so many things about\nwhich we know so little.\pBut that should spur us to study\nharder, not toss in the towel.\pThe only thing you should toss[.]\pWell, how about SEISMIC TOSS?\nShould I teach that to a POKéMON?

#org 0x190AD5
= Which POKéMON wants to learn\nSEISMIC TOSS?

#org 0x190B00
= I hope you won't toss in the towel.\nKeep it up.

#org 0x190AA9
= Is that so?\nI'm sure you'll be back for it.

#org 0x1A644F
= This move can be learned only\nonce. Is that okay?
 
Last edited:

Darthatron

巨大なトロール。
1,152
Posts
18
Years


Thanks for answering, clears a few things up, but do I only need to do this part once?

Spoiler:


Or do I need to do it like this:

Spoiler:
You only need to use it at the start of the script, or if you change the PLAYERFACING variable at some point.
 

Teh Blazer

Divider of Zero
776
Posts
15
Years
I think this question has been reposted here sevral times, but my script won't activate. I placed it on a level "10" thing (Movement Permission) and I included the setvar in my script. The variable is the same as the setvar, but the script still won't activate. What is it?
 

tkallab

Should have been in Dissidia
1,031
Posts
16
Years
I am not sure whether this belongs here, but I might as well ask anyway...
I'm looking for a way to use the setmaptile command on the tile I'm standing on. Like, I step on a tile with an event and POOF! (<.< no other way to say this I guess -.-) It changes into another tile. Like a "setcurrentmaptile" command.
Anyone?
 

Logan

[img]http://pldh.net/media/pokecons_action/403.gif
10,417
Posts
15
Years
I think this question has been reposted here sevral times, but my script won't activate. I placed it on a level "10" thing (Movement Permission) and I included the setvar in my script. The variable is the same as the setvar, but the script still won't activate. What is it?

This should probably be in the Simple Questions thread but I'll answer it anyway. From my own personal experiences I've concluded events only work if they're placed on 'C' movement permission tiles.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years


This should probably be in the Simple Questions thread but I'll answer it anyway. From my own personal experiences I've concluded events only work if they're placed on 'C' movement permission tiles.

Noooo, events work fine so long as you've covered a few things.

1, be sure, that if you're placing the script on a script event (Green S in A-Map) that the Var Value and Var Number are set properly.

2, if working with a sprite-based event, make sure the sprite has the correct 'Unknown' setting set right.

For an image to refer to, open up XSE, press F2.
Once the Guide Opens, go to 'Working with Tools'
Part 4, the A-Map section.

The first image is of the fat guy in Palette, you'll notice the settings for the 'Unknown' values...
Yours should equal that...
 

Logan

[img]http://pldh.net/media/pokecons_action/403.gif
10,417
Posts
15
Years
Noooo, events work fine so long as you've covered a few things.

1, be sure, that if you're placing the script on a script event (Green S in A-Map) that the Var Value and Var Number are set properly.

2, if working with a sprite-based event, make sure the sprite has the correct 'Unknown' setting set right.

For an image to refer to, open up XSE, press F2.
Once the Guide Opens, go to 'Working with Tools'
Part 4, the A-Map section.

The first image is of the fat guy in Palette, you'll notice the settings for the 'Unknown' values...
Yours should equal that...

Nope. Have you ever tried putting a trigger event on a movement permission other than C yourself? Game Freak's events all occurred on C tiles which is probably why a ROM doesn't support anything but that. Can you please not be so condescending to someone who's been hacking for the best part of two years, please?
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years


Nope. Have you ever tried putting a trigger event on a movement permission other than C yourself? Game Freak's events all occurred on C tiles which is probably why a ROM doesn't support anything but that. Can you please not be so condescending to someone who's been hacking for the best part of two years, please?

No need to get so defensive man.
Well then how come I have maps that don't ever use C and yet I can still run scripts on them?
I've never run into any problems so far, I was just presenting my findings.
(And for the record, I've been hacking since just before my join date, but it isn't how long you've been hacking, it's how well you are at it.)
 
Status
Not open for further replies.
Back
Top