Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C#

C# C# Discussion

Reply
 
Thread Tools Display Modes
Old 03-03-2006, 07:52 PM   #1 (permalink)
Newbie
 
Join Date: Jan 2006
Posts: 25
Default UO specific C# programming

I know I could get a book on C#, but I was wondering about UO specific objects, etc. I've read the description on how to create the 8 ball in the scripting forum, but I don't run my own UO shard, I was wondering where I could find a description on say making a blacksmithing script, all the commands I'd need to know, not just general C# ones.

I'm somewhat of a novice razor user, and some things I'd like to do is modify the use once option, so it only takes everything instead of clicking it twice, or perhaps just adding a new button called "take everything". And I wanted to make a script where it will automatically switch to a new set of tongs, which I wouldn't know how to do in razor, how it to set it to automatically switch to a new set.
randale is offline   Reply With Quote
Old 03-03-2006, 08:10 PM   #2 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,886
Default

Quote:
Originally Posted by randale
I know I could get a book on C#, but I was wondering about UO specific objects, etc. I've read the description on how to create the 8 ball in the scripting forum, but I don't run my own UO shard, I was wondering where I could find a description on say making a blacksmithing script, all the commands I'd need to know, not just general C# ones.
You would need a good c# book for the basics( Orielly's Learning C# ) then once you have the basics you can browse the docs that come with RunUO for the methods for each class. Also you can browse the scripts in the release section to see how things were done. I can just about gaurentee that anything you need to do has been done at least once somewhere.

Quote:
Originally Posted by randale
I'm somewhat of a novice razor user, and some things I'd like to do is modify the use once option, so it only takes everything instead of clicking it twice, or perhaps just adding a new button called "take everything". And I wanted to make a script where it will automatically switch to a new set of tongs, which I wouldn't know how to do in razor, how it to set it to automatically switch to a new set.
as far as I know it would just check to see if the item still existed then if it didnt , find a new one. You do realize Scripting and Razor do not have anything in common
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 03-03-2006, 11:48 PM   #3 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

All of the UO specific knowledge, of all the developers, comes from hunkering down and actually reading the code. Truly, I'm not kidding. The code is somewhat lacking in comments. This means you'll actually have to read for content. It's to the point where it serves a purpose, in a way: only people who are really willing to try very hard to understand the internals ever actually learn them. This prequalifes the limited number of individuals the core devs will likely interact with.

C//
Courageous is offline   Reply With Quote
Old 03-03-2006, 11:48 PM   #4 (permalink)
Newbie
 
Join Date: Jan 2006
Posts: 25
Default

Quote:
Originally Posted by Sorious
You would need a good c# book for the basics( Orielly's Learning C# ) then once you have the basics you can browse the docs that come with RunUO for the methods for each class. Also you can browse the scripts in the release section to see how things were done. I can just about gaurentee that anything you need to do has been done at least once somewhere.

as far as I know it would just check to see if the item still existed then if it didnt , find a new one. You do realize Scripting and Razor do not have anything in common
Well, but you can edit razor to modify it, can't you?
randale is offline   Reply With Quote
Old 03-04-2006, 12:32 AM   #5 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,886
Default

Quote:
Originally Posted by randale
Well, but you can edit razor to modify it, can't you?
It is not open source, no.
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 03-04-2006, 07:05 AM   #6 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

Quote:
Originally Posted by Sorious
It is not open source, no.
And even if it were, you may not get very far unless you have a good amount of knowledge concerning C++.
Sep102 is offline   Reply With Quote
Old 03-05-2006, 07:48 PM   #7 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,886
Default

Quote:
Originally Posted by Sep102
And even if it were, you may not get very far unless you have a good amount of knowledge concerning C++.
Razor is written in C#
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 03-06-2006, 07:25 AM   #8 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
Default

Quote:
Originally Posted by randale
I know I could get a book on C#, but I was wondering about UO specific objects, etc. I've read the description on how to create the 8 ball in the scripting forum, but I don't run my own UO shard, I was wondering where I could find a description on say making a blacksmithing script, all the commands I'd need to know, not just general C# ones.

I'm somewhat of a novice razor user, and some things I'd like to do is modify the use once option, so it only takes everything instead of clicking it twice, or perhaps just adding a new button called "take everything". And I wanted to make a script where it will automatically switch to a new set of tongs, which I wouldn't know how to do in razor, how it to set it to automatically switch to a new set.
A razor macro could easily handle something like this. To make sure that I dont have to mess with double clickling new tools, my make last macro looks something like this

