Page 1 of 1

How do i get scripts pre-made from different shards lol?

Posted: Thu Mar 24, 2005 3:55 am
by Omega3
I am sooooo new at this stuff its not even funny lol. I just want somethings to be made more clearly for my own understanding.

If there is a site that shows word for word instructions on using the .dnf/.js/ files that would be great. If there is a site that i can get scripts that are already made like token system/wand of travel/and a concept on how the heck every uo game i see has built up banks and teleporters around it with different colors associated to them. I mean is there a nice drag and drop program that allows me to just click on say a tree copy it color it and then rename it easier.

I am probably just stupid but I need more understanding on how everything works exactly. I am not a scripter by anymeans however i do follow most things on a script just do not understand the id=0x0f6c say for a blue moongate it wont let me move it after i put it down and i cannot seem to do the 'dye while it is on the ground. Accomplice doesn't seem to work with UOX3 full version with some of the things it has on that menu bar.

If its not to much trouble i would just like to be able to take some already premade scripts and just download them and let them run and maybe later changing spawn timers,Npc movements etc. But for now i just was hoping that there was an easier way for lessor more unfortunate souls without any prior knowledge of scripting to work.

Also I tried to make a wand of fire, I went and copied a wand script deleted all the other wands cept for one and remade it to like 0x0022 as an id so i could access that exact wand only when i brought up the admin tools while playing it only showed the basic icons of wands and still only 4 wands? How do i make new items i know i have half of it right as far as the copying part I just do not get the rest of how to make it work. I also when making it can rename it ingame but i don't see where to add like Artifact rarity 11 Dex bonus's etc on the item to make it a rare new item.

When i tried to make a moongate skill gainer it only showed up the dex/int/str not the skills that actually change. Although i was not in my second user account and only in my admin if that makes a difference. Okay enough for now sorry to sound stupid again and thanks for the help :) Omega3 Noobified User

Posted: Thu Mar 24, 2005 5:15 pm
by Xuri
First of all, please forgive me for editing your post; I just added some extra paragraphs to make it a bit easier to read =)

Hm. I don't think we explain how the DFN-system/JS engine "work" anywhere, actually. Should probably do something about that. Heh. We've got the syntax usage and overview of the JS Engine on the docs page (here's a shortcut), but nothing that explains the basics :P I'll try though:

The DFNs are simply "definition-files" for UOX3 - i.e. their purpose is simply to define various properties and values for items, npcs, regions, etc. You want to add a new item (not a one-shot item, which you can add/edit ingame, but one you want to use regulary), you either copy & paste an item from one of the .dfn files in DFNDATA\ITEMS\, into a custom .dfn file in the same folder (or subfolder) or into an existing .dfn file. What you need to have in mind though is that all sections in these DFNs, be it items or NPCs or anything else, need to have their own unique section IDs. You cannot have two sections with section header [0x13FA] for instance. So if you add your own items, you can give them header ids like.. [bluelongsword] or [0x13FA-custom] or whatever, as long as it's a unique ID. If you do add your own custom items, like the wand you spoke of, then it won't automatically appear in the item-menu which you access by using 'ADD. You must in that case either add it to the menu yourself (ItemMenu.dfn holds the menu-structure, while ItemMenu.bulk.dfn holds the actual items you can add), or add it directly ingame using the 'ADD ITEM my-item-id command. Like 'ADD ITEM bluelongsword, for using an example mentioned above. Stuff like artifact rarity isn't supported in UOX3 yet, by the way.

The JS files are scripts with events which can trigger for whichever item/npc the scripts are attached to. These JavaScripts are all registered initially in JS\jse_fileassociations.scp in the form of SCRIPTID=path-to-script. These scriptids have to be unique. For instance, take the line in this file which says 131=skill/tailoring/scissors.js. Script ID 131, points to scissors.js, which handles all the functions a scissor should have, like cutting cloth to bandages, shearing sheep, etc. Then in JS\jse_objectassociations.scp script 131 is assigned to all scissors through the lines

Code: Select all

0x0f9e=131
0x0f9f=131
..where 0x0f9e and 0x0f9f are the item-IDs of the two scissor-objects available. There's also other ways of assigning JavaScripts to items, if you don't want ALL items of that item-ID to get the script (for instance if you have custom items which use the same item-ID as another item); You can either use the ingame command 'SETSCPTRIGGER # where # is the scriptID, or you can add an extra line to your custom item in the .dfns saying SCRIPT=# where # again is the scriptID.

The only site which contains downloadable scripts for UOX3 is currently this one, and are kept in the Script Vault forum. Hopefully this will be expanded as people write scripts and submit them. Basically you copy & paste the text of the script you want to use, save it as it's own .js file in your UOX3\JS\CUSTOM folder (or anywhere else under the JS\ folder, but more organized that way), add a scriptID in jse_fileassociations.scp, and assign the script to an item or character using either of hte methods mentioned above.

You can tweak many properties of item ingame using the 'TWEAK command, which gives you an ingame menu of things that can be changed on an item. To set up teleporters, as well as other stuff, check my UOX3 Guide at http://homefree.sensewave.com/~s107293/uoxguide/.

The id=0x0f6c for say, a blue moongate, defines that it actually is a blue moongate you're dealing with. It's basically what tells UO which graphics it should display, and in our case it's a blue moongate. For a list of such graphic IDs, check out InsideUO, a very nice program for this. Run it, click on the Artwork-section, find an object, click on it, and you'll see the item-id at the bottom of the InsideUO window, like this:
Model No. 26 (0x1A). I've highlighted the important part of that in yellow. That's the hex-id, which is used in the dfns to determine the graphics of any item.

If you're unable to move items after you put them down on the ground, make sure you're A) a character with GM privileges, and B) that you have ALLMOVE enabled. Do that by using the 'ALLMOVE ON command.

How exactly did you make the skillgain moongate? Check out section 2.09 of my UOX3 guide if you haven't already, called Advancement Objects. It deals with this subject.

Thanks Xuri

Posted: Sat Jul 01, 2006 2:57 pm
by Blackstone
I just wanted to ask if you would consider putting this post in your guide?

I was browsing around looking for a way to add more dynamic pet statues in game and this addresses that quite nicely.

Thanks for the hard work,
Blackstone