forums | blogs | polls | tutorials | downloads | rules | help

Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in remember_me_form_alter() (line 78 of /var/www/siegetheday.org/sites/all/modules/contrib/remember_me/remember_me.module).

Enchantable progressive weapons...?

Sharkull's picture

It's easy enough to make a progressive weapon using a "value" formula within a [magic] - [enchantments] - [*] block, but that makes the weapon magical and therefore not enchantable. So, what I've been trying to do is to put a formula in the [attack] block, using something dynamic (eg. #melee, #character_level, #str...), but nothing I've tried has worked.

Am I banging my head against the wall trying to do the impossible, or does anyone have any suggestions?

LoneKnight's picture

Most likely its impossible unless you change the whole system of enchanting weapons...

But I'm not a professional in that field, so I'm not 100% certain.

Sharkull's picture

Thanks for the input but I'm not really interested in changing the game to allow enchanting magic items... I'm trying to find a way of making a non-magical item have progressive stats.

just wondering, what are progressive stats? by any chance is it stats that go higher when you level up?

Sharkull's picture

Yes... What I mean by progressive is non-fixed. Stats that will grow with your character so that you can keep the same weapon long term, and it still be effective. All current items (made by GPG) are based on item_level, which is a fixed attribute of the item's template. Here's the code from one of the base sword templates:

	[attack]
	{
		attack_class = ac_sword;
		damage_min = 0.75 * (3.4 + 0.74 * #item_level);
		damage_max = 1.25 * (3.4 + 0.74 * #item_level);
		is_melee = true;
		reload_delay = 0.67;
		skill_class = melee;
	}

I want to know if I can change these formulas so that they are dynamic... Stare

FYI.
Here's some example code for making a magical (non-enchantable) weapon:

	[magic]
	{
		[enchantments]
		{
			[*]
			{
				alteration			= alter_melee_damage_min;
				value				= 0.75 * (3.4 + 0.74 * #melee);
				description			= "Adds progressivly to Damage";
				duration			= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}
			[*]
			{
				alteration			= alter_melee_damage_max;
				value				= 1.25 * (3.4 + 0.74 * #character_level);
				duration			= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}
		}
	}

...and the value formula can be changed as desired (so can the alteration if you want elemental damage...).

   [attack]
   {
      attack_class = ac_sword;
      damage_min = 0.75 * (3.4 + 0.74 * #item_level);
      damage_max = 1.25 * (3.4 + 0.74 * #item_level);
      is_melee = true;
      reload_delay = 0.67;
      skill_class = melee;
   }

Have you tried:

   [attack]
   {
      attack_class = ac_sword;
      damage_min = 0.75 * (3.4 + 0.74 * #item_level * #melee);
      damage_max = 1.25 * (3.4 + 0.74 * #item_level * #melee);
      is_melee = true;
      reload_delay = 0.67;
      skill_class = melee;
   }

?

No doubt you probably have, but that seems to be the only way that I could think of it to be done. Maybe replace #item_level with#melee... I'm still trying to get my first mod to actually be loaded into the game. this is ALOT different tha DS1, where all I had to do was recompile my .dsres and slap it in the resources folder.

Sharkull's picture

Thanks for the post, but I've tried quite a few things... I think the problem is that when I say #melee, #character_level, #str... in the attack block, the game engine takes that as a reference to the weapon's attributes, not the character's (which means that these variables will always be zero). I just wouldn't know where to start looking for code to add / change something like that (probably hard-coded). :?

BTW, if you want some help starting modding DS2, check out my_test_world in the download section here (and read the included readme file). Wink

hrmmm., that makes sense...

Now, I wonder if there is a charachter object that we just have to access that, and then do #charachter.melee_level or some such nonsense... I suppose if that were possible you'd have seen it in skrit before

(And I've got your test world, and I'll be destroying it and remaking it in my image for the next few days ;))

Sharkull's picture

Well, the character's attributes are accessible in a weapon's magic block. Also, I know that there are character GO's that can be accessed via skrit (I've read as much in various forums...) but that just about sums up my entire knowledge of skrit ( Laughing out loud ... it's a complete mystery to me... I don't know C++ either). If this behaviour (character attributes available in a weapon's magic block) is coded in skrit I don't know where (or if I'd be able to do what I want), not that I've searched extensively.

About the only other thing / theory I could think of would be to dynamically link a weapon's attributes to the weilding character's attributes, but I don't know if such a thing is possible, let alone if I'd be capable of doing it.

I doubt this will help but if it does...

	[defend]
	{
		// Defense 	= Character Damage / Expected damage multiplier
		//			= (8 + 2 * #monster_level) / 0.75
		defense = (8 + (2 * #monster_level)) * 1.333 * (1.0 + 0.006 * #monster_level);
	}

Could you try modifying this to attack stats? Just a thought..

If you did write a skrit to get items to have dynamic stats the inventory would not update unless you clicked on the item and dropped it back in =/ . Those formulas are static after drops so you're barking up the wrong tree with those.

Are you sure there's no way to perfect the skrit to bypass this problem? It would still work even without finding a way around that, wouldn't it? Just picking up an item and replacing it into your inventory is no big pain in the ass, just a teeny bit inconvenient.

I still think its a great idea! :thumbup:

The inventory don't update. I mean pick up the same item drop back into slot. Skrit cannot fix the inventory.

Wyvante wrote:
If you did write a skrit to get items to have dynamic stats the inventory would not update unless you clicked on the item and dropped it back in =/ . Those formulas are static after drops so you're barking up the wrong tree with those.

Sorry, I guess I misinterpreted.

Sharkull's picture

Wyvante wrote:
If you did write a skrit to get items to have dynamic stats the inventory would not update unless you clicked on the item and dropped it back in =/ . Those formulas are static after drops so you're barking up the wrong tree with those.

Thanks for the info... I guess this idea dies here (because I have no plans to learn skrit... no time for it). Sad

If someone wants to steal the idea and run with it, I won't mind at all. Wink

Wait perhaps that can work. It works on spells. Did anyone test?

Edit: I just ran a test and it works perfectly. In ds1 I don't think it was possible. In my test the stats were dynamic with uber level and did not require me to close my inventory or select then drop item. it just changed! I didn't realize the engine could do this in the inventory. I am sorry aboiut the wrong advice.

You guys neeed to test stuff! I figured you tested this idea with no results. I might of been thinking of images rather than text changing /shrug.

[magic]
	{
		[enchantments]
		{
			[*]
			{
				alteration			= alter_max_life;
				value				= #character_level;
				description			= "+<value> Health";
				duration			= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}

Sharkull's picture

/me thinks Wyvante needs to take a look at my earlier posts in this thread. :P

I know you can make progressive items using the magic block (I even gave example code too...), but that means an item is no longer enchantable, hence the purpose of this thread. Smile

Oh, I misread due to lack of sleep.

Sharkull wrote:
Wyvante wrote:
If you did write a skrit to get items to have dynamic stats the inventory would not update unless you clicked on the item and dropped it back in =/ . Those formulas are static after drops so you're barking up the wrong tree with those.

Thanks for the info... I guess this idea dies here (because I have no plans to learn skrit... no time for it). Sad

If someone wants to steal the idea and run with it, I won't mind at all. Wink

This can be done in ds1 I am sure it is pretty much the same to do in ds 2. :roll:

Sharkull's picture

sjr wrote:
This can be done in ds1 I am sure it is pretty much the same to do in ds 2. :roll:

Do you really mean that you can make a progressive non-magical weapon in DS1? If yes, how?

Wyvante wrote:
Wait perhaps that can work. It works on spells. Did anyone test?

Edit: I just ran a test and it works perfectly. In ds1 I don't think it was possible. In my test the stats were dynamic with uber level and did not require me to close my inventory or select then drop item. it just changed! I didn't realize the engine could do this in the inventory. I am sorry aboiut the wrong advice.

You guys neeed to test stuff! I figured you tested this idea with no results. I might of been thinking of images rather than text changing /shrug.

[magic]
	{
		[enchantments]
		{
			[*]
			{
				alteration			= alter_max_life;
				value				= #character_level;
				description			= "+<value> Health";
				duration			= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}

Well at least I can use this info in my Valdis mod since he only uses one weapon. :P

Sharkull wrote:
sjr wrote:
This can be done in ds1 I am sure it is pretty much the same to do in ds 2. :roll:

Do you really mean that you can make a progressive non-magical weapon in DS1? If yes, how?

It can be for any items since it is not in the template of the item. You will need to use some fancy pants skrit however. Basically you attach a monitor to an item, equiped or inventory, and it will then award the item based on your characters level. Meaning if you give the item to someone else the damage amount would be different if they have a different level, which most likely they will. Sort of like how you can attach a name to the item. Like if I have a sword it may be sjr's super groovy sword of kapow. I give it to you and now it is sharky's super groovy sword of kapow.

Once the skrit is created it is very easy to add to the item. I have not looked much at ds2 items and such but from what I have seen I would think it would work fine, pretty much everything else converts over, such as Monsoon's "UI" mod, minus the "UI" part. Wink It does plenty more than just "UI" :angel:

Balderstrom's picture

DS Revived had scalable weapons, Dark/Light elves by Witness may of as well.
I don't think it was all that complex, a few well implemented function calls here and there. Should be easily importable into DS2.

Sharkull's picture

Thanks sjr, I was fearing it would be something like "fancy pants skrit"...

Thanks Balderstrom too.

I'll take a look at those mods when I get some free time (and I hope what I would want is OK to reuse / clone... I'll be sure to check that, in addition to function). Smile

Hi Sharkull,

I have tried doing something similar to what you did here, using #variables inside the value field of a variable. However, regardless of which #variable I use, I get null.

Perhaps I am trying to modify the wrong file? The file that I am trying to create a template in, resides in "world/contentdb/templates/interactive".

LoneKnight's picture

Hmm...I don't know the answer personally, so wait for the Shark to post, I suppose. My word of advice, however, is guess and check.

Good luck.

P.S. Welcome to StD!

Unkown wrote:
It remains to be seen if DS can rise back from its ashes and dissociates from DS2 and GPG.

Hi Loneknight,

Thank you for your post. I will wait for Sharkull to reply.

As for the "guess and check" method that you advised me, I have tried every #variable that I wanted to test, that appeared in /world/contentdb/components/components.gas, without tangible results.

Sharkull's picture

I assume you mean something like this... (likely with a different alteration / value formula, but with full [magic] [enchantments] [ *] blocks)?

	[magic]
	{
		[enchantments]
		{ 
		 	[*]
			{
				alteration			= alter_melee_damage_min;
				value				= 0.75 * (3.4 + 0.74 * #melee);
				description			= "Adds progressivly to Damage";
				duration			= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}
			[*]
			{
				alteration			= alter_melee_damage_max;
				value				= 1.25 * (3.4 + 0.74 * #character_level);
				duration			= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}
		}
	}

(The bullets within the code are actually "[*]"... parsed incorrectly when displayed Sad ).

The item templates are indeed within gas files found in the path you describe... Perhaps there's a syntax error, or your tanking / testing method is causing the problem.

What type of item are you adding / changing (posting code might help us spot potential problems...), how are you getting it into the game (forced drop? added to a shop?), and how do you test your mod (tank and test, or DS2Mod)?

The code you pasted is a fair example of what I am trying to achieve.
I am trying to add a staff, a fighter staff.
I am forcing the drop from the chest at the landing site at Greilyn Beach. The drop works flawlessly.
To test the mod I run DS2Mod.
The problem lies in getting the variables evaluated as I intend them to be. I have tried several things, and at the end of it I decided to test which #variables do get parsed correctly. So, I made the attached test [magic] { [enchantments] { } } block to test just that. I tried pasting the code, but it screwed up the layout and omitted the local variables (the ones enclosed in "smaller than" and "greater than" signs), thinking they are html(!) code. Grr.

Please note that the "alteration" value is for decoration only in this particular test. I have tried using the #variables inside the description themselves, as well as in variable evaluation calculations, but in the case of the descriptions the #variables were passed on as named strings, rather than the value that they are meant to represent. To change that, I decided to use local variables instead, as I noticed that value gets correctly interpreted in the description. Now, rather than getting "#life Hc, #maxlife H, #life_recovery_unit HRU, ..." I get "Hc, H, HRU, ...".
I decided to add another test block in there as well, using #str in the "alter_max_life" "value=" calculation, just to see if it was only _my_ code that was buggered and not evaluating properly. However, for that block I get "+0 Health", even though my character has health > 0, and even though there was nothing really fancy going on in the test block. So, it should have evaluated.

Any thoughts?

P.S.: Now, after several attempts to attach a text file to my post, that is not seeming to work either...
P.P.S.: I have managed to place the file on my blog. Please find it there. I do apologise for any inconvenience, and I thank you for your patience.

Hey Sharkull..

..you could use the bbcodes "code" and "/code" to surround your text
- this should preserve your original punctuation and formatting..
..including the * or [*]

- that was pasted from notepad, hence the font change..

- oh, and a progressive weapon is just what's needed
- shame you can't use enchantments on enchanted weapons..

-----------------------------
..never mind the weather, just as long as we're together!

Sharkull's picture

This works for me:

[t:template,n:st_ft_fs_shark01]
{
	specializes = base_fighter_staff_template;
	doc = "Sharky's progressive fighter staff";
	[aspect]
	{
		model = m_w_stf_elements-fury;
		tracer_texture = b_sfx_tra_generic-31;			
		[textures]
		{
			0 = b_w_stf_elements-fury;
		}
	}
	[common]
	{
		screen_name = "Sharky's Progressive Fighter Staff";
		base_screen_name = "Progressive Fighter Staff";
		rarity = unique;
	}
	[gui]
	{
//		equip_requirements = melee:#item_level - 2.0,overbear:1;
		inventory_icon = b_gui_ig_i_w_stf_elements-fury;
		inventory_height = 4;
		inventory_width = 1;
	}
	[pcontent]
	{
		[base]
		{
			item_level = 2.0;
		}
	}
	[magic]
	{
		[enchantments]
		{
			[*]
			{
				alteration		= alter_max_life;
				value			= #str;
				description		= "+<value>; Health";
				duration		= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}
		}
	}
	[loot_drop_indicator]{}
}

...although I needed to equip it to see the value number in the description. The rest of the stuff you are trying within your code is... difficult to understand (what you're trying to do). I'm not really sure that you can directly reference character variables the way you are trying to... (I don't think so) but my question would be "why?". Remember that you're not programming a class, you're entering text data for use with a very specifically coded game engine. Certain things can be done simply (like defining max_damage in a weapon template) but other things aren't quite so straight forward. In the above example, the "value" field is the important part, along with the alteration. You can confirm that the value is affected as you want, by displaying it as shown. Affecting other things (like mas mana, max life, strength...) will be verifiable looking at the in-game character data with the item equipped.

My best advice would be to take a look at components.gas and GPG's templates to see what kind of things are easy to achieve, and ask "how do I..." questions for things you want to do but can't find examples for.

Notes:
I made my item a Unique, but you could also create a Set item (if you want to add extra bonuses...), or a Crafted item (which is just a preconfigured rare).

To post a "less than" symbol, use the html equivalent: & l t ; (without the spaces) = < (there's a "More information about formatting options" link visible when composing a post that mentions this...).

Lastly, since you're using DS2Mod, you might find my_test_world helpful...
http://www.siegetheday.org/?q=node/539
Smile

Blondin:
My stuff is within code blocks... the bullets showed up anyways. Stare

...and creating progressive weapons is super easy. The hard part would be in making them balanced and useful. I wanted to create progressive items that matched the current game balance formulas but that allowed enchantments (so they could compete with sets / uniques)... but I ran into a brick wall.

Pages