Page 1 of 1

Problem with custom wand with custom spell

Posted: Sun Sep 30, 2012 8:24 pm
by Blichew
So one of my puzzles is about shooting from a wand to correct receptor. But I've encountered a problem:
Long story short i get the message: Warning! unknown spell: activation.

So I've created a wand with this code:
SpoilerShow

Code: Select all

defineObject{
	name = "activation_rod",
	class = "Item",
	uiName = "Special Wand",
	model = "assets/models/items/lightning_rod.fbx",
	description = "This wand has been enchanted with special powers.",
	gfxIndex = 222,
	attackPower = 14,
	accuracy = 0,
	coolDownTime = 5,
	attackMethod = "castWandSpell",
	spell = "activation",
	wandPower = 0,
	charges = 7,
	emptyItem = "activation_rod_empty",
	attackSwipe = "vertical",
	attackSound = "swipe",
	impactSound = "impact_blunt",
	weight = 1.7,
}

defineObject{
	name = "activation_rod_empty",
	class = "Item",
	uiName = "Special Wand (Empty)",
	model = "assets/models/items/lightning_rod.fbx",
	description = "This wand has once been enchanted with special powers. Now it is out of charges.",
	gfxIndex = 223,
	attackPower = 14,
	accuracy = 0,
	coolDownTime = 4,
	attackMethod = "meleeAttack",
	attackSwipe = "vertical",
	attackSound = "swipe",
	impactSound = "impact_blunt",
	weight = 1.7,
}
And then a spell with this code:
SpoilerShow

Code: Select all

defineObject{
	name = "activation",
	class = "ProjectileSpell",
	particleSystem = "fireball",
	hitParticleEffect = "fireball_hit",
	lightColor = vec(0.9, 0.9, 0.9),
	lightBrightness = 9,
	lightRange = 3,
	lightHitBrightness = 40,
	lightHitRange = 1,
	castShadow = true,
	launchSound = "fireball_launch",
	projectileSound = "fireball",
	hitSound = "fireball_hit",
	screenEffect = "fireball_screen",
	projectileSpeed = 30,
	attackPower = 0.1,
	damageType = "fire",
	--cameraShake = true,
	tags = { "spell" },
}
I've also put "import" line in the init.lua script for the spells.lua.

Anyone's got any ideas ? I ran out of mine, so help please :)

Small update: Spell created this way is working when used without an item (i.e. spawner).

Re: Problem with custom wand with custom spell

Posted: Sun Sep 30, 2012 8:42 pm
by Neikun
Test your code with a regular fireball spell rather than a custom activation spell.
Does that at least work?

Re: Problem with custom wand with custom spell

Posted: Sun Sep 30, 2012 8:52 pm
by Blichew
Yeah, it works. I guess only normal spells can be replaced to be put on the wand. Maybe we could get AH Devs word in this matter - my guess is that they didn't put spells.lua in the mod scripts for a reason. NYI ?

Re: Problem with custom wand with custom spell

Posted: Sun Sep 30, 2012 9:33 pm
by Komag
they've said before that spells are hard-coded and not customizable yet

Re: Problem with custom wand with custom spell

Posted: Sun Sep 30, 2012 10:40 pm
by Blichew
booo :( that's really bad news for the end of Sunday...