Double click the tool (by type)
wait for gump
click make last gump button
wait for gump
right click gump (close it)
wait 1 second

and then loop it, this will make sure that most of the time if your tool runs out of uses, then it will just find a new one. To make it a bit faster, right click on the wait for gumps and edit them to 5 or 10, that way it wont wait for the default 5 minutes if it cant find one.

And like Sorious said, Razor and RunUO scripting have nothing to do with eachother, so if you really wanted to write something of your own, you could write a program that uses Razor's API or use the Ultima SDK.
mordero is offline   Reply With Quote
Old 03-06-2006, 08:24 AM   #9 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by randale
I know I could get a book on C#, but I was wondering about UO specific objects, etc. I've read the description on how to create the 8 ball in the scripting forum, but I don't run my own UO shard, I was wondering where I could find a description on say making a blacksmithing script, all the commands I'd need to know, not just general C# ones.

I'm somewhat of a novice razor user, and some things I'd like to do is modify the use once option, so it only takes everything instead of clicking it twice, or perhaps just adding a new button called "take everything". And I wanted to make a script where it will automatically switch to a new set of tongs, which I wouldn't know how to do in razor, how it to set it to automatically switch to a new set.
Let me ask you something.
If you were the guy that teach a baby how to walk, would you teach him how to walk on a specific floor or would you teach him how to walk in general?
For example:
Would you teach him how to walk on a black colored floor and than teach him how to walk on white colored floor and then or red colored floor.... etc?
Or would you simply teach him how to walk in general and he'll be able to walk in all the floors?

Personaly I support the "teach him how to walk in general" method myself.

What you asked us to do is to teach you "how to walk in a RunUO floor" instead of teaching you "how to walk".
Just so you understand the comparison better: walking ==> c#.
You can learn c# and know RunUO or you can learn RunUO and won't know anything at all.

RunUO related example:
You can learn how to change items hue or you can learn how to change object property.
If you learn how to change the hue than you don't know how to change the itemid and you need to learn it as well.
On the other hand if you learn how to change object property than you already know that item is an object and hue is a property as well as weight, itemid and tons of other properties items have.
And if you learn how to change an objects property than you also know how to change players guild, kill count, young status....
Player is an object as well and it have tons of properties.

I suggest that you start to read this c# book because it makes no sense to me to learn how to walk on specific floor each time instead of learning how to walk on every type of floor.
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 03-06-2006, 09:12 PM   #10 (permalink)
The noob formerly known as Jakob
 
Serp's Avatar
 
Join Date: Jan 2005
Posts: 316
Default

Quote:
Originally Posted by daat99
..snip..
Wise words! :-)
Serp is offline   Reply With Quote
Old 03-06-2006, 09:28 PM   #11 (permalink)
Forum Expert
 
BeneathTheStars's Avatar
 
Join Date: Jul 2005
Location: (South)Tip o' Texas
Posts: 1,294
Send a message via AIM to BeneathTheStars Send a message via MSN to BeneathTheStars
Default

Quote:
Originally Posted by daat99
you can learn RunUO and won't know anything at all.
Made that mistake, now i practicly have to learn c# all over to script anything outside runuo. :/
BeneathTheStars is offline   Reply With Quote
Old 03-07-2006, 02:12 PM   #12 (permalink)
 
Join Date: Feb 2006
Location: Wisconsin
Age: 30
Posts: 23
Send a message via ICQ to astrocreep2k
Default

I couldn’t agree more. And here is another issue with code hackers (as I like to call them). Someone who does not truly understand the development platform, might find it very easy to modify things to there liking. The problem with this is:

A. They may break something without realizing it, since they do not fully understand how it relates to other things within the code. And in some cases the bugs can not be identified right away.

B. Without the ability to see the project as a whole, they create patched, non standardized code. If this gets into the code base, and allot of people contribute in this manner, it can make for some really ugly code and eventual design flaws.

Don't get me wrong. At one time I was a hacker, and I believe this process helped me learn what I know today. But I have seen a few other open source projects that quickly inherited major stability and scalability issues once more people became involved.

I guess all I am trying to say in this rant is, if you plan to contribute, learn the language, and make sure you understand the basics of how everything works. Simply changing values and adding snippets of code is not always the solution.

