[King] Where are flags data stored?

BoomBoom

Dedicated Member
Dedicated Member
Aug 16, 2013
108
9
44
Where are flags stored?

For example

#ACT
set [550] 0

If I wanted to change that to 1 without a script where can I edit it?
 

dsmir3

LOMCN Veteran
Veteran
Loyal Member
Mar 12, 2010
311
7
45
Flags are set by script, which then you store either to txt or SQL.

You will always need a script to set flags.
 
Upvote 0

BoomBoom

Dedicated Member
Dedicated Member
Aug 16, 2013
108
9
44
"which then you store either to txt or SQL"

Where? If that is true shouldn't I be able to edit them with notepad or by editing the database manually?
 
Upvote 0

dsmir3

LOMCN Veteran
Veteran
Loyal Member
Mar 12, 2010
311
7
45
"which then you store either to txt or SQL"

Where? If that is true shouldn't I be able to edit them with notepad or by editing the database manually?
The only way to edit a flag, is if it is all ready added in a script as this is how flags are used.

Your over thinking the way flags work, they are effectively an off & on switch within a script. Most of the time that is all they are, to allow points within a script to be activated and deactivated. However if you understand scripting correctly, you can use flags to enter points in a SQL DB or a text file using the script commands.

I would suggest you learn scripting fully, before trying to comprehend how one thing works, as you need to understand everything before that.
 
Upvote 0

BoomBoom

Dedicated Member
Dedicated Member
Aug 16, 2013
108
9
44
So what exactly remembers they are turned on? How does it know player "X" has flag 550 turned on? It has to pull the data from somewhere.

When you do

#if
check [550] 1

where is it stored that player X has flag 550 set as 1?
 
Upvote 0

dsmir3

LOMCN Veteran
Veteran
Loyal Member
Mar 12, 2010
311
7
45
It's all dependant on the script that you are using, to what flags are used, what context they are used in and if a #ACT command is used to store from that previous flag.

Flags are just a switch, that stores virtually because of the client (No actual physical storage). You can only edit all ready written flags or create your own scripts using flags, you have to ask the flag to store if you require it to store and this again as I've said stored either to TXT or SQL.

All the flag does, is check that point in the script/s for the corresponding flag to what it has to do next....
 
Upvote 0

BoomBoom

Dedicated Member
Dedicated Member
Aug 16, 2013
108
9
44
I still don't quite understand :(

Here is a example of a script I was testing

Code:
[@myqs]
#if
check [550] 0
#act
set [550] 1
addnamelist acceptedfirstquest.txt
goto @myqsmain
#elseact
goto @myqsmain


[@myqsmain]
#if
check [550] 1
#say
<Kill 5 Hens/@questpart1>\

(I know this script will work either way even if 550 isn't set to 1 but I removed my character name from acceptedfirstquest.txt and it doesn't add it back)

I've logged out and rebooted the server yet it still remembers the flag 550 is set to 1. Where is that stored? I have not told it to store in a database or text file.
 
Upvote 0

dsmir3

LOMCN Veteran
Veteran
Loyal Member
Mar 12, 2010
311
7
45
I still don't quite understand :(

Here is a example of a script I was testing

Code:
[@myqs]
#if
check [550] 0
#act
set [550] 1
addnamelist acceptedfirstquest.txt
goto @myqsmain
#elseact
goto @myqsmain


[@myqsmain]
#if
check [550] 1
#say
<Kill 5 Hens/@questpart1>\

(I know this script will work either way even if 550 isn't set to 1 but I removed my character name from acceptedfirstquest.txt and it doesn't add it back)

I've logged out and rebooted the server yet it still remembers the flag 550 is set to 1. Where is that stored? I have not told it to store in a database or text file.

http://www.xtreme-server.co.uk/forum/viewtopic.php?f=81&t=2557
 
Upvote 0

BoomBoom

