The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Doubts on setflag command

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old November 29th, 2020 (1:44 AM).
MM980's Avatar
MM980 MM980 is offline
"You said you have a dream...That dream...Make it come true ! Make your wonderful dream a reality, and it will become your truth ! If anyone can, it's you !"
 
Join Date: Nov 2020
Location: Kerala,India
Age: 16
Gender: Male
Nature: Sassy
Posts: 118
1. is setflag 0xpersonID enough to hidesprite?
2. I want one professor event to be hidden in lab, but other professor event should be visible in route 1,when I talk to route 1 event, it should hide and when I go to lab, lab event should be visible, so I can use the setflag and checkflag, like, player talk to prof on route 1, setflag 0xsomething then hidesprite, so lab levelscript - checkflag 0xsomething then show sprite, is it the right way?

Thank You
__________________
SIGNATURES:

1.😄 Thank You

2. Recruiting for Let's go Togepi / Pichu (ROM hack of firered)


My dear 'ROCCO'
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old November 29th, 2020 (9:33 AM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
Here I'll make 2 scripts, one outside the lab (person event) and one in the lab (level script).

#dynamic 0x800000
#org @start
lock
faceplayer
msgbox @t1 0x6
hidesprite 0x1
setflag 0x210
setvar 0x4011 0x1 '---------(here I set a var 0x4011 to 0x1 so that the level script knows we talked to prof outside the lab)
release
end

#org @t1
= Hi player, meet me at the lab.

'------------------------ I just used 0x1 and 0x210 as examples, you put your own event number and flag there.

Below is the level script of the lab:

#dynamic 0x800000
#org @start
hidesprite 0x1
setflag 0x210

compare 0x4011 0x1
if 0x1 call @showprof

end

#org @showprof
showsprite 0x1
clearflag 0x210
return

'--------------------------
This way, we used the same flag for 2 prof events. Do note however, that when you enter the lab after talking to the prof, and entering the lab, the flag outside the lab will be cleared as well. To prevent this from happening, we can use a level script outside the lab too:

#dynamix 0x800000
#org @start
showsprite 0x1
clearflag 0x210
compare 0x4011 0x1
if 0x1 call @hideprof
end

#org @hideprof
hidesprite 0x1
setflag 0x210
return

'---------------------------
Hopefully this clears things up a bit, you can easily track events with variables, as one variable can store a lot of values (not sure how much), or you can simply use a different flag that will be cleared when the player enters the lab (provided they talked to prof. earlier).
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old November 29th, 2020 (8:23 PM).
MM980's Avatar
MM980 MM980 is offline
"You said you have a dream...That dream...Make it come true ! Make your wonderful dream a reality, and it will become your truth ! If anyone can, it's you !"
 
Join Date: Nov 2020
Location: Kerala,India
Age: 16
Gender: Male
Nature: Sassy
Posts: 118
Quote:
Originally Posted by mcferaligatr View Post
Here I'll make 2 scripts, one outside the lab (person event) and one in the lab (level script).

#dynamic 0x800000
#org @start
lock
faceplayer
msgbox @t1 0x6
hidesprite 0x1
setflag 0x210
setvar 0x4011 0x1 '---------(here I set a var 0x4011 to 0x1 so that the level script knows we talked to prof outside the lab)
release
end

#org @t1
= Hi player, meet me at the lab.

'------------------------ I just used 0x1 and 0x210 as examples, you put your own event number and flag there.

Below is the level script of the lab:

#dynamic 0x800000
#org @start
hidesprite 0x1
setflag 0x210

compare 0x4011 0x1
if 0x1 call @showprof

end

#org @showprof
showsprite 0x1
clearflag 0x210
return

'--------------------------
This way, we used the same flag for 2 prof events. Do note however, that when you enter the lab after talking to the prof, and entering the lab, the flag outside the lab will be cleared as well. To prevent this from happening, we can use a level script outside the lab too:

#dynamix 0x800000
#org @start
showsprite 0x1
clearflag 0x210
compare 0x4011 0x1
if 0x1 call @hideprof
end

#org @hideprof
hidesprite 0x1
setflag 0x210
return

'---------------------------
Hopefully this clears things up a bit, you can easily track events with variables, as one variable can store a lot of values (not sure how much), or you can simply use a different flag that will be cleared when the player enters the lab (provided they talked to prof. earlier).
Thanks, I tried studying flags and vars, but seems a bit hard, got to study more
__________________
SIGNATURES:

1.😄 Thank You

2. Recruiting for Let's go Togepi / Pichu (ROM hack of firered)


My dear 'ROCCO'
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:16 AM.