DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • July 18, 2018, 08:35:07 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Specialties converted into modules  (Read 6323 times)
0 Members and 1 Guest are viewing this topic.
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« on: November 27, 2004, 02:03:41 AM »

I thougt a bit about turning the specialties into modules, too, as it has been done with the races. I thought it possible and not too difficult, until I saw that everywhere in the source is some little reference to the specialties... so I went ahead and tried to change all these passages and make the specialties a module...

I think, it's at least working now, but for that I had to do one change to the database field. The field "account.specialty" is now no INT(4) but VARCHAR(2)... all other changes to the DB are done from the module itself...

Please have a look at this and tell me if I have overseen anything, where the bugs are and what could be done better...

Thanks

PS: The changed files (including the darkarts-module) can be found here: http://beta.lotgd.de/downloads/specialties.zip
Logged

Running for more than three years now:
Kendaer
Guest
« Reply #1 on: November 27, 2004, 12:46:42 PM »

Chris,

You are the second person to attempt this (just so you know).

The first was Dut and he made a fair amount of progress on it, but I didn't like some things about the way he broke things down (they felt kludgey).  I'll take a look at your attempt later today if I have time.
Logged
Kendaer
Guest
« Reply #2 on: November 27, 2004, 12:56:59 PM »

Also, not sure if this is an oversight or not, but it looks as if you only converted the Dark Arts specialty. (at least that's the only one included in the zip file).

This probably hoses folks until the others would be converted over.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #3 on: November 28, 2004, 12:15:54 AM »

I just finished converting the two other special skills and added a new one for testing purposes... It might need some balancing...

Download link stays the same for the complete package with now all four skills

Please delete the initial darkarts file as the filename has changed! I experienced, that putting "specialty" in front of each filename leads to a too long database entry which simply got cut off.

Logged

Running for more than three years now:
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #4 on: December 03, 2004, 10:38:08 PM »

your site is blocked from my work.  i really wish you would upload here.
Logged

XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #5 on: December 03, 2004, 11:38:04 PM »

your site is blocked from my work.  i really wish you would upload here.

It's up here Smiley

http://dragonprime.net/users/XChrisX/specialties.zip
Logged

Running for more than three years now:
Kendaer
Guest
« Reply #6 on: December 04, 2004, 11:39:59 AM »

I'm actually 90% of the way towards integrating these into code based on a cross between what you had done and what Dut had done in the past.

I didn't actually end up using your code or Dut's though I tended to use your hook names since I liked them better, so the copyright on the modules that I created are MightyE (since he wrote the original skills code and this is just (imho) a repackaging of that code in a nicer format -- One of the nice things about being a primary author is you can assign copyrights too Smiley)

Anyway, I'll take a look at your newest version to see if you caught anything I missed, but there were also some things you missed pretty badly (like integration with some of the forest events -- I had to update foilwench, the old man (when he gives you extra dark arts) and lonestrider (where he will teach thieves extra theivery).

Anyway, you should expect to see this in the next pre-release which I hope to have out sometime this weekend or Monday.
Logged
Sneakabout
Member
Captain of the Guard
***
Offline Offline

Posts: 137


Fear the Sneak!


View Profile WWW
« Reply #7 on: December 04, 2004, 12:09:38 PM »

Cool, I guess that means that we'll have to redo modules incrementing speciality, but the potential for new stuff will be great.
Logged

Admin on Central. Founder of the BAD Clan.
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #8 on: December 04, 2004, 12:11:53 PM »

I didn't intend  to change these events, because I first wanted to know if there were any other, severe bugs in it...

What still should be considered is a possibility to set all **artuses to "0".

Maybe you have an idea!?
Logged

Running for more than three years now:
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #9 on: December 04, 2004, 12:13:41 PM »

no, you won't have to recode these modules, as the rewritten lib for such things requires the specialty-module to handle this by itself... (if kendaer will use it this way...)

so the copyright on the modules that I created are MightyE (since he wrote the original skills code and this is just (imho) a repackaging of that code in a nicer format -- One of the nice things about being a primary author is you can assign copyrights too Smiley)

In fact it wasn't really more than that... Wink

just cut & paste... and putting a modulehook everywhere, where I cut something...

 Tongue


--------------
Engineer's Invoice
--------------

Pos. 1) Chalk cross -> 10 $
Pos. 2)  Know, where the cross belongs to -> 49.900 $

*lol*
« Last Edit: December 04, 2004, 12:34:03 PM by XChrisX » Logged

Running for more than three years now:
Kendaer
Guest
« Reply #10 on: December 05, 2004, 11:08:59 PM »

Quote
no, you won't have to recode these modules, as the rewritten lib for such things requires the specialty-module to handle this by itself... (if kendaer will use it this way...)
Yes, in fact you will need to do recoding.

Most of the modules test things like 'If ($session['user']['specialty']==2)' (or something similarly).

All of those need to be changed to
if (is_module_active("specialty<name>") && $session['user']['specialty']=='<specialtycode>')

Also Chris, some of the things you did (adding additional fields to the account table for instance) is a no-no.  I recoded them to *correctly* use module prefs as they should.

You can set all artuses to 0 if you want, but I don't intend to create a way to do it as I don't see the reason for it.  I do need to add one thing that you just reminded me of though.. When someone DKs there needs to be a dk hook in the module to wipe their art skills and art uses.  Thanks.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #11 on: December 05, 2004, 11:18:53 PM »

I thought of the function "increment_specialty()"... I don't know, how you are going to fix this, but I think you will find a soulution, where the function itself will stay the same, but the technique behind changes...

That's what I meant with "you won't have to recode these modules". I'm sorry for being not quite clear on that point.
Logged

Running for more than three years now:
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #12 on: December 05, 2004, 11:30:40 PM »

You could go about, and recode the increment_specialty.php. For now, it just goes after the 3 different ones.

You could do, in the modules (AKA the specialty ones):

Have some kind of defined:
Color Codes
Names

That could easily be fetched by the increment_specialty()... then jsut rework the increment_specialty to fetch those values from the module.

Perhaps you had already thought about this.. or something...

Actually, just looking at the increment_specialty.php and it looks like Kendaer's thing he posted, would fit in. But, you would also need somekind of fetch, to gather all of the specialties.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Kendaer
Guest
« Reply #13 on: December 06, 2004, 08:07:44 PM »

increment_specialty was in fact recoded to work correctly with the new system.

However, as I pointed out, that is only *one* part of dealing with skills.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
30 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search