AI Switcher

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Damonya
Posts: 134
Joined: Thu Feb 28, 2013 1:16 pm
Location: France
Contact:

Re: AI Switcher

Post 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?
Orwak - MOD - Beta version 1.0
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: AI Switcher

Post 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.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: AI Switcher

Post by Diarmuid »

So you're killing and respawning monsters with different definitions? Cool idea!
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: AI Switcher

Post 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.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: AI Switcher

Post 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) ;)
I'm the Gate I'm the Key.
Dawn of Lore
flatline

Re: AI Switcher

Post 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!
User avatar
Damonya
Posts: 134
Joined: Thu Feb 28, 2013 1:16 pm
Location: France
Contact:

Re: AI Switcher

Post 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.
Orwak - MOD - Beta version 1.0
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: AI Switcher

Post 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:
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: AI Switcher

Post 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.
Finished Dungeons - complete mods to play
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: AI Switcher

Post 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.
Post Reply