Adding ores

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 096.
Note: Core 096 is no longer officially supported.

Moderator: POL Developer

Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Adding ores

Post by Poi »

I searched the forums for everything ore related, and have come to no avail, I am in the process of adding custom ores, I edited all the files in the mining pkg to add the custom ores(the smelt works on them, etc) now I need to know how to make them spawn, I replaced the iron with my new ore in order to test, but it did not work, it still gave me iron..


OreCore:

Code: Select all

  if((val >= 1) && (val <= 496))
    return 1;  //"iron"
replaced with:

Code: Select all

  if((val >= 1) && (val <= 496))
    return 10;  //"iron"
as I used 10 in mining.src:

Code: Select all

  case(oretype)
    1: diff :=  -1;   objtype := 0x6300;   name := "iron";
    2: diff :=  65;   objtype := 0x6301;   name := "dull copper";
    3: diff :=  70;   objtype := 0x6302;   name := "shadow";
    4: diff :=  75;   objtype := 0x6303;   name := "copper";
    5: diff :=  80;   objtype := 0x6304;   name := "bronze";
    6: diff :=  85;   objtype := 0x6305;   name := "golden";
    7: diff :=  90;   objtype := 0x6306;   name := "agapite";
    8: diff :=  95;   objtype := 0x6307;   name := "verite";
    9: diff :=  99;   objtype := 0x6308;   name := "valorite";
	10: diff := -1;   objtype := 0xc911;   name := "mytheral";
but I think I need to add the ore to a "oretable", I came to this conclusion from this:
SetGlobalProperty("orelist", oretable);

and:
GetGlobalProperty("orelist");

Both in oreCore.src

So can anyone tell me how I add an ore type to this oretable?
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Adding ores

Post by Yukiko »

Which script set are you using? I wasn't able to find oreCore.src in the 0.97 Distro.
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Re: Adding ores

Post by Poi »

96, and its in pkg/skills/mining
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Adding ores

Post by Yukiko »

Well crap!
I can't find a copy of 0.96 Distro. I have about 13 complete shard sets but for some reason I don't have 0.96 anymore. Probably better off if someone else helps you out anyway. I am just plugging my mind back into POL after being away for a bit. I am off my game right now.
*laughs*
Heck I'm only average when I'm scripting on a regular basis.
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Re: Adding ores

Post by Poi »

Haha nah you've helped me a lot in the past :P

http://downloads.polserver.com/browser. ... Distro/096 <-- 96 distro
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Adding ores

Post by Yukiko »

Thanks Poi. I didn't have that link you posted. I'll delve into this asap.
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Re: Adding ores

Post by Poi »

Alright awesome, thank you, I have had no luck with this yet =/
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Adding ores

Post by Yukiko »

Poi, in that Distro all that's under the \pkg\skills folder is lumberjacking, removetrap and spells folders. Can you zip up your 0.96 Distro scripts and post them here?
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Re: Adding ores

Post by Poi »

http://www.filefactory.com/file/ccad78e/n/pkg.zip

I didn't remove the ecl's or anything, I'm not sure how to do that, but its only 2mb
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Adding ores

Post by Yukiko »

Thanks Poi. Just wanted to let you know I am looking at this.

So you are saying that even when you switch one of your custom ores into the "iron" position, your ore doesn't ever get mined?

One thing you can try first is to save the following script in the \scripts\textcmd\test directory as eraseglobal and compile it. This assumes your command level is "test".

Code: Select all

use uo;


program textcmd_eraseglobal( who, propertyname )
    print( "Property Name: " + propertyname );

    var res := EraseGlobalProperty( propertyname );
    if (res != error)
        SendSysMessage( who, "Property " + propertyname + " erased." );
    else
        SendSysMessage( who, "Error erasing property: " + res.errortext );
    endif
endprogram
After compiling this script restart your server and enter the text command .eraseglobal orelist

That should remove the orelist Global Property. Now shutdown and restart your server so it can rebuild the orelist property from scratch. Try mining and see if that works. I think I remember having to do this when I started adding ores.

You realize that your custom ores will be rare based on the range of the random numbers that determine their creation. Assuming that the oreCore script you sent me is your working script. You might consider adding a vein system later so you can have veins of ore in certain places on your map. That's what I did eventually and just got away from the orelist system entirely. That way I could make the special ores as rare or as common as I liked.

I'll continue looking at it and see if I can find any other reason why it wouldn't work.
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Re: Adding ores

Post by Poi »

Thanks for the reply, one of these days when I'm not exhausted ill give it a looksie :)
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Adding ores

Post by Yukiko »

Yeah. I understand exhaustion.
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Re: Adding ores

Post by Poi »

Aha! Perfect, thank you :) Thank you thank you :)
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Adding ores

Post by Yukiko »

*laughs*
That worked!?!?
You are welcome.
I'm totally surprised.
I was only guessing from bits I could remember when I added ores to my shard back in 2001.
I guess the orelist is defined on start-up and once it's defined it never re-initializes or rarely does so that if you add new ore types to the scripts they don't get added to the orelist since it's already defined.

I'm glad I could help.
Post Reply