Jump to content

Chewett

Root Admin
  • Posts

    28,522
  • Joined

  • Last visited

  • Days Won

    648

Everything posted by Chewett

  1. It Is recommended that you read [topic='5494']Variables[/topic], Before reading this. Copied From Murs initial Post (no code changed) [b]User Vars[/b] Properties of the user accessing the script are available to the script. Don't worry, private info is not available to the script. Function to read user vars: [php]mds_read_uvars(var); uv(var);[/php] The uv() function is much shorter and easyer to use. What it does is actualy call the mds_read_uvars() function in turn. Parameters: var = a keyword that indicates what value you want to know about that player. Available vars: 'id' = player id 've' = vitality 'vp' = value points 'xpl' = exploring points 'maxve' = maximum vitality 'maxvp' = maximum value points 'land' = land id, 'alliance' = allaince/guild id 'age' = active days 'loyalty' = loyalty points 'honor' = honor points 'name' = playername 'mp' = mindpower 'heads' = heads 'won' = won fights 'lost' = lost fights 'avatar_level' = avatar level 'avatar' = avatar id 'xp' = experience, 'kills' = kills during torch competition 'illusion' = set if player in an illusion 'location' = current location of user 'stored_heat' = amount of heat player has stored in their erolin device [php]if(uv('ve')>10000){ if(uv('heads')>1000){ echo 'Run, hide, protect your head..sss'; }else{ echo 'You are alive, but you don't have so many heads with you '; } }elseif(uv('won')-uv('lost')>300){ echo 'Well you are wery weak but you won a lot of fights so...'; }else{ echo 'get lost'; }[/php] [php]echo "Hello ".uv('name')." ";[/php] This function can not be used to change user variables.
  2. Copied From Murs initial Post (no code changed) [b]Key Control[/b] Keys are what decide what users can access in game. They are like flags to indicate all sorts of things and to track what player did and achieved. A special category of keys are the ones that you can set from the MDScript. They are just like the keys used to setup the entire realm, just that they have a prefix "rpcq-". You might notice that the same prefix is set on the Clickable items, well its no coincidence. Clickable items run as clickables if you don't have the key to access them and run as something else if you do have the key. Currently there are no clickables that have something behind them to run, but some important clickables that had are the Loreroot back entrance and the Drachorn Cave, meaning that if you got the key from a mdscript you could have entered the cave and get plenty of drachorns or have permanent access to LR back entrance. So pay attention to MDScript, it might be more interesting than you think. Enabling more clickable items to do something behind their keys will be done if i see people realy understand how to use and not ab(use) them. Combining strict rules with total freedom might not be possible afterall, anyway the system allows it right now so who knows what will be in the future of MD. For now, scripted keys are excelent way to track quest progress, and make scripts "know" what the player evolution with that script is. There is a new feature for data storage, that could be used just the same way, but i strongly think that keys have a major use along with that. Data storage and keys will have different evolution path because they are tehnicaly different things. Keys are saved with the user, data is separated. Differences between data storage and keys Data storage, unlike keys, can store lots of data of all sorts, but they also get deleted once they get empty. Its no way to track what data a user has outside the clickable objects or MDScript. Keys can be tracked in game interface and used under many circumstances. Keys are very bad for holding actual data, they are just flags that are on or off. Only info keys hold is the time and place they were received and thats for logging reasons mostly. Both keys and data storage have their advantages and disadvantages and their different uses. They are not one and the same thing, even if under current situation they have similar use. Function to manage keys: [php]mds_give_rpcq_keys(keys);[/php] Gives the keys to the player. [php]mds_take_rpcq_keys(keys);[/php] Removes/takes the keys from the player [php]mds_has_rpcq_keys(keys);[/php] Checks if the player has specific keys, returns true if all keys are in the players possession , false otherwise Parameters: keys = a string with all the keys you want to give , take, or check. It doesnt support arrays, the parameter should be a string with comma separated values Examples: [php]if(mds_has_rpcq_keys('key1,key2,someotherkey')){ echo "Congrats you have all the keys"; }else{ echo "You do not have all needed keys"; }[/php] [php]if(..some rule here...){ @vk[] = 'key1'; } if(..some other rule...){ @vk[] = 'key2'; } @vs = implode(",",@vk); mds_give_rpcq_keys(@vs);[/php] [php]//replace keys //for example player just delivered a package and rceived next task if(mds_has_rpcq_keys('someotherkey')){ //takes initial key away, so it wont be used again mds_take_rpcq_keys('someotherkey'); //gives other keys in replace to continue mds_give_rpcq_keys('key1,key2'); } //final key could trigger a reward [/php] [b]Sharing keys[/b] Keys are global. A key named "greenbox" will be the same for that player if checked by any item or script in the realm. TO avoid key collisions you should name your keys in original way or even better , you should add a prefix to them. Example of good key names: playername-greenbox , or zzg3-greenbox, greenbox-tree-quest23 Example of bad key names: box, package, key1, somekey, general, .. Sharing keys is very interesting when multiple editors want to syncronize their quests. For example an item scripted by an editor could check for a key given by an other editor/quest to see if that user finished that quest first. [b]Key secrecy[/b] Because keys can be set by any editor, keeping your keys named complicated and secret is most important to avoid cheating. If you trust all the other editors, you can ignore that advice. Other editors can not see your code, except if you script on public items (there is a special category of items that share content and script across any editor).
  3. Debugging Your Code Debugging is not some weird activity programmers do...well it is but if you want to do interesting things with MDScript you have to know about it. Seeing what is inside the variables you are working with is very important to understand what you should do with them next. Simple variables are easy to check, you just output them and see what value they have: print @va; (i usualy use 'echo' instead of 'print' , they do same thing, but print sounds easier to remember) Best practice is to put some other value next to the one you are looking for, so that if the variable is empty, you will see that and not just an empty page not knowing if it was output or not. print "V=".@va; This will output V=something or V= if @va has no value. Better than nothing at all. Arrays are harder to debug by just using simple output. Multidimensional arrays are even worse. Fortunately there are functions to help you see exactly what is inside a variable. Debug Function: debug(variable,label); Parameters: variable = any kind of variable simple or multidimensional array with or wihout data label = a label to help you identify the debug output, optional (means you can use just the variable parameter) debug(@va); This will be your best friend when trying to understand what data you have in all those variables. It will generate a nice colored box with all the details you need about the internal structure of the variable you are trying to analyze
  4. Copied From Murs initial Post (no code changed) Templates Function: mds_template(template,data,return,columns,attributes); Parameters: template = template to use for each data displayed. Variables in this template should be noted as [[somename]] where 'somename' can be anything data = can be an array with keys named like the strings enclosed in [[...]] in the template or a multidimensional array for more records. Such an array has each of its items as an array with values return = if its true, function will return the string so it can be used in the script, if its false, it will display the result directly. columns = for multidimensional arrays, this parameter tells on how many columns they should be displayed. If its false or 1 the records will be displayed one per row. It has no use if the data array does not contain multiple records. attributes = when displaying multiple records, they get organized in a table. The attributes parameter can contain a string to be placed inside the <td ...> tag of each cell. This could be a style an attribute but also javascript or anything that is html valid. You can use bits of content as templates with variables. @content[1] is the content after the first content separator lets say for this example template code contains: [php]<b>[[name]]</b><br>[[rowinfo]]<br>Details: [[more]][/php] Script to use this template: [php]//make sure @tpl its empty @tpl = array(); [php]<b>[[name]]</b><br>[[rowinfo]]<br>Details: [[more]] //do something 20 times for(@va=0;@va<20;@va++){ @tpl[@va]['name'] = "Record {@vk}"; @tpl[@va]['rowinfo'] = "Row {@vk} has value".@vv; @tpl[@va]['more'] = "more values ..."; } //call template function mds_template(@content[1],@tpl,true,3,'style="border:1px solid"');[/php] This will display the content in @tpl, on 3 columns, each time parsing the template in @content[1]. The style indicated in the last parameter will be used on each of the 20 table cells created.
  5. Copied From Murs initial Post (no code changed) Managing Content Sections In the content sections you put all text, stories, forms, templates, javascript and all things that are not MDScript code. Instead of putting all content in one big piece, you can separate it by placing a content separator, thats exactly this string: <!-- content separator --> All the pieces of content separated by such a separator, will be available for use in the MDScript under the @content array starting at index zero. Example: Content part 1 <!-- content separator --> Some other content <!-- content separator --> A template [[test]] with variables <!-- content separator --> A form <form ...> ... </form> This will be in the MDScript seen as: @content[0] = Content part 1; @content[1] = Some other content; @content[2] = A template ... with variables; @content[3] = A form <form ...> ... </form>; This way of separating content is very useful. You could display different content sections depending on different rules you set in the script. Also its very important when you use templates.
  6. Copied From Murs initial Post (no code changed) [b]Variables[/b] Variables are what store data. In normal PHP language they are almost any string that starts with a dollar sign $. In MD script i had to change that for security reasons and make variables start with @ and have a predefined na,e. You can use only a few predefined variable names, use them wisely and they will be sufficient. You can use arrays too so you could fit an unlimited number of keys into one array if you are realy in big need of a large number of variables. 26 general use variables @va to @vz 3 dedicated variables named more conveniently so you have things easyer to follow They are tehnicaly the same as the 26 general use variables, they just have nice names @tpl , to be used for template replacement values @temp to be used for temporary things like loading values and then storing them into an other array @log to be used for storing logs during script execution or anything else that fits the name 3 special variables @input , this will get filled automaticaly with anything sent from a FORM (user input!) @content, this is an array that hold each of the content sections that you separate by the content separator in the content editing field, the other field besides the script editing field. @storage, gets loaded with data by the mds_storage() function. All data in this array gets saved to the database as a storage. Set data in the right indexes and after initiating storage or your script will get warnings if you set this var chaoticaly.
  7. Copied From Murs initial Post (no code changed) [b]Restrictions and Errors[/b] There are a lot of usual words that you are not allowed to use in your scripts. Try to rename them and avoid warnings. It is not a syntax check, its a broad check over what you type there in your little green scripting box to avoid exploits. Most red errors mean your script was not parsed because it did not pass the security checks. If your script gets parsed but you run into a nasty fatal error that stops loading the page, you will have a blue "edit in case of error" link so you can edit and fix the script. [b][STRICT RESTRICTION] Errors[/b] You used words or signs that are not allowed, simply rename them [b][GENERAL RESTRICTION] Errors[/b] Same as above. They cover a larger number of words and letter combinations. Same issue may cause an error in multiple error groups, but once you fix it they will all dissapear. [b][LANGUAGE RESTRICTION] Errors[/b] This means you tried to use a php function or keyword that is not supported. About 250 php functions are supported, out of thousands probably. You should have plenty of tools to play with but some things are just not safe for general use. If you think a function you could use is not available and its harmless, make a request and i will analyze it. [b][SEQUENCE RESTRICTION] Errors[/b] These are odd errors, but they are needed. Sometimes it makes no sense why you can't use a group of characters one after an other, but its mainly to prevent abuses you never dreamed of. Try to use something else, rename, reorder, etc. [b]Fatal Errors and Parse Errors[/b] These could be black ugly errors or red errors. This mean your script was compiled but failed to run. If you get a line number out of it, lucky you. Search that line for a possible mistake, a lost quote, a missing bracket or a missing ";" at the end of the line, etc. If the line is the last one in your script, you probably left a bracket open, see that all open brackets { match a closing bracket }. Not all the time the error that is written is helpful to know what happend. You should check your script open minded and not got stuck in the hint that the error message gives. [b]MDScript Warnings[/b] These are very useful warnings to tell you things that happen with your script. The errors are very targeted and explain most of what is going on. You should read them and try to fix the script so that you won't get any. In case the warnings can not be fixed or should not be fixed, there is a bypass function to hide the warnings, but use it ONLY when you are sure you understand all of them and you are sure they do not affect the functionality of the script. [b]Hide MDScript Warnings Function:[/b] [php]mds_no_warnings(); //place it anywhere in the code[/php] This will not stop other errors than MDScript Warnings
  8. Copied From Murs initial Post (no code changed) How to Store values/variables using MDScript [php]//code in item A @vh = "wow thats simple"; store(@vh); //code in item B retrieve(@vh); echo @vh; //will output "wow thats simple" //can be used to store and load entire arrays of data.[/php]
  9. Guidelines for posting Sample code 1. Make sure it works, its no point adding code that doesnt work. 2. Always use Php Blocks, It makes it easier, See example below [code][php] post your MDScript code between these tags [/php][/code] This will appear as [php] post your MDScript code between these tags [/php] 3. Comments - Even if the code is really simple, add comments, this will help people understand it better
  10. Hello, Im new to the forum and never got a "real" hello topic So i thought on my Two Year Active Days i might as well ask for one So, Im back! *queues the boo's* After a small break where dst bet me that i couldnt count all of the players with ID less than 100000 And... There are... 12,353 Accounts (including RP accounts) with ID's less than 100000 NOTE: One of those statments are false, Im going to let you try and work out which What else, what else, follow the White rabbit? And always take the Red pill Im going to be reading up on all the posts iv missed (lucky me...) and doing whatever i normally do lol
  11. Php and Sql has been used in my md scripts for ages, so im glad i might be able to incorporate my "services" into objects So i would love to help you test it. and ofc mur (or anyone) ya can ask to see my "MD scripts"
  12. This is my nominal post for the day person/alliance/land/tag This already does this in part, It brings up numbers linked to the alliance and land, You just need to know what number means what. And name is already implemented But yes it would be intresting to have this implemented slightly better It would be good if the suggested syntax and language constructs be implemented as suggested in a pm i sent to you about a year ago, But i suppose that it will have been deleted as "more work!" So my only comment is "KEYS!"
  13. [quote name='Pipstickz' date='23 October 2009 - 01:27 AM' timestamp='1256257671' post='45516'] So...what have Lifeline and Chewett done for Marind Bell lately? They've both been alliance leaders, and have had the chance, but have they done anything? How many Marind Bell alliance members do you see out and about, compared to other alliances? The latest positive change I see in Marind Bell is the Sparring Grounds. [/quote] Very Good question, What have we done. Nothing. But there is a reason, if a bad one for that. Mur. If you read the adventure log there were several meetings with I, Liberty and Him. In those meetings he outlined a plan for Marind Bell that he wanted to take Forward. Changing the alliance structure and also Making Himself the head of The Soe For the period of time. Now in that meeting we were told to do nothing about Soe and Marind Bell until Mur had readied the changes, and then made them. We have followed what he asked of us, until recently when we asked him about his plan, Which he confessed he had forgotten entirely. So, We are to blame in the fact that we followed Murs plan, But i would not say that is something we could have refused I do not blame Mur for this issue, for he is busy, But i am saddened that you Pip are asking what we have done and i have had to say this. All the plans he made with us, Cannot be fufilled. Much time spent preparing the alliances, and waiting for Mur to make the final move. All for nothing. [b]We will move on. We will make Marind Bell Better. And We shall NOT rely on one person to help us do this.[/b] We Do not need the King position to continue our plans, For they are ones that the Kingship only has interrupted breifly. We are now collecting together a new "team" so we can work effectively. If Lifeline is made king or if Pip is made king, we shall follow our plan. For we believe it is a good one. And on a final note I ask myself, [b]What have you done for MB Pip? Or even better, What have you planned for it?[/b] Because the changes Mur had planned were something that would have Made MB one of the most intresting and strongest lands. And we did not want to sacrifice that for a couple of stupid things that Mur didnt like.
  14. Chewett

    Who Is Right?

    Grido is most definately right Dst is most definately right
  15. [quote name='Liberty4life' date='21 October 2009 - 11:50 AM' timestamp='1256122222' post='45349'] unless chew doesnt candidates me votes for ya as well [/quote] My Vote if Firmly Behind lifeline, We shall Be co Running the Land with him king and me being the council head until we have a vote and another person succeeds me. I urge you, If something occurs such as this, wanting to vote for i and not Lifeline, I urge you to vote for him. He holds my principles and Values and know that he will make a great king
  16. [quote name='Fenrir Greycloth' date='18 October 2009 - 03:21 AM' timestamp='1255832499' post='45014'] As I am sure you expected Mur, you will recieve nothing but "finish what you started"s. This is a very good piece of advice. We all anxiously wait what you have planned with the scholars and black letters and the changes to the battle system(I don't look forward to the battle system myself but others do lol). Hopefully we con complete these before Alpha Ten. [/quote] Come one fenrir, Sucking up wont do you any good. You know he only casually mentioned two of these features and you have no idea about them. And really, A battle system change would be a whole stage likely as it would be so big [quote name='Jester' date='18 October 2009 - 05:06 AM' timestamp='1255838763' post='45024'] You consider removing the RPCs is big enough to go to v10? Wouldn't removing a failed feature be going back to the beginning and having to try again? With the way MD is right now I'd say move on to v08, or v07.Torches was implemented, and that failed. Not very many people even try, and those who do can't find people to attack and just sit at GoE or SG.Items are boring and have no purpose except to collect and trade.Achievements have no purpose and can be finished by anyone playing the game normally or with a little help from another, except the LHO achievement, which just makes it so most people can't finish them all. With RPCs gone I don't even know how you're supposed to get the spell doc one.The lands of the East have nothing in them except a place to get achievements and an actual Pub.Combat was utterly ruined by the token system, which I assume was meant to bring in money but will probably end up chasing away all the new players who would spend money if they found the game to be worth playing. Since most of the MD shop items are based on combat, ruining the system that people spend money on seems... strange.I won't bother going through the list Mur posted that has all the other unfinished projects, I think it speaks for itself.This is progress in MD? Am I the only one that likes things to be finished before moving on? [/quote] I agree with Jester on this, On all of his points. You removed quite a lot this stage, and it would be interesting to move back to v8 B or something to show that some things and ideas failed. Ofc we all know you prefer new projects, But the token system utterly broke the Fighting System, The Whole Rp system is now based on the Wp shop and the wishpoints which i see needs some fixing. Everything changes, it would just be intresting to go back to a "second epoch" and try it again, A bit like an undo button on the computer.
  17. [quote name='Death Bell' date='18 October 2009 - 01:38 PM' timestamp='1255869513' post='45061'] yeah he has only 6 posts [/quote] This made me burst out laughing, If i say he can make a gallery, he should be able to make a gallery!
  18. With the magic of magic, you can now make a gallery! Please add them
  19. Im a "former rpc" if anyone didnt know so im going to put forward my view. Firstly, Mur if posting this small section at the top of this post will mean you will read it then fine. When the rpcs are complaining to you there are two differnt "types" Some that are annoyed they lost their "special" powers and some that are genuinely annoyed that they will have to go quest for things. I know many of the rpcs that didnt quest for Wishpoints as they had what they needed and wanted to do quests and such. Now its a double blow that wishpoints are more rarer as they wont regenerate on old rpcs (confirmation needed) and that they need to get them to Do their quests. It will mean a lot of hard work for the rpcs that had planned a quest or were halfway through a quest. You say that the old rpcs have nothing to lose? You may assume from the response you got about removing rpcs that rpc status was the only thing that rpcs could lose. Really, i value my friends in the game much higher than some dots. I am not annoyed at losing the status, merely that i now have to work for something that i didnt plan to have to. If i had known about this change earlier i would have collected some WP in the period when they were given out for spelling your name. I have always spoken my thoughts to you, Yet when i spoke to you this time it was that i lost my toys and have "nothing to lose". You know i was never a one to follow you like a sheep, We had some viscous arguments on some issues, But they were always resolved. I don't know what the other rpcs said to you when they were rpc, But the status meant nothing to me. Respect given freely is utterly pointless. Earnt respect is much more worthy than respect gained by a title. I do not disrespect you, im still very in awe that you managed to create a game such as this and run it all, without (For the most part) it falling into pieces. I present this opinion speaking to you as an equal for i believe that however much people think they are "better" than others, every opinion is valid. So, Please i have always given you my honest opinion, and am not going to stop now just because i have "nothing to lose" as you think. And to everyone else, I accept the consequences of my posting my opinion, But i believe Mur hasn't changed from when he said "opinions will not be punished", So i post it freely without fear of consequences, and shall accept any that come my way for just saying my opinion. Here are the main problems that i see with no rpcs: Leadership - Whereas the next level up from a normal person was generally an rpc, Many issues could be directed at an rpc as they have been officially recognised by Mur. Now you will either have to pick a player that you trust to deal with whatever issue comes up, Or it will just be sent to Mur. Since there are no one who has been officially recognised then there is no "immediate" person who you could look at it and take the problem further or sort it out themselves. This will i believe them create a mass of paperwork that will be sent to Mur because he will be the only person who is "official" and can "officially" recognised. King Positions (aka rpc^2) - There will be one king per land, And it seems that these will be the replacement for rpc's, now the problems i see here is that the rpc's who actually did work were already overworked, Now if you are replacing 10 rpc's that did work with 4 "kings" then the workload will increase massively. Since they are now the "official" next level from normal players they will likely be in undated with pms that would have been sent due to problem 1. so if i look at the current "likely" kings/queens, Peace stepped down as NS head since there was too much work, I haven't seen any Loreroot Nor MB possible Kings have had experience with general admin. I don't personally think that anyone will be able to see the problems that no rpc's will cause. I meant no disrespect, i am merely worries about the amount of paperwork that you will have to deal with. Wishpoints - Now unless i have understood this incorrectly, Old rpc wish points will not regenerate. Now this is a massive problem in regards to distribution of wishpoints. But i see Mur has found a solution, Look through who is online and see if he likes their papers. Now last time i checked he wanted automation. This is merely some form of "rpc" status where he checks peoples papers and rewards them accordingly. This just seems the same to rpcs where he personally selects people. This is unfair just like how the rpc status was, where Mur checked things and if its based on him looking its just like rpc status that mur said he didn't update quick enough. Also I have already seen people starting to "bribe" people for wishpoints, and just a while ago people wanting to know a list of who got wishpoints so they can purposely do their quests. He said he would reward Wishpoints to good quests, But unless he is either told about the good quests it will be the same rpc problem of him not recognising good quests and such because he is busy and focused on something else. Kings = Game Managers Divided by 4 - So far we know little of what the king accounts will have access to but from what you have said "Absolute power" it just seems like you have split the duties of each land to 4 people and pronounced them "king". This status is akin the game manager, as he was described as having absolute power over us. And we all know that Mur didn't want one of them because it was just too much power for one Person. So now there are 4 Kings that have the power that Mur previously wielded and assigned. Surely this is a step backward in as it still relies on a few people to decide. The added problem is these players are now so different from normal players that they can do what they like. Any arguments with a king is utterly useless as you will never be able to progress without a king as Mur wont be running it. Wheras Mur is objective sometimes i see some candidates that will hate me for writing what i write, and therefore if i were in their land i wouldn't be able to progress. Rpcs have just merged with the Game managed, (that Mur said he hated the position) to create a couple of Game managers, People with the power to destroy a person, And we all know what happened last time. Kings will be different from GM's in one way, Kings will be able to be voted out. But then you have the other side in that some people who perhaps have the vote power but are not likely to be good "kings" will be accepted because the vote counts. So it might be potentially be more unstable as people who are popular are not necessarily good leaders. The good thing about a GM was the fact that it was picked my mur, and if he And now i return to a holiday that has been interrupted
  20. [quote name='Grido' date='12 October 2009 - 07:21 PM' timestamp='1255371680' post='44495'] Not sure if this applies to anyone, but would it be possible to have dual citizenship? It can happen irl, not sure how it would in MD, but wondered if it was possible? [/quote] I: could there be duel Kingship Mur: if its considered a council and a CLEAR rule is made on how decisions are taken, expecialy those that not both agree on
  21. aha lol i see, i actually thought you had used you brain and thought of something, oh well, i can keep wishing
  22. Ofc, i expected no less than to be banned from all your future quests, And you have a method of checking crits? ah, so you have found another way, mine is limited to rpcs... so i have no idea how you can be 100% sure, As if you check my profile, i have no crits but actually i have around 60ish
  23. My photoshop skills are superb, Wheras my memory isnt Some may be shocked by this, But i did the same with the broken Gazebo, and admitted it was faked once mur had said he would give me a puzzle badge, And Grido can confirm my intentions as i spoke to him about this before going ahead. And Fenrir, read the pm, i can check for definate if people have crits, if you want my help ofc
  24. True true, But i havent really seen any really good creatures yet.
  25. [quote name='Grido' date='29 September 2009 - 07:39 PM' timestamp='1254249557' post='43182'] the community needs to be able to see what stats you would put on it, so that they can say if they think it's too strong / already implemented, or some other comment [/quote] Grido is right, If Mur is making a creature then we dont need to know about its stats, But when the community wants to make one, Then it needs all the support it can get and has to be well thought through. Mur wont make it because one person likes it
×
×
  • Create New...