Ask a simple question, get a simple answer
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
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%
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
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
Could you not use the onStop hook??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?
SpoilerShow
Code: Select all
onStop = function(self, champion)
print("cond stopped...")
end,
Code: Select all
champion:setConditionValue("customCond", 0)
Code: Select all
champion:removeCondition("customCond")
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Ask a simple question, get a simple answer
Sorted projectile:pushForward()akroma222 wrote:Quick 2 questions:
1. What does projectile:pushForward() do??
2. What does champion:getDualClass() do??
Thanks all
-it translates the projectile forward or backward (with - values)
Still dont know what champion:getDualClass() is/does .... can we set dual classes??
Thanks guys
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Ask a simple question, get a simple answer
Except that it's not a custom condition; it's built in... I don't [knowingly] have access to the definition.akroma222 wrote: Could you not use the onStop hook??
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,
},
*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
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,
}
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
That's the first I've seen it be useful to us.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.
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. 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
It's false if the champion already has the condition in question. True if they didn't.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.]
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
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?
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
Because Champion:shootProjectile() is not a method that exists. See this post for making custom projectile spells.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.