upgrade troubles :(

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
gundamwing84
Grandmaster Poster
Posts: 178
Joined: Tue Sep 08, 2009 1:57 am

upgrade troubles :(

Post by gundamwing84 »

ok so ive started upgrading all the scripts to 97, and ive come into a bit of trouble with math.em, while compiling alot of my errors are saying (for example):

Code: Select all

Compiling: d:/shard2/Broken Blade/pkg/character/regen.src
Expected an identifier, got User Function Min instead.
Near: use math;
File: d:/shard2/Broken Blade/scripts/modules/math.em, Line 15
Error reading function declaration in module math
Compilation failed.
where, as far as i see this script doesnt even use the math module. nor does its include??

Code: Select all

use uo;

include "include/dotempmods";

exported function GetLifeRegenRate (character)
	// 1 point per 5 seconds
	// ... is 12 points per minute
	// ... is 1200 hundredths per minute

	//No regen if poisoned
	if (character.poisoned)
		return 0;
	endif

	//NPCs regenerate faster if they have more HP
	if (!character.acctname)
		if (GetAttributeBaseValue (character, "Strength") < 1500)
			return 1200;
		endif
		return (CINT (GetAttributeBaseValue (character, "Strength")/10) * 12);
	endif

	//If they're hungry, don't regenerate HP as fast or at all
	var hunger := CINT (GetObjProperty (character, "hunger"));
	if (!hunger)
		hunger := 0;
	endif

	if (hunger >= 9)
		return 0;
	elseif (hunger >= 7)
		return 600;
	elseif (hunger > 5)
		return 1000;
	endif
	return 1200; 
endfunction

exported function GetLifeMaximumValue(character)
	//Do a stat cap on players
	if (character.acctname)
		if (!character.cmdlevel)
			var maxstr := GetObjProperty (character, "maxstr");
			if (!maxstr)
				maxstr := 75;
			endif
			if (GetAttributeBaseValue (character, "Strength") > maxstr * 10);
				SetAttributeBaseValue (character, "Strength", maxstr*10);
			endif
		endif
	endif

    return GetAttribute (character, "Strength") * 100;
endfunction


exported function GetStaminaRegenRate (character)
	//(Almost) no regen if poisoned
	if (character.poisoned)
		return 100;
	endif
	
	//Ignore all this for NPCs
	if (!character.acctname)
		return 1200;
	endif

	//If they're hungry, don't regenerate stamina as fast or at all
	var hunger := CINT (GetObjProperty (character, "hunger"));
	if (!hunger)
		hunger := 0;
	endif
	
	if (hunger >= 9)
		return 100;
	elseif (hunger >= 7)
		return 600;
	endif
	
	//If the last thing they ate was a high food value item, they regenerate stamina faster
	var foodregen := GetObjProperty (character, "#dotempmod_stamina_regen_rate");
	if (!foodregen)
		return 1200;
	endif

	return foodregen;
endfunction

exported function GetStaminaMaximumValue(character)
	//Do a stat cap on players
	if (character.acctname)
		if (!character.cmdlevel)
			var maxdex := GetObjProperty (character, "maxdex");
			if (!maxdex)
				maxdex := 75;
			endif
			if (GetAttributeBaseValue (character, "Dexterity") > maxdex * 10);
				SetAttributeBaseValue (character, "Dexterity", maxdex*10);
			endif
		endif
	endif

    return GetAttribute (character, "Dexterity") * 100;
endfunction


exported function GetManaRegenRate(character)
	//No regen if poisoned
	if (character.poisoned)
		return 0;
	endif
		
	//Ignore all this for NPCs
	if (!character.acctname)
		return 1200;
	endif

	//If they're hungry, don't regenerate mana as fast or at all
	var hunger := CINT (GetObjProperty (character, "hunger"));
	if (!hunger)
		hunger := 0;
	endif

	if (hunger >= 9)
		return 0;
	elseif (hunger >= 7)
		return 600;
	elseif (hunger > 5)
		return 1000;
	endif

	return 1200;
endfunction

exported function GetManaMaximumValue(character)
	//Do a stat cap on players
	if (character.acctname)
		if (!character.cmdlevel)
			var maxint := GetObjProperty (character, "maxint");
			if (!maxint)
				maxint := 75;
			endif
			if (GetAttributeBaseValue (character, "Intelligence") > maxint * 10);
				SetAttributeBaseValue (character, "Intelligence", maxint*10);
			endif
		endif
	endif

    return GetAttribute (character, "Intelligence") * 100;
endfunction


program regen()
	return 1;
endprogram
this doesnt make any sense to me as in there is no calling for that module that i can see, if anyone could help it would be much appreciated because im...baffled :s baffled....waffled.....waffle....mmm breaky time :) hope to hear from you soon guys
gundamwing84
Grandmaster Poster
Posts: 178
Joined: Tue Sep 08, 2009 1:57 am

Re: upgrade troubles :(

Post by gundamwing84 »

fixed it :) Min(x,y) was already defined in one of my includes :( should have looked properly sorry
Post Reply