Multiple magic schools spells pack

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Multiple magic schools spells pack

Post by akroma222 »

Oh also - AndakRainor - potential bug?
If I cast one of the basic elemental Bolts (eg Fireball) and trigger the 15sec window where my Missile/Firearm etc attacks recast the Bolt....

1) I can spam / rapid fire the recasted Bolt (admittedly stacking cooldown reducing bonuses) ..... without Ammo in offhand
2) The missile/firearm attack will reset the 15sec time window....

No stress on this one, Ill be in touch very shortly :)
Akroma
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack

Post by AndakRainor »

Good catch! I will try that tonight...

If I understand what you mean, the buff resets to 15 sec when you use an attack with no ammo? And launches the bolt spell too?
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Multiple magic schools spells pack

Post by akroma222 »

Yup, correct :)
I will double check now to make sure....

EDIT - my mistake - it is only the Lightning Bolt recast that is not behaving properly
>Cast Lightning Bolt (w Missile Weapons lvl 3)
>Attack with Short Bow,
>( regardless of ammo or not), Lightning Bolt will recast over and over, resetting the 15s each time
> It continues to recast even when setting up recasts with the other elemental Bolts

Are you able to replicate this behavior ?

(I just loaded your Magic Grimrock 2 dungeon editor file and made a little test room off to the side in the Void level
.... I dont think this matters or relates to the issue though)

Also! :| When the other Bolts (time & drain life too) create the 15s window,
.....and you attack w appropriate Weapon
..... it seems you don't need any ammo to trigger the recast

Small hiccups for what is simply just an amazing Spell Pack :D
Ive adopted quite a few features such as:
SpoilerShow
- the time delay on the Rune Trap objects
- spiraling / cycling projectile effects 8-)
- many other particle effects
- quite a few spell & condition Icons
- fading gui Items in and out via feeding game time values into alpha args
- ice block shenanigans
- plenty of table/scripting/setting out tricks & ideas
Once again, thankyou :D ;)
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack

Post by AndakRainor »

Found why some of the bolt spells reset their timers, it's an easy fix!

Now looking for the no ammo attacks...

Edit:
So PartyComponent.onAttack(self, champion, action, slot) is called by no ammo attacks, I will have to add some other hand check there...
Slayer82
Posts: 303
Joined: Thu Feb 05, 2015 10:19 am

Re: Multiple magic schools spells pack

Post by Slayer82 »

Hey, Andak.

Firstly, thanks for creating this. It is an amazing piece of work that brings a new experience to the game.

Everything seems to be working well, except for the fact that the spells don't seem to consume any energy from the caster when cast.
I have tried this in the editor and in game. Is there something that I have not added or done wrongly?

Any info would be appreciated.
Mods - Isle of the Deranged & The Allure of Nightfall
http://grimrock.net/forum/viewtopic.php?f=23&t=9513
viewtopic.php?f=23&t=14762
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack

Post by AndakRainor »

Hi!

Most spells energy costs are defined in the vanilla way so I can't see a reason those would suddenly cost 0. Some of the spells have variable cost and could be the ones you talk about (or is it all the spells???).

The first idea that I have about that is that you could have a problem in the definition of the party. The spells require a lot of calls from the party event triggers. The pack includes an option to set the events correctly with a flag to set if you use the Hook Framework. (../spells_pack/init.lua at the top of the file: "hook_framework = false").

You can see all the settings required for the spells in the file party.lua (if you use the hook framework, from line 39 to 63, else from line 67 to 99).

I hope this is your problem, I don't see other possibilities for now. In any case, you can always send me your editor files if you want me to fix the issue for you!

Edit: is this bug new in your project? Did you see it before, or never checked?
Last edited by AndakRainor on Mon Oct 09, 2017 6:01 pm, edited 1 time in total.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack

Post by AndakRainor »

Also, I will publish version 3.2 very soon with the fix Akroma talked about above. If anyone has found another bug or has a suggestion for 3.2, let me know!
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Multiple magic schools spells pack

Post by Isaac »

Will the 3.2 version affect spawning filled containers via script?
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack

Post by AndakRainor »

Isaac wrote:Will the 3.2 version affect spawning filled containers via script?
Thanks, I totally forgot about it, I'm on it :lol:
Slayer82
Posts: 303
Joined: Thu Feb 05, 2015 10:19 am

Re: Multiple magic schools spells pack

Post by Slayer82 »

Hello, again.

Thanks for the quick reply.

Yes, the spells_pack init.lua has the hook framework set to' false'. If it's set to 'true', nothing seems to be affected. It is odd, because the vanilla spells cost energy.

I looked at the requirements in the party.lua, but nothing seemed to stand out as an issue.

The only thing I can think of is that I changed some of the spell casting commands as they overwrote the vanilla spells.
I must have done something, because your spells work perfectly in the main campaign and in other mods. I have also looked at the fw.lua and fw_hooks.lua; but again, nothing stood out.
I'll keep looking.

Perhaps the issue is the 'owning a scroll' in order to cast it.
SpoilerShow
}

defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onCastSpell =
function(party,champion,spellName)
local itemName = "scroll_"..spellName
for i = 1, 32, 1 do
if champion:getItem(i) ~= nil and champion:getItem(i).go.name == itemName then
return true
end
end
hudPrint(champion:getName().." must possess the spell scroll to be able to cast it.")
return false
end
}
}
}

I added this to my init.lua, which may be the cause. If it is, do you have any recommendations on how to ensure the caster has the spell in their possession or can 'consume' the spell in order to cast it?
I have tried a few variations, but placing the scroll in a container doesn't seem to work - the caster needs the scroll in the inventory. I could list every spell as mentioned on this viewtopic.php?f=22&t=8365&hilit=own+a+scroll page, but that is pretty time consuming and I would rather a faster work-a-round.

Again, this is not your fault, but any help is appreciated.

Okay, back to work. :)
Mods - Isle of the Deranged & The Allure of Nightfall
http://grimrock.net/forum/viewtopic.php?f=23&t=9513
viewtopic.php?f=23&t=14762
Post Reply