XP from monsters for whole party?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Aexrael
Posts: 12
Joined: Thu Sep 13, 2012 11:02 am

XP from monsters for whole party?

Post by Aexrael »

In the base game monsters give XP only to party members which successfully deal damage, is this hardcoded in the engine or is it something like monsters are coded that way and it could be overwritten via scripts?
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: XP from monsters for whole party?

Post by petri »

Easily doable with custom onDie hook
Aexrael
Posts: 12
Joined: Thu Sep 13, 2012 11:02 am

Re: XP from monsters for whole party?

Post by Aexrael »

Good to know, thanks Petri.
User avatar
Huff
Posts: 18
Joined: Fri Jun 22, 2012 9:47 pm

Re: XP from monsters for whole party?

Post by Huff »

Hey, I managed to get a working script for this.

Code: Select all

-- Fixed EXP monsters
cloneObject
{
	name = "snail",
	baseObject = "snail",
	exp = 0,
	onDie = function(self, dir)
		party:getChampion(1):gainExp(60)
		party:getChampion(2):gainExp(60)
		party:getChampion(3):gainExp(60)
		party:getChampion(4):gainExp(60)
	end
}
I ran into one minor issue though. When a monster is killed, the "+ XP" display in-game will show up as 0 because it's still attached to the exp = function.

Image

Is there a better way to write my script, or a way to get a hook on the "+ XP" in-game display?
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: XP from monsters for whole party?

Post by cromcrom »

Try this

Code: Select all

cloneObject
{
   name = "snail",
   baseObject = "snail",
   exp = 0,
   onDie = function(self, dir)
      for i=1,4 do
      party:getChampion(i):gainExp(60)
      end
   end,
}
A trip of a thousand leagues starts with a step.
User avatar
Huff
Posts: 18
Joined: Fri Jun 22, 2012 9:47 pm

Re: XP from monsters for whole party?

Post by Huff »

Edit:
While that does clean up my code a bit, it still doesn't solve that display issue.
Post Reply