Page 127 of 400

Re: Ask a simple question, get a simple answer

Posted: Sun Jun 12, 2016 3:20 am
by AndakRainor
Thanks! Shaman Staff like items implemented for the spells pack ;)

It always was a very low priority for me, but finally it can be fun to add some variety to item stats (I will share an update soon);
Concentration Spells Power ±p%
Fire Spells Power ±p%
Air Spells Power ±p%
Water Spells Power ±p%
Earth Spells Power ±p%

Re: Ask a simple question, get a simple answer

Posted: Fri Jun 17, 2016 8:51 am
by Isaac
Is there a way to detect the loss of a built in condition ~without constantly polling the champion to see if they still have it?

Re: Ask a simple question, get a simple answer

Posted: Sat Jun 18, 2016 3:13 pm
by akroma222
Isaac wrote:Is there a way to detect the loss of a built in condition ~without constantly polling the champion to see if they still have it?
Could you not use the onStop hook??
SpoilerShow

Code: Select all

onStop = function(self, champion)
		print("cond stopped...")
	end,
If you went that way ... youd need to use

Code: Select all

champion:setConditionValue("customCond", 0)
in order to remove it, as

Code: Select all

champion:removeCondition("customCond")
will skip the onStop hook....

Re: Ask a simple question, get a simple answer

Posted: Sat Jun 18, 2016 3:16 pm
by akroma222
akroma222 wrote:Quick 2 questions:
1. What does projectile:pushForward() do??
2. What does champion:getDualClass() do??

Thanks all :D
Sorted projectile:pushForward()
-it translates the projectile forward or backward (with - values)

Still dont know what champion:getDualClass() is/does .... can we set dual classes??

Thanks guys

Re: Ask a simple question, get a simple answer

Posted: Sat Jun 18, 2016 6:38 pm
by Isaac
akroma222 wrote: Could you not use the onStop hook??
Except that it's not a custom condition; it's built in... I don't [knowingly] have access to the definition.

How does one detect the instant the PC stops being diseased, heals a wound, or [specifically] loses the water_breathing condition?

I dabbled with trying to build my own custom condition, but was unsuccessful at cleanly duplicating the effect; and did not want to implement a slew of custom GUI corrections.

It would be nice if all conditions each called an onRemoveCondition() hook when they expire; but the only one I've seen, is onReceiveCondition()

If only this would work:

Code: Select all

components = {
				{
				class = "Party",
				onRemoveCondition = function(self, champion, condition) print(champion:getName().." has lost:",condition) end,
				onReceiveCondition = function(self, champion, condition) print(champion:getName().." has gained:",condition) end,
				},
(But only the second hook is a real one. :()

*I will try again with crafting a custom condition to use instead of the built in one. ;)

Re: Ask a simple question, get a simple answer

Posted: Sat Jun 18, 2016 8:40 pm
by minmay

Code: Select all

defineCondition{
	name = "water_breathing",
	uiName = "Water Breathing",
	description = "You can breath under water.", -- sic
	icon = 20,
	beneficial = true,
	harmful = false,
	onStop = function(self, champion)
		print("water breathing lost")
	end,
}
You don't need to recreate the original condition. Just define a custom condition with the same name, uiName, description, and icon. The actual effects of standard conditions are hardcoded based on their names.

Re: Ask a simple question, get a simple answer

Posted: Sat Jun 18, 2016 9:36 pm
by Isaac
minmay wrote:You don't need to recreate the original condition. Just define a custom condition with the same name, uiName, description, and icon. The actual effects of standard conditions are hardcoded based on their names.
That's the first I've seen it be useful to us. :)

Thank you.

I had defined a custom condition, but had given it a different name, and [not being the built in version], I was having issues with the energy bar visibly refilling each tick. Later (today) I defined a separate condition that I realized would always be given in tandem with water_breathing; and so added what I needed to it instead.

Your's is a great solution. 8-) I will redefine water_breathing to at least signal when it has ended.

BTW minmay... do you know what the third [boolean] value passed into the onStart condition hook represents? [I'm asking because I do not.]

Code: Select all

onStart = function(self, champion, mystery) 
   print(mystery, "!")
   end,

Re: Ask a simple question, get a simple answer

Posted: Sun Jun 19, 2016 12:01 am
by minmay
Isaac wrote:BTW minmay... do you know what the third [boolean] value passed into the onStart condition hook represents? [I'm asking because I do not.]
It's false if the champion already has the condition in question. True if they didn't.

Re: Ask a simple question, get a simple answer

Posted: Sun Jun 19, 2016 11:24 pm
by THOM
I'm trying to make a weapon that shoots a projectile as the first action. The projectile itself (as an object) works.
But whatever I do, I can't get it to work.

Anyone an idea, why?


Code: Select all

defineObject{
	name = "water_shooter",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/revolver.fbx",
		},
		{
			class = "Item",
			uiName = "Water Shooter",
			description = "A strange mechanics makes this weapon compressing water and shooting it out in some kind of a jet.",
			gfxIndex = 332,
			weight = 1.5,
			traits = { "weapon" },
		},
		{
			class = "ItemAction",
			name = "waterbolt",
			uiName = "Water Bolt",
			cooldown = 5,
			onAttack = function(self, champion)
				champion:shootProjectile("water_bolt", 1.4, 11)
				--return true
			end,
		},
	},
}

Re: Ask a simple question, get a simple answer

Posted: Sun Jun 19, 2016 11:53 pm
by minmay
Because Champion:shootProjectile() is not a method that exists. See this post for making custom projectile spells.