</EORANT>
astrocreep2k is offline   Reply With Quote
Old 03-07-2006, 04:04 PM   #13 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by astrocreep2k
I couldn’t agree more. And here is another issue with code hackers (as I like to call them). Someone who does not truly understand the development platform, might find it very easy to modify things to there liking. The problem with this is:

A. They may break something without realizing it, since they do not fully understand how it relates to other things within the code. And in some cases the bugs can not be identified right away.

B. Without the ability to see the project as a whole, they create patched, non standardized code. If this gets into the code base, and allot of people contribute in this manner, it can make for some really ugly code and eventual design flaws.

Don't get me wrong. At one time I was a hacker, and I believe this process helped me learn what I know today. But I have seen a few other open source projects that quickly inherited major stability and scalability issues once more people became involved.

I guess all I am trying to say in this rant is, if you plan to contribute, learn the language, and make sure you understand the basics of how everything works. Simply changing values and adding snippets of code is not always the solution.

</EORANT>

your point B sounds like what happened with alot of MUDs
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline   Reply With Quote
Old 03-07-2006, 06:16 PM   #14 (permalink)
Administrator
 
Zippy's Avatar
 
Join Date: Aug 2002
Location: Baltimore, MD
Age: 25
Posts: 4,870
Default

Quote:
Originally Posted by Sorious
Razor is written in C#
Razor is 64 .cs files totaling 32,445 lines and 25 .c/.cpp/h files totaling 6,415 lines.
__________________
Zippy, Razor Creator and RunUO Core Developer
The RunUO Software Team

"Intuition, like a flash of lightning, lasts only for a second. It generally comes when one is tormented by a difficult decipherment and when one reviews in his mind the fruitless experiments already tried. Suddenly the light breaks through and one finds after a few minutes what previous days of labor were unable to reveal."
~The Cryptonomicon

Zippy is offline   Reply With Quote
Old 03-08-2006, 04:05 AM   #15 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

Quote:
Originally Posted by Zippy
Razor is 64 .cs files totaling 32,445 lines and 25 .c/.cpp/h files totaling 6,415 lines.
Written using only C/C++ or C++/CLI (or possibly Managed C++)? Just a bit curious.

Last edited by Sep102; 03-08-2006 at 04:16 AM.
Sep102 is offline   Reply With Quote
Old 03-16-2006, 04:11 PM   #16 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,886
Default

Quote:
Originally Posted by Zippy
Razor is 64 .cs files totaling 32,445 lines and 25 .c/.cpp/h files totaling 6,415 lines.
I know, but still my point stands it was written in c# mainly and not just C++
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 03-16-2006, 11:28 PM   #17 (permalink)
Administrator
 
Zippy's Avatar
 
Join Date: Aug 2002
Location: Baltimore, MD
Age: 25
Posts: 4,870
Default

Quote:
Originally Posted by Sep102
Written using only C/C++ or C++/CLI (or possibly Managed C++)? Just a bit curious.
Only C/C++. I hate managed C++.
__________________
Zippy, Razor Creator and RunUO Core Developer
The RunUO Software Team

"Intuition, like a flash of lightning, lasts only for a second. It generally comes when one is tormented by a difficult decipherment and when one reviews in his mind the fruitless experiments already tried. Suddenly the light breaks through and one finds after a few minutes what previous days of labor were unable to reveal."
~The Cryptonomicon

Zippy is offline   Reply With Quote
Old 03-16-2006, 11:43 PM   #18 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

Quote:
Originally Posted by Zippy
Only C/C++. I hate managed C++.
I agree with you, Managed C++ was a joke. Thankfully it's been displaced by C++/CLI which doesn't seem too bad, at the very least, I could imagine much worse. If you haven't checked it out yet, I would recommend at least looking at it, they've changed a good deal of their original design from what I've heard and seen.
Sep102 is offline   Reply With Quote
Old 04-13-2006, 01:09 AM   #19 (permalink)
Forum Expert
 
Sparkin's Avatar
 
Join Date: Dec 2005
Location: Missouri , USA
Age: 38
Posts: 256
Red face

Nice Daat... I read that well and so wanna learn to walk...
Im still Crawling and loving your work and the work of others that have helped our shard run so nice...

Keep up the good works

Sparkin
Sparkin is offline   Reply With Quote
Old 09-10-2006, 07:28 PM   #20 (permalink)
Forum Newbie
 
Join Date: May 2005
Age: 59
Posts: 3
Default Still Trying

and im stell trying to get my shard online--after a year--guess i well never get one online??
Kingsmity 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 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5