Buffing monsters

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
bumbulator
Posts: 14
Joined: Sat Jan 30, 2021 2:49 am

Re: Buffing monsters

Post by bumbulator »

Yeah, I was thinking of using single-use crystals, too. :D

Okay, so I think I'll download Master Quest. If I want to tweak the monsters, how can I do that?
bumbulator
Posts: 14
Joined: Sat Jan 30, 2021 2:49 am

Re: Buffing monsters

Post by bumbulator »

Isaac wrote: Sat Jan 30, 2021 7:53 pm My first LoG2 game used the options of Ironman, and Single Use Crystals; that was quite an intense challenge for me. 8-)

For LoG2, it is —mostly— possible to upgrade the default monsters that are placed on the maps. This won't affect those that are dynamically created via scripts. It requires console access, and running a carefully formatted one line script.

It would entail iterating through every level, and altering every monster object via script.
If there is a guide or something that I can use for this, that would be amazing. :o
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Buffing monsters

Post by Isaac »

bumbulator wrote: Sat Jan 30, 2021 7:58 pm Okay, so I think I'll download Master Quest. If I want to tweak the monsters, how can I do that?
You can alter any monster definitions in the monsters.lua file, in the mod's scripts folder, and add/copy/paste/edit entries from the asset pack that are not in the mod's monsters.lua file.

*Each game has its own asset pack. :!:
LoG1: http://www.grimrock.net/modding/asset-pack/
LoG2: http://www.grimrock.net/modding/grimrock-2-asset-pack/

bumbulator wrote: Sat Jan 30, 2021 8:02 pm If there is a guide or something that I can use for this, that would be amazing. :o
There is no guide per se... but there is an updated scripting reference that lists what the many values mean, or at least what data is expected for them.

https://github.com/JKos/log2doc/wiki/
bumbulator
Posts: 14
Joined: Sat Jan 30, 2021 2:49 am

Re: Buffing monsters

Post by bumbulator »

Woah, cool. But you said there was a console script or something that I could run on each map but you haven't said how.
User avatar
7Soul
Posts: 199
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Buffing monsters

Post by 7Soul »

Here's an example you can paste into the console to increase all existing monster's hp by 20% (be sure there's a space after each line)

Code: Select all

local success 
for m=1,Dungeon.getMaxLevels() do 
	for ent in Dungeon.getMap(m):allEntities() do 
		if ent.monster then 
			local health = ent.monster:getMaxHealth() 
			ent.monster:setMaxHealth(health * 1.2) 
			ent.monster:setHealth(health * 1.2) 
			success = true 
		end 
	end 
end 
if success then print("Complete!") end
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Buffing monsters

Post by Isaac »

The console is disabled by default, so it must first be enabled to use it.

You must edit the game's .cfg file for this; usually found in \Documents\Almost Human\Legend of Grimrock , and similar for LoG2.

In grimrock.cfg, change : console = false to console = true.

Afterwards, in the game, you should be able to open the console during play. This allows for executing script commands during the game.

*This enables basically any kind of cheat too.

**Notice that in 7soul's code (as mentioned), that every line has a space behind it if another line follows it. Without this, the script won't run in the console as a single line—the lack of spaces would cause errors.
Last edited by Isaac on Sat Jan 30, 2021 8:28 pm, edited 1 time in total.
bumbulator
Posts: 14
Joined: Sat Jan 30, 2021 2:49 am

Re: Buffing monsters

Post by bumbulator »

Few questions:

1.) The code that 7Soul posted, would I have to paste that in each map or just once per playthrough?
2.) Is there one for enemy damage?
3.) Master Quest does not have a mod_asset folder in the default download but it does in the source folder. Where would I put the mod_asset folder? In the Dungeon folder in My Documents?
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Buffing monsters

Post by Isaac »

The code intends to update every map.

As for the Master Quest mod... to change it, you would load the source version, make your changes, then export it as a new mod, and play that one.
2.) Is there one for enemy damage?
See the afore-linked wiki.

https://github.com/JKos/log2doc/wiki/Co ... ncomponent

Code: Select all

ent.monster:setAttackPower(ent.monster:setAttackPower() * 1.2)
Last edited by Isaac on Sat Jan 30, 2021 8:35 pm, edited 1 time in total.
bumbulator
Posts: 14
Joined: Sat Jan 30, 2021 2:49 am

Re: Buffing monsters

Post by bumbulator »

"As for the Master Quest mod... to change it, you would load the source version, make your changes, then export it as a new mod, and play that one."

:shock:

How do I do this?
bumbulator
Posts: 14
Joined: Sat Jan 30, 2021 2:49 am

Re: Buffing monsters

Post by bumbulator »

By the way, for some reason, I am unable to edit Master Quest's monster.lua file. :(
Post Reply