- 68
- Posts
- 9
- Years
- Luxembourg
- Seen Jan 28, 2025
Hello,
I have a problem with a script, that checks if the player has a certain item.
Here's a description:
The script shall check if the Player has a certain item. If TRUE -> Set Alarm = Set a fanfare, move a sprite, display a text and set a flag, then end.
If WRONG -> Display a text, that the player has to obtain the key by beating an ennemy, then end.
If the alarm is already activated -> Check if Player has item, if true then checkflag. If the flag is set, then display a text and end the script.
I want that this script is activated by stepping on a teleport-field (which will not be connected to another one). But by testing the script out, the player gets stuck in the script with no way out to escape.
I have absolutely no idea, what caused this to happen and how to fix it.
Here's the code:
[DIV]
#dynamic 0xA00000 'I use the 807 Patch version'
#org @start
lock
checkitem 0x15F 0x1
if 0x1 goto @setalarm
msgbox @needkey 0x6
release
end
#org @needkey
= I need to get the key from Snorlax
#org @setalarm
checkflag 0x1201
if 0x1 goto @alreadyactivated
fanfare 0x0152
applymovement 0x3 @moveflemmli
waitmovement 0x0
msgbox @alarmtext 0x6
setflag 0x1201
release
end
#org @alarmtext
= Perfect!!! Now let's escape !!!
#org @moveflemmli
#raw 0xA
#raw 0x0
#raw 0xFE
#org @alreadyactivated
= We've already activated the alarm.\nNow let's hurry and escape!!!
release
end
[/DIV]
Thank you for the help :) !
I have a problem with a script, that checks if the player has a certain item.
Here's a description:
The script shall check if the Player has a certain item. If TRUE -> Set Alarm = Set a fanfare, move a sprite, display a text and set a flag, then end.
If WRONG -> Display a text, that the player has to obtain the key by beating an ennemy, then end.
If the alarm is already activated -> Check if Player has item, if true then checkflag. If the flag is set, then display a text and end the script.
I want that this script is activated by stepping on a teleport-field (which will not be connected to another one). But by testing the script out, the player gets stuck in the script with no way out to escape.
I have absolutely no idea, what caused this to happen and how to fix it.
Here's the code:
[DIV]
#dynamic 0xA00000 'I use the 807 Patch version'
#org @start
lock
checkitem 0x15F 0x1
if 0x1 goto @setalarm
msgbox @needkey 0x6
release
end
#org @needkey
= I need to get the key from Snorlax
#org @setalarm
checkflag 0x1201
if 0x1 goto @alreadyactivated
fanfare 0x0152
applymovement 0x3 @moveflemmli
waitmovement 0x0
msgbox @alarmtext 0x6
setflag 0x1201
release
end
#org @alarmtext
= Perfect!!! Now let's escape !!!
#org @moveflemmli
#raw 0xA
#raw 0x0
#raw 0xFE
#org @alreadyactivated
= We've already activated the alarm.\nNow let's hurry and escape!!!
release
end
[/DIV]
Thank you for the help :) !