Page 4 of 4

Re: Keyring Discussion Question

Posted: Wed Jun 08, 2011 3:46 am
by Mens Rea
Mens Rea wrote:Hmm I logged into the UOSA tutorial server and purchased some blank keys, I tried copying the keys and got the same message when the key I was copying was in my pack as when it was on the floor. Is the demo server not the demo?
Furthermore, on current UOSA you can copy a non-locked down key without it being in your pack. I just tried it.

So unless something has changed between the demo and UOSA then I think you may be mistaken on this issue Kaivan.

So, if you can copy a key which is not in your pack then you should be able to copy a key which is locked down. At the moment you get a "This is not accessible" which due to recent discussions may not be era accurate.

Re: Keyring Discussion Question

Posted: Wed Jun 08, 2011 4:44 am
by Kaivan
Mens Rea wrote:Hmm I logged into the UOSA tutorial server and purchased some blank keys, I tried copying the keys and got the same message when the key I was copying was in my pack as when it was on the floor. Is the demo server not the demo?
Our demo server is a an experiment in getting RunUO scripts to run on an actual demo server. This means that any error in our scripts will appear on both the demo server and the live server.
Mens Rea wrote:Furthermore, on current UOSA you can copy a non-locked down key without it being in your pack. I just tried it.

So unless something has changed between the demo and UOSA then I think you may be mistaken on this issue Kaivan.

So, if you can copy a key which is not in your pack then you should be able to copy a key which is locked down. At the moment you get a "This is not accessible" which due to recent discussions may not be era accurate.
I think the above answer covers these issues as well.

My best suggestion is that if you want to see how something worked in the demo, its best to actually fire up the demo or look at the code.

In that regard, for reference, here is the code in the demo that shows that you cannot copy a key that is not in your pack:

First, this piece of code is run when you first attempt to use a key:

Code: Select all

#on use(object user)
{
  if(!Q4CD(this, user))
  {
    return(0x00);
  }
The referenced function, Q4CD contains the following code:

Code: Select all

integer Q4CD(object it, object user)
{
  object Q4WD = getTopmostContainer(it);
  if(Q4WD != user)
  {
    systemMessage(user, "That key is unreachable.");
    return(0x00);
  }
  return(0x01);
}
Basically, this means that when you use a key it will check to see what the outermost container that is holding it is. Since players count as containers, if it is being held by a player, then the player becomes the outermost container. Once the outermost container has been determined, it compares that object (containers are objects) to the object that used the key. If the user of the key doesn't match the outermost container for the key, then it prevents you from attempting to use the key at all.

When attempting to copy a key, this piece of code is checked first:

Code: Select all

  integer Q65M = 0x01;
  if(hasObjVar(this, "whatIUnlock"))
  {
    barkTo(this, user, "What shall I use this key on?");
    Q65M = 0x00;
  }
  else
  {
    barkTo(this, user, "This is a key blank.  Which key would you like to make a copy of?");
    Q65M = 0x01;
  }
  targetObj(user, this);
  return(0x00);
}
This code checks to see if the key actually unlocks anything yet. If so, a flag is set (Q65M) to indicate that it does indeed unlock something. Otherwise, the flag is set differently. Finally, the keyholder is given a target cursor to target the object to unlock or copy.

Upon targeting the object, this piece of code is executed:

Code: Select all

#on targetobj(object user, object usedon)
{
  if(!Q4CD(this, user))
  {
    return(0x00);
  }
The above code is identical to that which is executed when the key is first used. Thus, if the target key is also not in the pack of the player who is attempting to copy it, the same message is given.

Finally, extending forward from the demo, no recorded changes exist (that I could find) that shows any difference in the way that key copying or use worked during T2A. I hope this clarifies the issue.

Re: Keyring Discussion Question

Posted: Wed Jun 08, 2011 6:26 am
by Mens Rea
Okay then UOSA is inaccurate because you can copy keys which are not in your pack. Glad I could help.

Re: Keyring Discussion Question

Posted: Wed Jun 08, 2011 7:58 am
by Hicha
Kaivan, how might one acquire a decompiled version of UO?

Re: Keyring Discussion Question

Posted: Wed Jun 08, 2011 9:05 am
by Mens Rea
Hicha wrote:Kaivan, how might one acquire a decompiled version of UO?
smelt it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! whenever i delete i file i say smelt it

Re: Keyring Discussion Question

Posted: Wed Jun 08, 2011 7:32 pm
by Blaise
Mens Rea wrote:
Hicha wrote:Kaivan, how might one acquire a decompiled version of UO?
smelt it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! whenever i delete i file i say smelt it
Quick, someone draft me up an MSI that I can push out on the network.
I need it to change all Recycle Bins to small forges (icon included) and all dialogue references for 'delete' to be changed to 'smelt'.

Re: Keyring Discussion Question

Posted: Wed Jun 08, 2011 10:08 pm
by Mens Rea
me too plz

Re: Keyring Discussion Question

Posted: Wed Jun 08, 2011 11:41 pm
by Kaivan
Hicha wrote:Kaivan, how might one acquire a decompiled version of UO?
In order to decompile the demo, you'll need the following resources:

First, download the UO Demo.
Second, download the uodemo.dat extractor.
Finally, download the Mass M Decompiler

Extract the demo to any directory (preferably it's own). You can install the demo if you wish, but we don't need to in order to decompile it. Second, unzip the uodemo.dat extractor to the same directory that you stored the demo files in. The demo extractor is a command line program that allows you to decrypt and dump the files stored in the uodemo.dat file. Fire up the extractor and extract the contents of the uodemo.dat file to the directory that you're currently working in. The result should be a folder labeled .rundir that contains all of the files from the .dat file. Finally, extract the Mass M Decompiler and open the .exe file (it will be located in Mass M Decompiler (Publish 7)\Mass M Decompiler\bin\Release). Point the program to the folder that contains all of the scripts for the demo. That folder will be located in the .rundir folder produced by the .dat extractor. Click Mass Decompile, wait for the program to finish decompiling all of the scripts, and then click Dump All. This will create a folder inside the .rundir directory called scripts.c where all of the decompiled script files are contained. From here you can open the .c files with your program of choice and read the scripts themselves.

Note: The scripts themselves are written in a custom scripting language built for UO, and they also suffer from obfuscation as well, so it may be difficult to read at first. Second, the extracted scripts will likely look different from the example sections that I posted because the decompiling method for the scripts has changed over time from when I decompiled mine, but the raw information is the same. Finally, it is important to note that this decompilation only includes the scripts. All other information is either readable without any extra work, or is stored in the hidden server .exe that runs when the demo is running. The information contained therein is much more difficult to ascertain and is an area where Batlin is putting in a great deal of work.

Re: Keyring Discussion Question

Posted: Wed Jun 22, 2011 2:04 am
by GuardianKnight
I chopped my own wooden house door off in t2a. Let's add that.