rikstar Posted August 21, 2014 Report Share Posted August 21, 2014 (edited) I encountered this bug in MDscript, while I was working on a project myself. I needed to delete all my saved variable in @storage to start with a clean blank. So I did this: @vo = mds_storage("SECRET CODE NOT ACTUAL CODE","aoau"); @storage[@vo] = 0; And I got the following warnings: Warning: Cannot use a scalar value as an array in /home/magicdue/public_html/dlg/dlg.rpcqdocread.php(183) : eval()'d code on line 19 Warning: Cannot use a scalar value as an array in /home/magicdue/public_html/dlg/dlg.rpcqdocread.php(183) : eval()'d code on line 24 Warning: Cannot use a scalar value as an array in /home/magicdue/public_html/dlg/dlg.rpcqdocread.php(183) : eval()'d code on line 30 I was too lazy to use the good way to do it. The good way is too look how many object are in the array that is in @storage[@vo] and then delete every object in the array. What I did was deleting the whole array right now. I think that this gave those errors/ warning, because mds_storage() give a certain @storage[] object free to use for the player. This is used, so that you can only edit your own array. Or atleast the arrays that you have created or that you know the name of. But I just deleted the array that I got acces to, and the game gives me acces to that array. So nothing exist there and thus I get an error. Hopefully this is helpful in any way, else just ask away. EDIT: WARNING this is irreversible, if this is done you can't ever use that word as a storage ID. ^^This is not true read edit 2. EDIT2: Did some more research on this and came to a different conclusion. This isn't a bug, but there is something different going on. @vo = mds_storage("SECRET CODE NOT ACTUAL CODE","aoau"); @storage[@vo]= 0; @storage[@vo] = array("name"=>uv("name"), "stage"=>0); echo @storage[@vo][name]; So basically when you try this code you/ I mainly use it for this: @vo = mds_storage("SECRET CODE NOT ACTUAL CODE","aoau"); @storage[@vo][uv("name")] = 0; The above code is used to store data in an array and every player has it's own set of variabes in this array. But what I did in the first code is changing @storage[@vo] from an array to a normal variable. So to undo this you only have to change @storage[@vo] into an array again. Do this with the following code: @vo = mds_storage("SECRET CODE NOT ACTUAL CODE","aoau"); @storage[@vo] = array(); This will change @storage[@vo] into an array again. Conclusion: This isn't a bug so sorry for putting it in the bug list. But it is something to watch out for. Now that when you are creating a new @storage["ID"] that it always is an array. This topic should be moved to the general MD script page. Edited August 21, 2014 by rikstar DARK DEMON 1 Quote Link to comment Share on other sites More sharing options...
Root Admin Chewett Posted August 21, 2014 Root Admin Report Share Posted August 21, 2014 Tis moved. Quote Link to comment Share on other sites More sharing options...
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.