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!
So I looked everywhere but didnt find solution for this.
It would by nice to have sortiment of potions with temporary effect, like strenght, dextirity etc..
I know we have rage potion but its hard coded?
I tryed to come up with my own sript solution. This is what I have so far, but dont work
Champion gain +1 strengh but stat wont return to original value.
It should return to original value after 20 sec.
just an idea (maybe little "hard" solution, but could work)- what about just making regular potion to gain some stat (for example STR - champion:upgradeBaseStat("strength", 1) ) and put into onUse hook to activate ingame timer (for example called PluStrenght), which after time run out is going to activate another in-game script, which will decrease that stat (champion:upgradeBaseStat("strength", -1) . there need to be some checks which champion used that potion and to whom then decrease that stat, but you have the idea...
I was thinking about such solution, but it seems sooo complicated. Lets just say it wouldn't be ideal if you want to create many such different potions. Thats why I was trying doing it in single onUseItem function. Later I wanted to create trait/condition that indicate you have str potion effect on and prevent champion to drink more then one potion at one time.
isn't it possible to use delayedCall(self.go.id, <timeInSeconds>, <"Event"> )
THOM formaly known as tschrage _______________________________________________ My MOD (LoG1):Castle RingfortThread My MOD (LoG2):Journey To JusticeThread | Download
It is possible, only problem is to somehow identify champion who used potion and send values via delayedCall function to external script. Thats what Iam trying figuring right now
Thx Batty. With your help and inspirations of others I was able to solve it
Here is complete solution and example for adding +1 strenght to champion for 20 seconds.
function yourfunction(champ)
local ch = party.party:getChampion(champ)
local modi = ch:getBaseStat("strength")
local base = modi -1
ch:setBaseStat("strength",base)
end
Aisuu wrote:Thx Batty. With your help and inspirations of others I was able to solve it
Here is complete solution and example for adding +1 strenght to champion for 20 seconds.
function yourfunction(champ)
local ch = party.party:getChampion(champ)
local modi = ch:getBaseStat("strength")
local base = modi -1
ch:setBaseStat("strength",base)
end
could please somebody extend this script so it will return point to the champion which used the potion ? In case you move champion to some other slot, script does not detect it and return point to another one. thanks a lot