Posted: Fri Jun 29, 2007 1:59 pm Post subject: Mining problem
Hello!
I have an problem :
When i start digging for ore , script says me that is no more ore here to mine.
I 'll find where error is , but how to fix - dont know.
When i set diffi :=1 ; I'll start digging but character don't stop mining!
please help me!
thnx
Code:
var diffi := GetHarvestDifficulty( "ore", location.x, location.y, info.landtile );
if(diffi == error)
print("Error!");
SendSysMessage(chr,"There is no more ore here to mine.");
return 1;
endif
Author
Message
Yukiko
Joined: 02 Feb 2006 Posts: 1094 Location: Southern Central USA
Posted: Sat Jun 30, 2007 12:48 am Post subject:
Is the return statement supposed to return a 1? If it's an error shouldn't it be:
Code:
var diffi := GetHarvestDifficulty( "ore", location.x, location.y, info.landtile );
if(diffi == error)
print("Error!");
SendSysMessage(chr,"There is no more ore here to mine.");
return 0;
endif
Not knowing which scriptset you are using makes diagnosing this harder but usually on an error you return a zero.
Author
Message
CWO
Joined: 04 Feb 2006 Posts: 691 Location: Chicago, IL USA
Posted: Sat Jun 30, 2007 2:25 am Post subject:
try doing
Print(CStr(diffi));
usually the errortext will tell you exactly where the problem is.
ok , i'll just recompile all my MUL files , player start mining , but only iron .
In console i have that strings .
Code:
Ore type found: error{ errortext = "Invalid parameter type. Expected param 0 as
Integer, got Uninit" }
error{ errortext = "Invalid parameter type. Expected param 0 as Integer, got Un
init" }
Author
Message
CWO
Joined: 04 Feb 2006 Posts: 691 Location: Chicago, IL USA
Posted: Sat Jun 30, 2007 6:03 pm Post subject:
Parameters are 0 based so whatever function you're printing, check the first thing that you're passing to it. It wants an integer but its getting nothing at all.
function GenerateNewOreType(src)
print("SRC!!! -"+src);
Print("Generating new oretype !");
var rnum;
var skill := GetEffectiveSkill(src.source, 45);
var name :=src.name;
print(name);
If (!skill)
Print("Skill is "+skill);
endif
when i call f-tion GetEffective skill , var SRC is /pkg/skills/mining/mining.src . So , i can't get Skill . How i must change script t get Effective Skill of player ?