Dedicated Member
Dedicated Member
Aug 16, 2013
108
9
44
I feel like I have asked the same question three times without an answer :(

Code:
[@joblist]#SAY
Current Jobs:\
#IF
CHECK [381] 0
#SAY

What tells it the flag is set to 0 instead of 1? That is the start of the script.

If I was to run this simple command on my server

[@MAIN]
#ACT
SET [381] 1
close

Then go to another NPC with the following

[@MAIN]
#IF
CHECK [381] 1
#SAY
It's working

It will work... But what tells it that it's set to 1? Where is that stored... It has to be stored somewhere
 
Upvote 0

dsmir3

LOMCN Veteran
Veteran
Loyal Member
Mar 12, 2010
311
7
45
You need to learn scripting properly, as you don't grasp it very well.

FLAGS are a On/Off switch - Nothing more or nothing less and in order for a flag to work, a secondary flag also needs to be added in order for the first to work or it gets ignore by the script, they don't store anywhere. Unless like I said, you add a specific command to the script, in order for it to save that point.

You reboot the server, the flag resets. You log off the server, the flag resets.

IT IS NOT STORED

This is the last time I'm answering your question, as I've answered it several times now with the same answer but in different context hoping you would understand and clearly you don't.
 
Upvote 0

dsmir3

LOMCN Veteran
Veteran
Loyal Member
Mar 12, 2010
311
7
45
So why when I log back in the flag is still set? I have also just rebooted...
[@MAIN]
#ACT
SET [381] 1
close

Then go to another NPC with the following

[@MAIN]
#IF
CHECK [381] 1
#SAY
It's working

If your making your basis on the above, then I hate to tell you but it's only reading the #SAY part of the script.
 
Upvote 0

BoomBoom

Dedicated Member
Dedicated Member
Aug 16, 2013
108
9
44
This is what I'm currently testing.

Code:
[@main]
#if
isadmin
#act
goto @gmpart1
#elsesay
You're not a GM...


[@gmpart1]
#if
check [333] 0
#act
SysMsg "333 is turned off"
goto @gmpart2
#elseact
SysMsg "333 is turned on"
goto @gmpart2


[@gmpart2]
#if
check [333] 1
#say
333 is set on.\\
<Set flag 333 to 0/@2>
#elsesay
333 is off.\
<Set flag 333 to 1/@3>


[@2]
#act
set [333] 0
close


[@3]
#act
set [333] 1
close

I turn it on, log out and reboot the server. Log back in and it still says it's on.

Done the same with it off and it works.

I also tested it with the following

Code:
[@myqs]
#if
check [550] 0
check [551] 0
check [552] 0
check [553] 0
!checknamelist acceptedfirstquest.txt
#act
set [550] 1
goto @myqsmain
addnamelist acceptedfirstquest.txt
#elseact
goto @myqsmain


[@myqsmain]
#if
check [550] 1
#say
<Kill 5 Hens/@questpart1>\


#if
check [551] 1
#say
<Kill 5 Pigs/@questpart2>\


#if
check [552] 1
#say
<Kill 5 Deer/@questpart3>\


#if
check [553] 1
#say
<Kill 5 Scarecrow/@questpart4>\


#elsesay
<reset/@resetmq>


[@resetmq]
#act
set [550] 0
close


[@questpart1]
#if
checknamelist quest1.txt
#say
Well done! Here is your reward of 500 EXP.\\
<Return/@myqs>\
<Exit/@exit>\
#act
actcmd GIVEEXPEX 500
set [551] 1
set [550] 0
#elsesay
Slay 5 Hens for me and we can talk...

I added the first quest however from what you've posted every time I log out/reboot this script should reset itself starting from the first quest of killing 5 Hens however it keeps going to <Kill 5 Pigs/@questpart2>\

---------- Post Merged at 05:11 PM ---------- Previous Post was at 05:05 PM ----------

Actually I think it would go there either way. The quest does reset 550 back to 0 after the quest is complete and I've added this to another NPC to tell me what flags are set.

Code:
#if
check [550] 1
#act
SysMsg "550 is turned on"


#if
check [551] 1
#act
SysMsg "551 is turned on"

It only says 551 is on
 
Last edited:
Upvote 0

dsmir3

LOMCN Veteran
Veteran
Loyal Member
Mar 12, 2010
311
7
45
This is what I'm currently testing.

Code:
[@main]
#if
isadmin
#act
goto @gmpart1
#elsesay
You're not a GM...


[@gmpart1]
#if
check [333] 0
#act
SysMsg "333 is turned off"
goto @gmpart2
#elseact
SysMsg "333 is turned on" 
goto @gmpart2    


[@gmpart2]
#if
check [333] 1
#say
333 is set on.\\
<Set flag 333 to 0/@2>
#elsesay
333 is off.\
<Set flag 333 to 1/@3>


[@2]
#act
set [333] 0
close


[@3]
#act
set [333] 1
close

I turn it on, log out and reboot the server. Log back in and it still says it's on.

Done the same with it off and it works.

I also tested it with the following

Code:
[@myqs]
#if
check [550] 0
check [551] 0
check [552] 0
check [553] 0
!checknamelist acceptedfirstquest.txt
#act
set [550] 1
goto @myqsmain
addnamelist acceptedfirstquest.txt
#elseact
goto @myqsmain


[@myqsmain]
#if
check [550] 1
#say
<Kill 5 Hens/@questpart1>\


#if
check [551] 1
#say
<Kill 5 Pigs/@questpart2>\


#if
check [552] 1
#say
<Kill 5 Deer/@questpart3>\


#if
check [553] 1
#say
<Kill 5 Scarecrow/@questpart4>\


#elsesay
<reset/@resetmq>


[@resetmq]
#act
set [550] 0
close


[@questpart1]
#if
checknamelist quest1.txt
#say
Well done! Here is your reward of 500 EXP.\\
<Return/@myqs>\
<Exit/@exit>\
#act
actcmd GIVEEXPEX 500
set [551] 1
set [550] 0
#elsesay
Slay 5 Hens for me and we can talk...

I added the first quest however from what you've posted every time I log out/reboot this script should reset itself starting from the first quest of killing 5 Hens however it keeps going to <Kill 5 Pigs/@questpart2>\

---------- Post Merged at 05:11 PM ---------- Previous Post was at 05:05 PM ----------

Actually I think it would go there either way. The quest does reset 550 back to 0 after the quest is complete and I've added this to another NPC to tell me what flags are set.

Code:
#if
check [550] 1
#act
SysMsg "550 is turned on"


#if
check [551] 1
#act
SysMsg "551 is turned on"

It only says 551 is on
Your using checknamelist & addnamelist, this why it's not restarting as you've used a store command. Your using TXT manipulation to store information, so the script will read them first as well as the flags and as you have a On flag for addnamelist it will always read that as being on.
 
Upvote 0

BoomBoom

Dedicated Member
Dedicated Member
Aug 16, 2013
108
9
44
It's not under the same #IF command though ([@myqsmain])

I removed the .txt stuff and it's still working.

That also wouldn't explain why the first NPC with flag 333 remembers

---------- Post Merged at 08:58 PM ---------- Previous Post was at 05:38 PM ----------

Also this post from idabiga suggests it's permanent?

http://www.lomcn.org/forum/showthread.php?60093-About-Flags&p=656682&viewfull=1#post656682
 
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
I can't believe all this crap people are posting about flags.

BoomBoom, flags are set in the SQL and are PERMANENT! They are stored in the table TBL_Quest in the Game3G database (on a 3.55 server).

You cannot edit this table directly in the database but only in game.
 
Upvote 0

BoomBoom

Dedicated Member
Dedicated Member
Aug 16, 2013
108
9
44
Thanks. Can confirm it is.

Emptied the database and it removed all the flags. I had to manually add my characters name back for them to work (permanently) again. While my character name wasn't there they did what dsmir3 said would happen and kept removing themselves after I logged out.

Shame there is no other way to edit them though :(
 
Last edited:
Upvote 0

dsmir3

LOMCN Veteran
Veteran
Loyal Member
Mar 12, 2010
311
7
45
I can't believe all this crap people are posting about flags.

BoomBoom, flags are set in the SQL and are PERMANENT! They are stored in the table TBL_Quest in the Game3G database (on a 3.55 server).

You cannot edit this table directly in the database but only in game.
Don't have to be a dick about it and using a plural to describe the act of one person is just plain dumb of you Mick!

@Boomboom

My apologies for getting it slightly wrong, as unlike most here I've had a life and not allowed the files to take over that life and so I am rather rusty when it comes to them at the moment.
 
Upvote 0