Increase the ATTACKPower

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

Increase the ATTACKPower

Post by Emera Nova »

So I'm attempting to work on a script that would check for the value of a counter and then set that value as an monsters attack power value. Listed below is my attempt to stab in the dark and figure out how to do it. It doesn't seem to like what I put in for the setattackpower value so gonna need to figure out how to get it to take in the counters value.

Code: Select all

function settehpower()
local x = counter_57.counter:getValue()
if findEntity("mummy_1") ~= nil then
	mummy_1.monster:setAttackPower(x)
end
end
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Re: Increase the ATTACKPower

Post by Emera Nova »

xD tried this, this doesn't work either..

Code: Select all

function settehpower()
if findEntity("mummy_1") ~= nil then
mummy_1.monster:setAttackPower(counter_57.counter:getValue())
end
end
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Increase the ATTACKPower

Post by petri »

You're trying to set the monster's attack power but monsters don't have attack power. Instead the different attacks they have, have attack powers. For example, if you want to set mummy's basic attack's attack power:

Code: Select all

mummy_1.basicAttack:setAttackPower(100)
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Re: Increase the ATTACKPower

Post by Emera Nova »

I was wondering if that was going to be an issue or not.. xD guess I'll try that later today once I'm back on grimrock working.
Post Reply