Page 1 of 1

scripting a torch w/a lesser duraction

Posted: Thu Sep 01, 2016 9:30 pm
by Maddogg0420
Hello,
need some help w/a script ( and i apologize in advance if this topic is already on the forums and i missed it )...I was wondering if someone could help me w/a torch script...i would like to cut the torches duration down (scripting is not in my wheelhouse and i dont think it ever will be , copy and paste is about all i can do.. ) lol
thanks
Maddogg0420

Re: scripting a torch w/a lesser duraction

Posted: Fri Sep 02, 2016 12:10 am
by Isaac
In your project folder, within the scripts folder, there is a file called items.lua

Open this file in a text editor, and paste in the following:

Code: Select all

	defineObject{
		name = "torch",
		class = "Item",
		uiName = "Torch",
		model = "assets/models/items/torch.fbx",
		gfxIndex = 130,
		torch = true,
		fuel = 550,  --==============<< The operative value. The default is 1100
		attackPower = 4,
		accuracy = 0,
		coolDownTime = 3,
		attackMethod = "meleeAttack",
		attackSwipe = "vertical",
		attackSound = "swipe",
		impactSound = "impact_blunt",
		weight = 1.2,
	}
*Save the file, and reload the project.

Re: scripting a torch w/a lesser duraction

Posted: Fri Sep 02, 2016 2:45 am
by Maddogg0420
Thanks Isaac really appreciate you taking the time to respond..works great!

Re: scripting a torch w/a lesser duraction

Posted: Sat Sep 17, 2016 6:02 pm
by trancelistic
THat reminds me. What is the value for food? Also fuel?
:P

Re: scripting a torch w/a lesser duraction

Posted: Sat Sep 17, 2016 7:53 pm
by Isaac
nutrition [a usableItemCoponent value]

EDIT:
[LoG2]
UsableItemComponent:setNutritionValue(number) Set nutrition value, i.e. how much food is restored when item is consumed (range 0-1000)
[LoG1] item nutritionValue

Re: scripting a torch w/a lesser duraction

Posted: Sat Sep 17, 2016 8:07 pm
by trancelistic
Isaac wrote:nutrition [a usableItemCoponent value]
UsableItemComponent:setNutritionValue(number) Set nutrition value, i.e. how much food is restored when item is consumed (range 0-1000)
Thanks ISaac. <3


If only A.H made it easier like that. lols

A torch is just:
fuel = 100,
But food, yeah, use a very long text/string with basicly the same effect.:P

A noob I always be cuz of this:)

( should be food = 100, )