|
||
|
|||||||
| Custom Script Releases This forum is where you can release your custom scripts for other users to use. Please note: By releasing your scripts here you are submitting them to the public and as such agree to publish them under the GPL licensing terms. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
After taking a look at Hammer's nice waterfall addons I decided to checkout Arya's initial work (brilliant!) and tinker around with it. I pretty much ended up rewriting nearly all of it and also reworking the Addon code that's generated to be more efficient by using static tables. The Gump is also reworked with the ability to export statics, items(new), and tiles each having their own unique ID range(included or excluded). Basically you can now check out a player's artwork in their house and easily create an Addon from it. Also for those that like to create an Addon and check that it's right you also now can generate a test Addon on-the-fly and place it without having to recompile to see it, which should be a great time saving tool! This test Addon has all the components identified by where they are in the generated commented code so you can easily tinker with it. For example here's what Hammer's SmallWaterfallEastAddon looks like with new code(Just the AddOn part):
Code:
public class SmallWaterfallEastAddon : BaseAddon
{
private static int[,] m_AddOnSimpleComponents = new int[,] {
{6039, 0, -1, 1}, {6039, 1, -1, 1}, {4944, -1, -1, 1}// 1 2 3
, {4932, -2, -1, 1}, {4958, -2, -1, 5}, {4959, -1, -1, 1}// 4 5 6
, {4960, 0, -1, 1}, {4963, 0, -1, 3}, {4967, 1, -1, 3}// 7 8 9
, {4970, 1, -1, 2}, {4945, -1, -2, 1}, {4973, 2, -1, 5}// 10 11 12
, {4963, 2, -1, 1}, {6039, 2, -1, 1}, {4967, 3, -1, 3}// 13 14 15
, {4970, 3, -1, 1}, {13422, 1, 0, 2}, {13422, 1, 1, 2}// 16 17 18
, {13555, -1, 1, 1}, {13555, -1, 0, 1}, {6002, -3, 1, 2}// 19 20 21
, {6006, -2, 0, 3}, {4956, -3, 0, 5}, {4963, -1, 0, 14}// 22 23 24
, {13451, 1, 0, 3}, {6009, 3, 0, 3}, {4963, 3, 1, 3}// 25 26 27
, {13422, 2, 1, 2}, {13422, 2, 0, 2}, {3248, 3, 0, 8}// 28 29 30
, {13573, 0, 1, 1}, {13573, 0, 0, 1}, {4943, -3, 3, 1}// 31 32 35
, {4944, -2, 3, 1}, {13422, 1, 2, 2}, {13555, -1, 2, 1}// 36 37 38
, {4959, -1, 3, 9}, {4960, 0, 3, 9}, {6002, -2, 2, 5}// 39 40 41
, {4963, 0, 3, 1}, {6001, 1, 3, 1}, {4962, -1, 3, 1}// 42 43 44
, {4963, -2, 2, 1}, {4970, -1, 3, 19}, {6001, -1, 2, 20}// 45 46 47
, {4967, 0, 3, 1}, {3219, -1, 3, 14}, {4967, 3, 2, 3}// 48 49 50
, {4970, 3, 3, 7}, {4967, 3, 3, 7}, {13422, 2, 2, 2}// 51 52 53
, {4962, 2, 3, 2}, {4963, 3, 3, 2}, {13573, 0, 2, 1}// 54 55 56
};
private static int[,] m_AddOnComplexComponents = new int[,] {
{6010, -3, 0, 0, 1885, -1 }, {4967, -1, 1, 19, 1891, -1 }// 33 34
};
public override BaseAddonDeed Deed
{
get
{
return new SmallWaterfallEastAddonDeed();
}
}
[ Constructable ]
public SmallWaterfallEastAddon()
{
for (int i = 0; i < m_AddOnSimpleComponents.Length / 4; i++)
AddComponent( new AddonComponent( m_AddOnSimpleComponents[i,0] ), m_AddOnSimpleComponents[i,1], m_AddOnSimpleComponents[i,2], m_AddOnSimpleComponents[i,3] );
for (int i = 0; i < m_AddOnComplexComponents.Length / 6; i++)
AddComplexComponent((BaseAddon)this, m_AddOnComplexComponents[i,0], m_AddOnComplexComponents[i,1], m_AddOnComplexComponents[i,2], m_AddOnComplexComponents[i,3], m_AddOnComplexComponents[i,4], m_AddOnComplexComponents[i,5] );
}
public SmallWaterfallEastAddon( Serial serial ) : base( serial )
{
}
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource)
{
AddComplexComponent(addon, item, xoffset, yoffset, zoffset, hue, lightsource, null);
}
private static void AddComplexComponent(BaseAddon addon, int item, int xoffset, int yoffset, int zoffset, int hue, int lightsource, string name)
{
AddonComponent ac;
ac = new AddonComponent(item);
if (name != null)
ac.Name = name;
if (hue != 0)
ac.Hue = hue;
if (lightsource != -1)
ac.Light = (LightType) lightsource;
addon.AddComponent(ac, xoffset, yoffset, zoffset);
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( 0 ); // Version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
The 1st number is the corresponding number of where it is in the commented code, the 2nd is its static ID and then its x/y/z displacement. See how quick you can find that component in the comment code. ![]() New gump: Each exported type by default falls within the standard static ID ranges with the checked values. To reverse ranges selection method simply uncheck it and only ID's that fall outside that range are selected for the Addon. Same goes for the Z axis, by default all Z values are included. By using a combo of includes/excludes and narrowed ranges you can ignore certain IDs that you don't want to include in your new Addon. The new Test&Gen button writes the Addon and pops up a target for you to place what you've just defined and IDing each component(see above). Note: When saving an Item in the Addon, it is turned into a Static. As a result no properties are carried over, sorry that's the way Addons work. About the table formats The m_AddOnSimpleComponents table is generated with 4 values per component. IE: Code:
{14284, 1, 2, 3}, {13573, 0, 0, 1}, {13573, 0, 1, 1}// 2 6 7
The m_AddOnComplexComponents table is generated with 6 values per component. IE: Code:
{6010, -3, 0, 0, 1885, -1 }, {4967, -1, 1, 19, 1891, -1 }// 5 20
In the case of a component that has a modified Name field, a single line is generated for each component, which will look something like this: Code:
AddComplexComponent( (BaseAddon) this, 3630, 4, 0, 0, 37, 2, "Red Ball" );// 1 Works with both RC1 and RC2, simply remove or comment out the Code:
#define RC2
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 10-12-2007 at 05:06 PM. |
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
|
wow! this is just perfect. I love that you can see the coordinates of the tiles.
BTW: Do you also have an addon2static? Thanks a lot!
__________________
;)My C# Bookshelf (carpented by Soultaker);) BTW: Please ask questions in the adequat forum and not on a private message! Otherwise nobody can learn from it!
|
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
|
It won't change a lot from the latest SVN, no?
![]()
__________________
;)My C# Bookshelf (carpented by Soultaker);) BTW: Please ask questions in the adequat forum and not on a private message! Otherwise nobody can learn from it!
|
|
|
|
|
|
#5 (permalink) |
|
Forum Novice
Join Date: Jan 2006
Posts: 221
|
cant wait to try this out and YES ! it will save alot of time with the test, great work. cant wait for that Awesome Blackjack machine *hint* lol. thanks for the awesome upgrade.
__________________
You Can Make a Good Living working for someone else, you can make a fortune working for yourself. |
|
|
|
|
|
#6 (permalink) |
|
Forum Novice
Join Date: Jan 2006
Posts: 221
|
well got a Error, I know its gotta be an easy fix.
any Ideas ? Errors: + Custom Scripts/AddonGenerator.cs: CS0029: Line 265: Cannot implicitly convert type 'System.Collections.ArrayLi st' to 'System.Collections.Generic.List<Server.Tile>' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again.
__________________
You Can Make a Good Living working for someone else, you can make a fortune working for yourself. |
|
|
|
|
|
#7 (permalink) | ||
|
Forum Master
Join Date: Aug 2003
Posts: 5,688
|
Quote:
Quote:
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. " For questions, information, and support for XmlSpawner and its addons, visit the XmlSpawner Support Forum |
||
|
|
|
|
|
#8 (permalink) |
|
Forum Novice
Join Date: Jan 2006
Posts: 221
|
Ahh see, got ahead of myself and missed that. Then after re-reading it after i posted, i seen my mistake. but thanks for quick response.
__________________
You Can Make a Good Living working for someone else, you can make a fortune working for yourself. |
|
|
|
|
|
#9 (permalink) | |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Quote:
Edit: There picture now matches where it should be. Item 35!
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 09-26-2007 at 10:22 AM. |
|
|
|
|
|
|
#10 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Updated to 1.1.
I've also added an explanation of the values in the tables in the original post for those of you that like to tinker with the Addon. ![]()
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 09-26-2007 at 11:09 AM. |
|
|
|
|
|
#11 (permalink) |
|
Forum Expert
Join Date: Jan 2006
Location: Look behind you....
Age: 45
Posts: 1,929
|
*grumble* You could have told me about that "no need to compile to check the addon" part when I was testing it for you. lol Or did you add that after? Oh well, no worries. Guess I'm gonna have to get back to creating new addons again.
*starts the thinking (ouch) process (owie, whimper)* ![]()
__________________
May you have the strength of eagles' wings, the faith and courage to fly to new heights, and the wisdom of the universe to carry you there. |
|
|
|
|
|
#12 (permalink) | |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Quote:
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx |
|
|
|
|
|
|
#14 (permalink) |
|
Forum Novice
Join Date: Jun 2006
Posts: 187
|
This is fairly practical, I like it.
A tip though for making the code a little simplier: the names here: {simplecomponentscode} {complexcomponentscode} {namedcomponentscode} could be replaced with numbers, such as {0} {1}, etc then you could use Code:
String.Format( m_Template, arg strings, go, here ); Code:
private static void PickerCallback(Mobile from, Map map, Point3D start, Point3D end, object state) It would look similar to. Code:
PickerArguments pickargs = (PickerArguments)state; bool getStatics = pickargs.GetStatics; bool getItems = pickargs.GetItems; ...
__________________
Record for the sentence that makes the least sense - Go HERE |
|
|
|
|
|
#15 (permalink) |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
I think using the template like it is now makes it easier to read as far as what is being replaced into the template (named strings) and where. Probably doesn't make a whole lot of difference for building the Addon itself.
As far as the callback stuff, that's from the original and I didn't really see a big reason to modify how that works except to make it larger for the new arguments. :P Thx for the feedback, good ideas.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx |
|
|
|
|
|
#16 (permalink) |
|
Forum Novice
Join Date: Jan 2003
Location: (Near) Atlanta, GA
Posts: 527
|
CEO,
I've noticed on this script (and another one... I think it was your Keno board) that I get errors that seem to conflict with Xantho's auction system. I don't have the codes right in front of me (I could generate them if needed...) but it has a LONG list of problems with 'hues.' Just curious if anyone else has made mention of this problem before to you? I know without the console report, it's hard to really say.... I'll try to see if I can't get that info you. Btw, our Casino is HOPP'N thanks to your Slot Machines. ![]() |
|
|
|
|
|
#17 (permalink) | |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Quote:
You're welcome regarding the slots, it's a great gold sink! ![]()
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx |
|
|
|
|
|
|
#19 (permalink) | |
|
Forum Novice
Join Date: Jun 2004
Age: 49
Posts: 808
|
Quote:
I'm about 1/5th done with Video Poker. Then will probably do Texas Hold'em if the one that I've heard about hasn't been released or no one else has done it. I hate re-inventing something that's already been done and works well though, so I hope maybe they can see fit to release theirs as they've had it for quite awhile now and they have nothing to worry about shard competition since they're defacto the best anyways! I have a couple of new themes in mind for the slots, but have been busy with other stuff.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx Last edited by CEO; 10-01-2007 at 10:11 AM. |
|
|
|
|
|
|
#20 (permalink) |
|
Forum Novice
Join Date: Jul 2005
Posts: 138
|
Thank you very much CEO it looks like a great update/remake of a well loved script. I will be using this a lot.
![]()
__________________
~Visionary Kingdom~ Shard Owner Scripts: Player Vendor Search Class Titles Well Addons |
|
|
|
|
|
#21 (permalink) |
|
Forum Expert
|
I just tried it.... and it is just fantastic! THanks again for your work, CEO!
__________________
;)My C# Bookshelf (carpented by Soultaker);) BTW: Please ask questions in the adequat forum and not on a private message! Otherwise nobody can learn from it!
|
|
|
|
|
|
#22 (permalink) |
|
Newbie
Join Date: Sep 2005
Age: 40
Posts: 45
|
I am very new to this whole addon gen thing and I may be missing something that is right in front of my face, but I can't seem to get the entire addon into the deed. It is a large stone fireplace and sometimes I get 8 components sometimes 32 and once I got 41! (there are 42) I have removed everything from the field of vision and targeted the uppermost lefthand corner and the bottom-most righthand corner (I can't select anything any larger) and still don't get the entire thing. (I have by the way, targeted all the places in between those 2 extremes) And it doesn't seem to matter, I get different results when I target the same places.
![]() Has anyone else experienced this? Do you have any suggestions? I enjoy the deco and love to build it, but the scripting is more than I can handle. (except for the simple projects) The addon generator is my only hope. Thanks for any small words of wisdom. To be challenged is inevitable, to quit is unthinkable. |
|
|
|
|
|
#23 (permalink) |
|
Forum Expert
|
Sorry can't help you there, but I found out that you can't freeze stacked items. It will always stay one item only in the addon.
__________________
;)My C# Bookshelf (carpented by Soultaker);) BTW: Please ask questions in the adequat forum and not on a private message! Otherwise nobody can learn from it!
|
|
|
|
|
|
#24 (permalink) |
|
Master of the Internet
|
try lower left corner to upper right corner
and question - does this still retain the colors like the old one did - i saw a thing for named components - and that is one thing i hated doing by hand afterwards before, so this woulod be great for that, but i did not notice if it retained colors or not?
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#25 (permalink) |
|
Forum Expert
Join Date: Jan 2006
Location: Look behind you....
Age: 45
Posts: 1,929
|
It retains both the hues & names you may add in. And so far not one sign of any of the originals duplications. CEO done did good.
![]()
__________________
May you have the strength of eagles' wings, the faith and courage to fly to new heights, and the wisdom of the universe to carry you there. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|