Spells

14 replies [Last post]
Posts: 95

A quick question about implanting a new skill:

In the demogame I've added fireBall to skill types, In the server I've added in the new fireball class and in skills.dat I've added in the new item. However when I load the client I'm getting errors

Quote:
object set not set to an instance of the object
at line Sprite = new Grh(GrhInfo.GetData(SkillInfo.Icon));

I think the engine is not reading the new additions to skills.dat (I've changed the count to 3) any help would be nice.

Posts: 1030

Have you rebuilt the entire solution?

Posts: 95

yes I've tried that >.<

Posts: 1691

GrhInfo.GetData(SkillInfo.Icon)

That is probably returning null. Make sure the GrhData exists.

Posts: 1030

If it doesn't, run the mapeditor, select the Grh tab => right click and select "Auto Update Grh".

Posts: 95

O.k I've fixed that error I made a typo in the skill file however it now stops on this line

var skillInfo = SkillInfoManager.Instance[skillType];

+		this	{DemoGame.Client.SkillsForm}	DemoGame.Client.SkillsForm
+		position	{X:0 Y:0}	SFML.Graphics.Vector2
		skillType	Heal	DemoGame.SkillType
		skillInfo	null	NetGore.Features.Skills.SkillInfo<DemoGame.SkillType>
+		pb	null	NetGore.Graphics.GUI.PictureBox
		skillLabel	null	DemoGame.Client.SkillsForm.SkillLabel

if this is any help in debugging this issue, its really annoying me.

EDIT
fixed it... bloody case senitive language
I've also made a new wiki page on adding spells

Posts: 135

Very nice tutorial, zidsal! Quick question. Did you add any animations or visual effects to your Fireball spell? I'd love to see how that is done as well.

Posts: 95

nop, currently there is no support for this as far as I can tell. At the moment I'm more worred about the lack of spell requiments (at the moment all users get all spells made which is a pain in the @ss).

Posts: 135

If I remember correctly, Spodi modded the engine to link animations, particle effects, etc. to an action several weeks ago. I don't think it's been incorporated into the demo game skills, so it's probably not easy to decipher how to take advantage of that feature just yet. Let's just bug him for more documentation. Wink

I assume you're talking about dependencies for that last part, right? I'm not sure if the base engine easily supports starting skills vs. learned/granted skills or not.

Posts: 1691

There is full support for visuals on skills, btw. Its a bit more confusing and obfuscated than the rest of the skill stuff, though.

Edit: Savant is completely right, I just took forever to reply. Tongue

Posts: 135

Tutorial, please, Spodi. Smile Or bullet point the classes to traverse to and methods to use, and we can go from there. If we could even change the base Heal and Strengthen skills so that they make use of the new visual features, that'd be a great start.

Also, can you comment on the skill dependencies question?

Posts: 1691

Well lets see... the actual scripts are in the ActionDisplayScripts.cs class on the client, denoted with the ActionDisplayScriptCollection attribute. Each individual action script is a method denoted by a ActionDisplayScript attribute, and with the signature of a ActionDisplayScriptHandler delegate. Inside this method, you just write whatever you want done when the action is invoked.

Inside the \Devcontent\, you'll see an actiondisplays.dat file which allows you to set some of the parameters for the script. This way, you don't have to write a script for every individual action, just all the individual "behaviors". For instance, all melee actions use the same "Melee" script that treats the parameters the same way.

As for attaching these to skills, guess it doesn't exist. Could've sworn it did. Either way, shouldn't be hard to add since you just have to tell the client what action to use when the skill is used. I'll add it to the todo list.

Posts: 135

Sweet, would you mind demo-ing the scripts with the base game skills at some point? Just some basic character animation + visual FX (maybe at least one where the FX travels to the target).

Another question: Is it possible to tie the ActionDisplayScript stuff to basic attacks with your fists or weapons (as opposed to linking them to skills)?

Posts: 1691

Savant wrote:
Sweet, would you mind demo-ing the scripts with the base game skills at some point? Just some basic character animation + visual FX (maybe at least one where the FX travels to the target).

Yeah. Just added it to the issue tracker.

Savant wrote:
Another question: Is it possible to tie the ActionDisplayScript stuff to basic attacks with your fists or weapons (as opposed to linking them to skills)?

Isn't that how its already done?

Posts: 135

Haha I'm not sure, sorry. I'm still at work so I can't check out the code. Not that I'm super good at that anyway. Smile