Page 1 of 1

CoolDownTime line bug? (Solution Found)

Posted: Tue Sep 25, 2012 1:16 am
by Neikun
So I've been trying to, at first clone a dagger and give it a unique cooldown.
I ran into an error, so I thought to merely define it.
Then I tried to simply copy paste the defineObject dagger script and I was getting the same error.

Code: Select all

defineObject{
	name = "dagger_vannay",
	class = "Item",
	uiName = "Dagger of Louis Vannay",
	skill = "daggers",
	gfxIndex = 10,
	model = "assets/models/items/dagger.fbx",
	attackPower= 12,
	accuracy = 7,
	evasion = 3,
	coolDownTime:  2.0,
	attackMethod = "meleeAttack",
	attackSwipe = "vertical",
	attackSound = "swipe_light",
	impactSound = "impact_blade",
	weight= 0.5 ,
	description = "This dagger is superbly weighted. \nIt's craftsmanship goes beyond anything you've seen before. \nIt once belonged to a very famous rogue.",
}
Upon opening the project I am greeted with, "mod_assests/scripts/items.lua:598 : '<name> expected near 2.0'
The error is always the same where '2.0' is whatever I entered for coolDownTime.

Re: CoolDownTime line bug?

Posted: Tue Sep 25, 2012 1:17 am
by Neikun
Also, attempting to use the item without a defined coolDownTime results in a total editor crash.
(when using defineObject script. Not cloneObject)

Re: CoolDownTime line bug?

Posted: Tue Sep 25, 2012 2:03 am
by JohnWordsworth
You've used a colon instead of an equals... That could be it!?

coolDownTime: 2.0 should be coolDownTime = 2.0?

Re: CoolDownTime line bug?

Posted: Tue Sep 25, 2012 2:21 am
by Neikun
....
....
...
Infinite pause as my jaw hits the floor. brb checking.

Re: CoolDownTime line bug?

Posted: Tue Sep 25, 2012 2:23 am
by Neikun
This solves my problem.
I feel like an idiot lol
:oops:

Re: CoolDownTime line bug? (Solution Found)

Posted: Tue Sep 25, 2012 2:29 am
by JohnWordsworth
Lol - Happens to all of us! Glad it all works ok now - very exciting seeing everyone working hard on their mods - can't wait to play some of them.

Re: CoolDownTime line bug? (Solution Found)

Posted: Tue Sep 25, 2012 2:29 am
by Komag
that one is actually funny! :lol:

hey man, I make those sorts of obvious mistakes a lot (we all do I suppose) so no hard feelings 8-)

Re: CoolDownTime line bug? (Solution Found)

Posted: Tue Sep 25, 2012 2:35 am
by Neikun
It's funny because you all know what it's like to stare at the broken code you've made for like an hour, unable to see how it's wrong, only to find it is the littlest thing.
Haha.
Forgot to say thank you, so I'll do it now.
Thanks John.