Ask a simple question, get a simple answer

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!
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

THOM wrote: Sat Nov 24, 2018 1:08 am Is there a way to let a champion starve?

I can surely alter his food value by using
:setFood(amount)
:modifyFood(food)

but that doesn't seem to affect the food bar. It doesn't change...
Works for me.

Code: Select all

function setFoodBar()
	local champion = party.party:getChampion(1)
	
	champion:setFood(0)
end
Connect this function to a pressure plate.
Immediately sets the food bar to 0 and displays the "hungry" icon.
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

strange.

this is of course my first atempt also. But I did it as a starting function. This doesn't work. If I put it into a function and trigger it by a device it works.

:?:

Anyway. Danke!
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

THOM wrote: Sat Nov 24, 2018 1:42 am strange.

this is of course my first atempt also. But I did it as a starting function. This doesn't work. If I put it into a function and trigger it by a device it works.

:?:

Anyway. Danke!
Was the starting function called with a Delay Call (set to something like 0.1) ?
If not, do try using a delayedCall( ) ;)
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

akroma222 wrote: Fri Nov 30, 2018 2:23 pm
THOM wrote: Sat Nov 24, 2018 1:42 am strange.

this is of course my first atempt also. But I did it as a starting function. This doesn't work. If I put it into a function and trigger it by a device it works.

:?:

Anyway. Danke!
Was the starting function called with a Delay Call (set to something like 0.1) ?
If not, do try using a delayedCall( ) ;)
Or a self-deactivating floor trigger at the starting location :)
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

It works fine with a floortrigger.

It didn't worked as an open function to be triggered at start. But as akroma222 said: It's probably a matter of a missing delay...

Got it to work as intended meanwhile...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Is it possible to get the position of a given champion?

I want to swap the position of on champ - I have his odinal number - do I get somehow his position?

I need it for to use party.part:swapChampions(i, j)
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

THOM wrote: Sun Dec 02, 2018 4:43 pm Is it possible to get the position of a given champion?

I want to swap the position of on champ - I have his odinal number - do I get somehow his position?

I need it for to use party.part:swapChampions(i, j)

Code: Select all

ordinal = 1

function test()
	for i = 1, 4 do
		local champion = party.party:getChampion(i)
		if champion and (champion:getOrdinal() == ordinal) then
			print("index = " .. tostring(i))
			break
		end
	end
end
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Ah - yes. "the other way round"...

Works great. - Thanks!
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Killcannon
Posts: 73
Joined: Sun Apr 12, 2015 2:57 pm

Re: Ask a simple question, get a simple answer

Post by Killcannon »

To piggy back on the food question. Is there a way to 'lock' a champions food bar, until say an item is used or spell is cast? For example a 'curse of hunger' until remove curse is cast. Could also work in the opposite with an elixir of plenty where it stops champions decay for a period of time.
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

The multiple magic school spell pack from andakrainor has a custom spell called feast.
For 30 seconds your food bar will slowly regenerate.

Perhaps you can use this info to create this into a negative condition where it will deplete your food bar instead of regenerate for xx amount of time.
Post Reply