Changing XP gain of monstergroup component

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
Scotty
Posts: 69
Joined: Fri Nov 07, 2014 2:59 pm

Changing XP gain of monstergroup component

Post by Scotty »

To change the xp gained for killing a monster is simply:

Code: Select all

monster_1.monster:setExp(1000)
But there is apparently no such function for setting xp gain if you're dealing with a monstergroup instead. Does anyone know of a workaraound? Is there someway of addressing each monster in a group seperately?
cameronC
Posts: 80
Joined: Wed Apr 11, 2012 10:54 pm

Re: Changing XP gain of monstergroup component

Post by cameronC »

Don't you gain exp after killing each individual monster in the group? So the group itself doesn't have a set amount of exp, but the individual monsters do? So you just have to change the exp of the monsters in the group?
Writer and sometimes artist of the very slightly acclaimed comic series Scrambled Circuits. A comic series about a robot written by a human.

Grimrock 2 socketSystem: viewtopic.php?f=22&t=8546 / Github
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Changing XP gain of monstergroup component

Post by minmay »

Monster groups just spawn individual monsters. The monster group object doesn't really exist at runtime. You have to change the individual monsters.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply