Wizard Clone Selective set up

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!
Post Reply
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Wizard Clone Selective set up

Post by Emera Nova »

So I'd like to prevent the wizard clones from having the full fire power of the main wizard. The spell I'd like them to use is the ice shards attack only. I was looking at the coding for the main wizard and saw this.

Code: Select all

if not self.go.map:isBlocked(x, y, self.go.elevation) and self.go.elevation == self.go.map:getElevation(x, y) then
							local obj = self.go:spawn("wizard_clone")
							obj.mirrorImage:disable()
							obj.castShield:disable()
							obj.brain:performAction("warp", x, y, i + 2)
						end
My question is if I put obj.rangedAttack:disable() will that prevent the clones from being able to use the ranged attacks and force them to default to the shard spell instead? I feel like it should since the clones themselfs don't mirrorimage and this code snipit is saying to disable that.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Wizard Clone Selective set up

Post by Isaac »

This seems to work for me...

Code: Select all

    defineObject{
       name = "wizard_clone",
       baseObject = "wizard",
       components = {
          {
             class = "Monster",
             meshName = "wizard_mesh",
             hitSound = "wizard_hit",
             dieSound = "wizard_clone_die",
             hitEffect = "hit_dust",
             deathEffect = "wizard_death",
             capsuleHeight = 0.8,
             capsuleRadius = 0.25,
             collisionRadius = 0.8,
             health = 100,
             protection = 0,
             immunities = { "sleep", "blinded", "knockback" },
          },   
          {
             class = "MonsterAttack",
             name = "rangedAttack",
             attackPower = 40,
             cooldown = 6,
             animation = "castSpell",
             sound = "wizard_ranged_attack",
             onInit = function(self)
                self.go.rangedAttack:disable()  --<<<<<<<<<<<<<<<<
             end,
          },
	{
			class = "MonsterAction",
			name = "mirrorImage",
			animation = "mirrorImageSpell",
			cooldown = 50,
			onInit = function(self)
				self.go.mirrorImage:disable()  --<<<<<<<<<<<<<<<<
			end,
	},
   },
}
**However... I think they need more actions than just melee and iceShards. Have you thought to just lower the rangedAttack spell power damage?
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Re: Wizard Clone Selective set up

Post by Emera Nova »

Quite good ye!

And It's understandable the wondering of why I'd only want it to be melee and the ice shards. The fight I plan for these guys to be in isn't going to be over rather quick. So the number of these guys will stack up over time. Plus my boss fights always have secondary effects that get played in that have to do with the arena.

Depending on how everything looks and runs after its all set I'll start adding back in different things.
Post Reply