Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I Had A Horrible Dream

Featured Replies

omg i saw this in my dream, i was working on my quest and everythign was going good, but there was a loophole in it. and i saw that loophole in my dream. if someone has the key to acces the storyline with choices, they can go back and make a choice again by starting from the beginning... How do i prevent this from happening? when making the choices to do do i leave the key there and make it so you cant get another key if they have that one? or is there a better way... am i making sense? maybe. idk. glad all i do is dream of md. lol

It should be fine to hold a key to determine their story path.
Once they complete the quest/it has ended, be sure tou clean up all keys and you can give them a single "quest-ended" key so they can't start it up again, or remove that code too.

You could also try using arrays in storages to manage progres,which would be more elegant, but much more complex.

I'll write an example of the key cleanup when I get a chance.

  • Author

thats the thing ren... if i clean up the key afterwards then they can do another persons quest afterwards... thats what i want to avoid... if you want details are you on yim?

I think what Ren meant was keeping an endquest key at the end, and having the beginning part of the quest have a function that checks whether the person has that endkey or not. If the person does, then s/he cannot access the first part of the quest anymore.

That's exactly right Udgard. It all depends on how you want to set your quest, and you could even have multiple end keys :)

RJ, I sent you a PM, I'm won't be on a for few hours though.

is there a way to make an if looking for any key from a person?
like, we were told to use our playername as first part of the key, and i heard that asteriks can be used to replace strings of any lenght, at lest in some languages...

so, wouldn't it be possible to check for any 'smart*'-key in an if?
along the lines of

[php]
if (mds_has_rpcq_keys ('smart*'))
echo "you already started that quest, get going!";
else
echo "Hi there, looks like you want to start my quest, follow these instructions: [...]";

mds_give_rpcq_keys ('smartalek-first-key');
[/php]
NOTE: Pseudo-code, would most probably not work that way!

Would such a thing work? Would it even be possible, or open up another problem i don't see right now?

Edited by Burns

I haven't yet looked at MDscript, but I did something similar for one of my quests, using php. For MDscript I would do something like:
when starting the quest, give the player two new keys [i]Kafuuka_questx_started[/i] and [i]Kafuuka_questx_stage0[/i]
whenever players advance the quest, delete the key [i] Kafuuka_questx_stagen[/i] and make a new one [i]Kafuuka_questx_stagen+1[/i]
when it is finished, do not make a new stage n+1 key

The only checks you need to make are:
if the player is at the clicky to start the quest, see if s/he attempted it before.
if the player is at the n-th clicky, see if s/he has key n.

If there are different routes, you will have to make even longer keynames, eg. [i]Kafuuka_questx_stageA_pathB[/i]. If multiple paths/stages arrive at the same clicky, you'll have to check them one by one. It is impossible to have multiple checks to be true and this won't pose a problem. If you are paranoid and don't want people to guess your keynames, use something like [i]Kafuuka_bananas_questx_stagA_pathB[/i] but change "bananas" into a word that no one will guess.

For cleanup there is only one problem: people that got stuck in the quest will have both the [i]Kafuuka_questx_started[/i] and [i]Kafuuka_questx_stagen[/i] key and are trickier to erase when the quest has ended.

Burns, the asterisk will work in regular expressions but cannot find keys with anything behind them.
It would be highly exploitable if it worked, you could scan the keys a player has, and given tem all to yourself, thereby giving yourself access to the quests the palyer is on. And in some cases, judging by the key name you could change it to give yourself multiple-path access. Not to mention it would show you access to MD itself.
This is why there is no mds_get_all_keys() function ^_^

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.