SphereCommunity

Full Version: Quest repeat
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
What is the best way to avoid repeated accept/performance of a quest?
i mean a best way for sphere and memory Lol
just tags looks heavy if i have about 1000 quests on shard
i think best option is mysql.
Ahh, really!
Do you have any examples how to organize it?
Tags aren't heavy, stop worrying. Yes, a lot of them on everything might not be a good idea but 99% of the time you can't really do any harm.

Loops are what you want to be watching out for, not storing bits of data.
Storing 100 tags on each player become a reason of loooooong saves Smile or not?
Also, from a TAG you can make a flag variable.
Example (in [] text is placed, there you should write correct functions):
Code:
[DEFNAME QUESTDEFS]
quest_0 01
quest_1 02
quest_2 04
...

TAG0.QUESTS_<[QUESTNUM/32]> |=<def0.quest_<[questnum]>>

IF (<TAG0.QUESTS_<[QUESTNUM/32]>>&<def0.quest_<[questnum]>>)

So, you can store 32 flags in one tag.
Or you can store the Number ID of all completed quests in only one tag.
And check if the Number ID is in the tag to avoid repeat it.

When complete:
Code:
TAG.COMPLETEDQUESTS .= ",<QUESTNUMBER>"
To check if the quest is already completed:
Code:
[FUNCTION F_QUESTS_CHECKCOMPLETE]
LOCAL.QUESTNUMBER <ARGS>
ARGS <TAG.COMPLETEDQUESTS>
FOR 0 <EVAL <ARGV>-1>
IF STRMATCH(<LOCAL.QUESTNUMBER>,<ARGV[<LOCAL._FOR>]>)
  RETURN 1
ENDIF
ENDFOR
RETURN 0
Usage F_QUESTS_CHECKCOMPLETE <QUESTNUMBER>
Try to find a better way a storing information about active quests, for example 5 active quests is max
if player push button "quests" he get a list of active quests.
TAG.COMPLETEDQUESTS .= ",<QUESTNUMBER>"

Nobody told me you could do that! I need to edit some scripts.

That's a really nice handling of this. You have my vote for efficiency.
(08-14-2012 07:13 AM)Anarch Cassius Wrote: [ -> ]TAG.COMPLETEDQUESTS .= ",<QUESTNUMBER>"

Nobody told me you could do that! I need to edit some scripts.

That's a really nice handling of this. You have my vote for efficiency.
Hehehe
I always think more about something to get the best way to do something.
It's like perfectionism.
Pages: 1 2 3
Reference URL's