Page 125 of 396
Re: Ask a simple question, get a simple answer
Posted: Thu Jun 09, 2016 10:43 pm
by zimberzimber
AndakRainor wrote:zimberzimber wrote:Isn't that part of what isBlocked() does?
No, you have at least to test if the party is not in front of a tile with a lower elevation, in that case the ice shards spell does nothing.
Right, it fizzles and does nothing.
The iceShard component is still responsible for not not doing anything in case the elevation is different, which it does even before isBlocked is check. (If I'm not mistaken)
Re: Ask a simple question, get a simple answer
Posted: Thu Jun 09, 2016 10:51 pm
by AndakRainor
zimberzimber wrote:AndakRainor wrote:zimberzimber wrote:Isn't that part of what isBlocked() does?
No, you have at least to test if the party is not in front of a tile with a lower elevation, in that case the ice shards spell does nothing.
Right, it fizzles and does nothing.
The iceShard component is still responsible for not not doing anything in case the elevation is different, which it does even before isBlocked is check. (If I'm not mistaken)
That's right, except for the first tile obviously, since you must decide to spawn or not to spawn before taking advantage of the IceShards component.
Re: Ask a simple question, get a simple answer
Posted: Thu Jun 09, 2016 11:00 pm
by zimberzimber
AndakRainor wrote:zimberzimber wrote:AndakRainor wrote:That's right, except for the first tile obviously, since you must decide to spawn or not to spawn before taking advantage of the IceShards component.
Yea already noticed that with the wall_fire playing its sound even though nothing appeared.
Re: Ask a simple question, get a simple answer
Posted: Thu Jun 09, 2016 11:48 pm
by AndakRainor
Also another point about spells; you are supposed to make them more powerful by 20% per skill level of the caster. That is what is written on the player screen, and it is the responsibility of a modder to make it a reality. Again, spells are a serious matter! Unless you just want to code only a few spells, I would advice using functions in a script entity to avoid writing the same tests and formulas many times.
Re: Ask a simple question, get a simple answer
Posted: Fri Jun 10, 2016 12:02 am
by zimberzimber
AndakRainor wrote:Also another point about spells; you are supposed to make them more powerful by 20% per skill level of the caster. That is what is written on the player screen, and it is the responsibility of a modder to make it a reality. Again, spells are a serious matter! Unless you just want to code only a few spells, I would advice using functions in a script entity to avoid writing the same tests and formulas many times.
Oh? I was sure the trait simply amplified damage dealt by the associated damage type, which is one of the reasons I was sure it mattered from which hero the damage came from. Thanks for the heads up!
So I have to modify the power of the spawned object with a tiledamager:setAttackPower(tiledamager:getAttackPower() * 0.2 * champion:getSkillLevel("fire_magic") + tiledamager:getAttackPower()) for it to work?
Also, I'm having trouble calling functions from inside an 'if', how do you do that?
Re: Ask a simple question, get a simple answer
Posted: Fri Jun 10, 2016 12:14 am
by Isaac
AndakRainor wrote:Also another point about spells; you are supposed to make them more powerful by 20% per skill level of the caster. That is what is written on the player screen, and it is the responsibility of a modder to make it a reality.
This I knew, but didn't know if the game applied it's own damage multiplier for skill. [never checked]
This is good to know; I had considered adjusting the damage (and even duration) based on the passed champion skill value, but hadn't actually tried to yet.
Re: Ask a simple question, get a simple answer
Posted: Fri Jun 10, 2016 12:18 am
by AndakRainor
Yes you can use the generic formula:
power = base * (1 + 0.2*skill)
You can use the skill parameter in your spell instead of champion:getSkillLevel("fire_magic") because you already declared skill = "fire_magic" in the spell definition.
To call a function in an if statement is the same thing as anywhere else:
Code: Select all
if myScriptId.script.myTest() then ...
Now just to make things a little harder; what about special items like "shaman_staff" with gameEffect = "Earthbound (Poison spells deal 20% more damage)" or "zhandul_orb" with gameEffect = "Intense Fire (Fireball and Fireburst spells deal more damage)",?
So far I did not include such items in my mod, but it is also something to consider if you ever want to use them
Edit: also note that the skill parameter may be given by the power of a CastSpell component instead of the caster skill if cast from an item!
Re: Ask a simple question, get a simple answer
Posted: Fri Jun 10, 2016 1:09 am
by minmay
Zhandul's Orb in Grimrock 2 doesn't actually work, only the Shaman Staff does. Its functionality is built into the default poison cloud and poison bolt spells, so if you want it to affect custom spells you'll have to check for it yourself.
Re: Ask a simple question, get a simple answer
Posted: Fri Jun 10, 2016 10:58 pm
by zimberzimber
AndakRainor wrote:To call a function in an if statement is the same thing as anywhere else:
Code: Select all
if myScriptId.script.myTest() then ...
Problem is that I have to do it on an external script, which is not tied into the game with a script entity, which (correct me if I'm wrong) doesn't have an ID like script entities do.
Re: Ask a simple question, get a simple answer
Posted: Sat Jun 11, 2016 12:51 am
by Isaac
I believe that everything has to have an ID. Scripts are part of an object's script component.