smartalekrj Posted October 30, 2009 Report Posted October 30, 2009 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 Quote
Root Admin Chewett Posted October 30, 2009 Root Admin Report Posted October 30, 2009 good question. i would say leave the key there, but im not sure about the garbage collection thing. lets see what Ren thinks Quote
Rendril Posted October 30, 2009 Report Posted October 30, 2009 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. Quote
smartalekrj Posted October 31, 2009 Author Report Posted October 31, 2009 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? Quote
Udgard Posted October 31, 2009 Report Posted October 31, 2009 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. Quote
Rendril Posted October 31, 2009 Report Posted October 31, 2009 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. Quote
Burns Posted October 31, 2009 Report Posted October 31, 2009 (edited) 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 October 31, 2009 by Burns Quote
Udgard Posted October 31, 2009 Report Posted October 31, 2009 Maybe using uvar-first-key, where uvar is that function to return the playername might work? Quote
Kafuuka Posted October 31, 2009 Report Posted October 31, 2009 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. Quote
Rendril Posted October 31, 2009 Report Posted October 31, 2009 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.