scripting a torch w/a lesser duraction

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Maddogg0420
Posts: 2
Joined: Thu Sep 01, 2016 9:13 pm

scripting a torch w/a lesser duraction

Post 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
User avatar
Isaac
Posts: 3191
Joined: Fri Mar 02, 2012 10:02 pm

Re: scripting a torch w/a lesser duraction

Post 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.
Maddogg0420
Posts: 2
Joined: Thu Sep 01, 2016 9:13 pm

Re: scripting a torch w/a lesser duraction

Post by Maddogg0420 »

Thanks Isaac really appreciate you taking the time to respond..works great!
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: scripting a torch w/a lesser duraction

Post by trancelistic »

THat reminds me. What is the value for food? Also fuel?
:P
User avatar
Isaac
Posts: 3191
Joined: Fri Mar 02, 2012 10:02 pm

Re: scripting a torch w/a lesser duraction

Post 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
Last edited by Isaac on Sat Sep 17, 2016 8:24 pm, edited 2 times in total.
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: scripting a torch w/a lesser duraction

Post 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, )
Post Reply