Page 2 of 4

Re: AI Switcher

Posted: Sun Apr 21, 2013 12:56 pm
by Damonya
Very good job. I love your AI switcher and I will use.

Just may be otherwise specified in aiswitcher.lua

Code: Select all

   onProjectileHit = function(champ, proj, damage, damtype)
			if ((aiswitcher ~= nil) and (aiswitcher.onTick ~= nil)) then 
				return aiswitcher.onPartyProjectileHit(champ, proj, damage, damtype)
			end		
		end,
must be elsewhere, if you have already party hook. Perhaps the same with onDrawGui?

Re: AI Switcher

Posted: Sun Apr 21, 2013 10:36 pm
by JKos
Really nice job Xanathar and Leki, I'm surprised that respawning the monster doesn't seem to cause any noticeable visual glitches. And thanks for making it compatible with my framework, I updated the LoG framework already right after I made the changes you needed, so the newest released version should work with this.

@Damonoya, you can just copy-paste that piece of code to your party.onProjectileHit method or use my framework which makes defining multiple party.onProjectileHit-hooks (or other hooks) possible.

Re: AI Switcher

Posted: Mon Apr 22, 2013 5:38 pm
by Diarmuid
So you're killing and respawning monsters with different definitions? Cool idea!

Re: AI Switcher

Posted: Mon Apr 22, 2013 9:53 pm
by Xanathar
Thanks Jkos!

I was very surprised too that the transition is so smooth - actually I was expecting a total pain to synchronize the transition and it happened to be very smooth on first try. The only trick, is I use onDrawGui to postpone to the end of the frame the destroy/respawn because destroying the monsters in a hook crashes the game.

Re: AI Switcher

Posted: Tue Apr 23, 2013 12:45 pm
by Leki
Diarmuid wrote:So you're killing and respawning monsters with different definitions? Cool idea!
Yes it is :twisted:

And the best think is that you can improve it to push game experience over the limits:
You can do damage on in script defined cells + show to player "as attack looks", but in script defined as idle animation of monster ( because idle is default anim on spawn(guard)). It means that idle anim replaces attack anim, and damage is distributed through cells.
And now you can imagine 15 meters tall giant hits ground area with his fists or earthquake steps or dragon attacking with claws or jaw or AOE dragon breath :twisted:
I have finished some part of specification, but I am busy at work in this days, so please be patient (or try to do your own spec in some shared google doc etc) ;)

Re: AI Switcher

Posted: Tue Apr 23, 2013 10:21 pm
by flatline
Leki wrote:
Diarmuid wrote:So you're killing and respawning monsters with different definitions? Cool idea!
Yes it is :twisted:

And the best think is that you can improve it to push game experience over the limits:
You can do damage on in script defined cells + show to player "as attack looks", but in script defined as idle animation of monster ( because idle is default anim on spawn(guard)). It means that idle anim replaces attack anim, and damage is distributed through cells.
And now you can imagine 15 meters tall giant hits ground area with his fists or earthquake steps or dragon attacking with claws or jaw or AOE dragon breath :twisted:
I have finished some part of specification, but I am busy at work in this days, so please be patient (or try to do your own spec in some shared google doc etc) ;)
That's bloody clever. I gotta get modding again, the opportunities are so many!

Re: AI Switcher

Posted: Tue May 07, 2013 9:13 pm
by Damonya
Strange behavior with that was reported to me by my tester with a created monster using AI Switcher:
When you start by attacking with thrown weapons, they disappear with the death of the snail, or at least a portion (sometimes I can get one of my two throwing knives, but I lose the other and the shuriken).

Ditto if you start by attacking with Melee Weapons: I think you lose all throwing weapons that were used between from the beginning of the fight and when the snail inflicts an injury to a member of your group.
In French (because my tester wrote in french) :
SpoilerShow
Lorsque tu commences par les attaquer avec des armes de jet, celles-ci disparaissent à la mort de l'escargot, ou une partie du moins (je peux parfois récupérer l'un de mes deux couteaux de lancer, mais je perds l'autre ainsi que le shuriken).

Idem si tu commences par les attaquer avec des armes de mêlée : il me semble que tu perds toutes les armes de lancer qui ont été utilisées entre le début du combat et le moment où l'escargot inflige une blessure à l'un des membres de ton groupe. Mais comme j'ai beaucoup de mal à circonstancier le phénomène avec précision, je crois que le mieux est que je t'envoie ma sauvegarde pour que puisses voir par toi-même ce qu'il en est.
I don't have time to test it myself right now.

Re: AI Switcher

Posted: Tue May 07, 2013 9:45 pm
by Xanathar
Damn, this makes sense.. and I have no idea how to solve it easily (I have ideas about how to solve the hard way though). :cry:

Re: AI Switcher

Posted: Tue May 07, 2013 10:51 pm
by Komag
You can take a look at my snail king fight code (in snailWallScript on level 7) which solves this by counting all projectiles (they don't all count the same way either) and spawning the ones that are stuck "inside" the monster on the floor at the time of "teleport" or destroying the monster. I used onDie and onProjectileHit hooks. Part of the code has to account for possible "mouse thrown" projectiles which don't stick but do register as projectile hits.

Re: AI Switcher

Posted: Wed May 08, 2013 2:03 am
by Diarmuid
You can also check my script here, the "Arrow Tracker" : viewtopic.php?f=14&t=4421. I developed it so that we could use custom arrows which don't revert to standard arrows, and it uses similar techniques to Komag's script above. Note that checking what a monster drops on its death square is not enough, as sometimes monsters die while attacking and being between two squares, so the item might end on the adjacent one.