The Dawn Of Time
The Official Forums for the Dawn Of Time Mud Codebase
 
Log in Register FAQ Memberlist Search The Dawn Of Time Forum Index Goto the Official Dawn Website

[Solved] Fixing in-built mining

 
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Coding
View previous topic :: View next topic  
Author Message
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Wed Jan 20, 2016 3:08 pm    Post subject: [Solved] Fixing in-built mining Reply with quote

Code:
set skill auri mining 100
Mining skill on Auri changed from 0 to 100.
Done.

mine ore
What would you know about mining ore?


Room is set to a mine.

This is set on my pfile:

Code:
Sk 100 'mining'


Code:
sshow mining
Skill Name: mining
Category:      (undefined spdefensive spdefensive_enhancement
     spoffensive_enhancement spoffensive_spell sparea spenchantment
     sphealing spmovement spcreation spinformation spmisc realm sphere
     season sklanguage skweapon skoffensive_combat skdefensive_combat
     skhealing skmovement skmagic skmiscellaneous skdefault)
DamType:       (none bash pierce slash fire cold lightning acid poison
     negative  holy energy mental disease drowning light other harm charm
     sound illusion)
Flags:         [never_learnt_by_leveling must_be_set_to_get teach_spgain
     level_spgain study_spgain no_pctarget no_npctarget renamable
     no_interclass_teach new_improve_system no_gain
     no_negative_hp_at_affectoff magical_antipathy no_scribe no_prac]
Position:      (dead sleeping resting sitting kneeling fighting standing)
Mana: 0
Beats: 0 (0 seconds) - there are 4 beats per second.
Noun Damage: none
Race restriction: all races can get it.
Type: skill(not settable to/from spell)
Component: No
MSP:       none


This isn't a mining snippet I added in, just the standard mine that came with Dawn.

Edit: ...It appears there is no pickaxe object type, thus making the pickaxe not functional? Delving into it a little more.




Last edited by Pixie on Thu Jan 21, 2016 11:23 am; edited 2 times in total
Back to top
View user's profile Send private message AIM Address
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Wed Jan 20, 2016 6:02 pm    Post subject: Reply with quote

Update: I created the pickaxe object type, created one in the game, loaded it, and still can't mine.

This is baffling me a bit. I can see I have the skill "mining" in stat, but the code acts like I don't.


Back to top
View user's profile Send private message AIM Address
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Wed Jan 20, 2016 6:14 pm    Post subject: Reply with quote

Seem to have fixed the skill problem.

Change:

