Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

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.

Reply
 
Thread Tools Display Modes
Old 09-26-2007, 02:06 AM   #1 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default CEO's Yet Another Arya Addon Generator (YAAAG) RC1/RC2

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();
		}
	}
And here's sample of how the test Addon's components are created and identified:



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
They are the Static ID, x/y/z displacements.

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
They are the Static ID, x/y/z displacements, Hue, and LightSource (-1 if none).

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
Same order as the complex table, with the Name field added on the end.


Works with both RC1 and RC2, simply remove or comment out the
Code:
#define RC2
line near the top of the code to switch to Arrays vs. List<> (RC2) code.
Attached Files
File Type: cs AddonGenerator.cs (33.8 KB, 526 views)
__________________
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.
CEO is offline   Reply With Quote
Old 09-26-2007, 02:51 AM   #2 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 32
Posts: 1,038
Send a message via MSN to Liacs
Default

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!
Liacs is offline   Reply With Quote
Old 09-26-2007, 03:15 AM   #3 (permalink)
Forum Novice
 
Varchild's Avatar
 
Join Date: Jan 2004
Location: Gorizia - Italy
Age: 29
Posts: 221
Send a message via ICQ to Varchild Send a message via MSN to Varchild
Default

Fantastic!

But... has RC2 been realeased?
__________________
Dies Irę, dies illa
solvet sęclum in favilla

Developer only on
Midgard Shard
Varchild is offline   Reply With Quote
Old 09-26-2007, 05:28 AM   #4 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 32
Posts: 1,038
Send a message via MSN to Liacs
Default

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!
Liacs is offline   Reply With Quote
Old 09-26-2007, 06:40 AM   #5 (permalink)
Forum Novice
 
Hotshot's Avatar
 
Join Date: Jan 2006
Posts: 221
Default

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.
Hotshot is offline   Reply With Quote
Old 09-26-2007, 07:16 AM   #6 (permalink)
Forum Novice
 
Hotshot's Avatar
 
Join Date: Jan 2006
Posts: 221
Default

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.
Hotshot is offline   Reply With Quote
Old 09-26-2007, 08:19 AM   #7 (permalink)
Forum Master
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by Hotshot View Post
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 must be running RC1
Quote:
Works with both RC1 and RC2, simply remove or comment out the
Code:
#define RC2
line near the top of the code to switch to Arrays vs. List<> (RC2) code.
__________________
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
ArteGordon is offline   Reply With Quote
Old 09-26-2007, 08:58 AM   #8 (permalink)
Forum Novice
 
Hotshot's Avatar
 
Join Date: Jan 2006
Posts: 221
Default

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.
Hotshot is offline   Reply With Quote
Old 09-26-2007, 10:15 AM   #9 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Quote:
Originally Posted by Liacs View Post
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!
Hmm, I like to coord thing too, I must of copied a different AddOn from the one I used in the picture though. Item 20, doesn't match up with where it should be! lol.. I'll fix that...

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.
CEO is offline   Reply With Quote
Old 09-26-2007, 10:51 AM   #10 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Updated to 1.1.
  • Converted AddComplexComponent to private static. (new code generated reflected in original post)

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.
CEO is offline   Reply With Quote
Old 09-26-2007, 12:00 PM   #11 (permalink)
Forum Expert
 
Hammerhand's Avatar
 
Join Date: Jan 2006
Location: Look behind you....
Age: 45
Posts: 1,929
Default

*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.
Hammerhand is offline   Reply With Quote
Old 09-26-2007, 01:30 PM   #12 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Quote:
Originally Posted by Hammerhand View Post
*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)*
Yeah, it wasn't in the version I sent to you. I worked on that and other options/gump later.
__________________
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
CEO is offline   Reply With Quote
Old 09-26-2007, 01:32 PM   #13 (permalink)
Forum Expert
 
stormwolff's Avatar
 
Join Date: Nov 2003
Location: The Internet
Age: 30
Posts: 3,531
Default

Another great addition, thanks CEO
stormwolff is offline   Reply With Quote
Old 09-26-2007, 01:39 PM   #14 (permalink)
Forum Novice
 
Join Date: Jun 2006
Posts: 187
Default

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 );
Also, for your callbacks, you use:
Code:
private static void PickerCallback(Mobile from, Map map, Point3D start, Point3D end, object state)
which is proper, but instead of state being an array of objects which need to be casted, you could make state an object with the array components as properties. This would mean that you do not need to make uneeded casting and try/catches.

It would look similar to.

Code:
PickerArguments pickargs = (PickerArguments)state;

bool getStatics = pickargs.GetStatics;
bool getItems = pickargs.GetItems;
...
- Those are my few thoughts/opinions, enjoy.
__________________
Record for the sentence that makes the least sense - Go HERE
Kamron is offline   Reply With Quote
Old 09-26-2007, 02:00 PM   #15 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

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
CEO is offline   Reply With Quote
Old 09-26-2007, 04:22 PM   #16 (permalink)
Forum Novice
 
nadious's Avatar
 
Join Date: Jan 2003
Location: (Near) Atlanta, GA
Posts: 527
Default

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.
nadious is offline   Reply With Quote
Old 09-26-2007, 05:15 PM   #17 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Quote:
Originally Posted by nadious View Post
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.
Hmm, first I've heard about that, I'd need the errors generated. PM me a sample. Possibly something named the same, though I think that would be unlikely. I don't use that auction system and I couldn't think of a reason why they would conflict. It's probably something else conflicting, hues shouldn't make any difference.

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
CEO is offline   Reply With Quote
Old 09-26-2007, 07:30 PM   #18 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: Calgary Alberta Canada
Age: 48
Posts: 376
Send a message via ICQ to Crowley62 Send a message via MSN to Crowley62
Default

Wow great job thx. Did you give up on adding to your slot machines and on the poker? I sure hope not
__________________
[url]http://crowskingdom.com/[url]
Crowley62 is online now   Reply With Quote
Old 09-26-2007, 07:47 PM   #19 (permalink)
CEO
Forum Novice
 
CEO's Avatar
 
Join Date: Jun 2004
Age: 49
Posts: 808
Default

Quote:
Originally Posted by Crowley62 View Post
Wow great job thx. Did you give up on adding to your slot machines and on the poker? I sure hope not
Already did Video Blackjack, just haven't released it yet, its been in extended beta on our shard for a few months now. 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.
CEO is offline   Reply With Quote
Old 09-27-2007, 12:39 AM   #20 (permalink)
Forum Novice
 
Join Date: Jul 2005
Posts: 138
Default

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
Yiffi is offline   Reply With Quote
Old 09-27-2007, 01:40 AM   #21 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 32
Posts: 1,038
Send a message via MSN to Liacs
Default

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!
Liacs is offline   Reply With Quote
Old 10-11-2007, 09:08 AM   #22 (permalink)
Newbie
 
Join Date: Sep 2005
Age: 40
Posts: 45
Question Having a slight issue

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.
Red_Satiin is offline   Reply With Quote
Old 10-11-2007, 10:08 AM   #23 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 32
Posts: 1,038
Send a message via MSN to Liacs
Default

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!
Liacs is offline   Reply With Quote
Old 10-11-2007, 11:47 AM   #24 (permalink)
Master of the Internet
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 12,209
Send a message via Yahoo to Lord_Greywolf
Default

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 ..... :)
Lord_Greywolf is online now   Reply With Quote
Old 10-11-2007, 12:09 PM   #25 (permalink)
Forum Expert
 
Hammerhand's Avatar
 
Join Date: Jan 2006
Location: Look behind you....
Age: 45
Posts: 1,929
Default

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.
Hammerhand is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5