Code:
   // check if they have the skill to mine
   int skill=get_skill(ch, gsn_mining);
   if(skill<1){
      ch->println("What would you know about mining ore?");
      return;


To:

Code:
   // check if they have the skill to mine
   int skill=get_skill(ch, gsn_mining);
   if(skill>1){
      ch->println("What would you know about mining ore?");
      return;


Now getting:

Code:
mine ore
You need to be holding a pickaxe in order to mine.


Which is at least an improvement... Now to figure out why the pickaxe isn't working!

Stat on the pick:

Code:
stat pick
Name(s): pickaxe
Vnum: 1006  uid:1463   Type: pickaxe  Resets: 0
Short description: a mottled iron pickaxe on an oaken handle
Long description: A mottled iron pickaxe rests on the ground here.
Wear bits: take hold
Extra bits: none
Extra2 bits: none
Number: 1/10  Weight: 0/0/0 (lbs)
Level: 0  Cost: 0  Condition: 100  Timer: 0
In room: 0  In object: (none)  Carried by: Auri  Wear_loc: hold
Values: 0 0 0 0 0
There are 0 events associated with entity:


Back to top
View user's profile Send private message AIM Address
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Wed Jan 20, 2016 6:19 pm    Post subject: Reply with quote

Lol. Figured out why the pickaxe wasn't working. I went through the trouble of adding a new obj type for pickaxe, but what it actually responds to is "material"... which of course is pretty much free form and super easy to fill in with whatever you want.

Now getting:

Code:
You start to mine with a mottled iron pickaxe on an oaken handle...
Unfortunately the ore object template is missing from the realm (object vnum
44), so you can't be awarded any ore - please report this bug to the admin.


I know how to fix this.

I've also been talking to myself for an entire thread. Hi, I'm a nutjob.


Back to top
View user's profile Send private message AIM Address
Kerishai



Joined: 06 Nov 2013
Posts: 9

PostPosted: Thu Jan 21, 2016 5:54 am    Post subject: Reply with quote

Pixie wrote:
I've also been talking to myself for an entire thread. Hi, I'm a nutjob.


I'm listening! I don't have any answers...but I'm listening. I'm working on a ton of technicalities with crafting and my coder is fiddling with a system to do gathering. When he gets back from a bit of hiatus, maybe this will help a bit Smile Thank you!


Back to top
View user's profile Send private message
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Thu Jan 21, 2016 9:15 am    Post subject: Reply with quote

Now that it's working 100% in-game, documenting what to do to get it working:

In-game, set room2 flag to "mine" in the room you want to be able to mine in.

In-game, create an object with the wear flags "take" and "hold." Set the material to "pickaxe."

In mining.cpp, change:

Code:
  // check if they have the skill to mine
   int skill=get_skill(ch, gsn_mining);
   if(skill<1){
      ch->println("What would you know about mining ore?");
      return;


To:

Code:
// check if they have the skill to mine
   int skill=get_skill(ch, gsn_mining);
   if(skill>1){
      ch->println("What would you know about mining ore?");
      return;


"Make" in src folder.

The game defines the ore template as vnum 44. So, oedit create 44, set the type to ore, don't change anything else. "done" to exit editor. Save everything. Hotreboot. Mining is now working!


Back to top
View user's profile Send private message AIM Address
derek



Joined: 23 Sep 2007
Posts: 125

PostPosted: Mon Jan 25, 2016 10:44 am    Post subject: Reply with quote

I think you may have created another bug for yourself. Best revisit the change you made to line:
Code:

if(skill<1){


What the original says is that if the skill is 0% (or less), then inform the player they don't know the mining skill and bail.

By making it skill>1, you're saying that if you have the skill at 2% or above, then give the skill unknown message and bail.


Back to top
View user's profile Send private message
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Mon Jan 25, 2016 12:27 pm    Post subject: Reply with quote

It should, right? It's confusing. Setting it precisely as it is was the only way to get it functional. Set as-is, it registers you have the skill at 1 or higher, and allows you to mine. Setting it back the way it was, it doesn't register you have the skill and won't allow you to mine. I have -no idea- why this is the case, and it's really, really odd.


Back to top
View user's profile Send private message AIM Address
crone



Joined: 27 May 2017
Posts: 1
Location: Italy

PostPosted: Sat May 27, 2017 9:01 am    Post subject: Reply with quote

I think you are in wrong Pixie.

Code:

 // check if they have the skill to mine
   int skill=get_skill(ch, gsn_mining);
   if(skill<1){
      ch->println("What would you know about mining ore?");
      return;

This code is correct.

You need to add on skills.txt (system folder) something like this:
Code:

######NAME       mining~
===skill_level
mage             1
cleric           1
thief            1
warrior          1
druid            1
paladin          1
ranger           1
barbarian        1
spellfilcher     1
/
===rating
mage             2
cleric           2
thief            2
warrior          2
druid            2
paladin          2
ranger           2
barbarian        2
spellfilcher     2
bard             2
/
Position        standing~
Flags           teach_spgain level_spgain study_spgain~
Category        undefined~
Type            skill~
Damtype         none~
END


You need to create a Category named "crafting" but, if you want to test if the mine command, just add the object vnum 44 "Ore".

My two cents.
Crone


Back to top
View user's profile Send private message
Trell



Joined: 28 Jun 2013
Posts: 49

PostPosted: Tue Jun 27, 2017 9:34 am    Post subject: I dunno... Reply with quote

Perhaps the proper solution wasn't to change the code at all. Maybe the mining skill hadn't been set on your character class with the in-game 'class' command.


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Coding All times are GMT + 13 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2005 phpBB Group
Theme created by Vjacheslav Trushkin