Page 270 of 396
Re: Ask a simple question, get a simple answer
Posted: Sat Nov 24, 2018 1:24 am
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.
Re: Ask a simple question, get a simple answer
Posted: Sat Nov 24, 2018 1:42 am
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!
Re: Ask a simple question, get a simple answer
Posted: Fri Nov 30, 2018 2:23 pm
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( )
Re: Ask a simple question, get a simple answer
Posted: Fri Nov 30, 2018 2:53 pm
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
Re: Ask a simple question, get a simple answer
Posted: Fri Nov 30, 2018 3:56 pm
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...
Re: Ask a simple question, get a simple answer
Posted: Sun Dec 02, 2018 4:43 pm
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)
Re: Ask a simple question, get a simple answer
Posted: Sun Dec 02, 2018 6:47 pm
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
Re: Ask a simple question, get a simple answer
Posted: Sun Dec 02, 2018 9:01 pm
by THOM
Ah - yes. "the other way round"...
Works great. - Thanks!
Re: Ask a simple question, get a simple answer
Posted: Mon Dec 03, 2018 12:14 am
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.
Re: Ask a simple question, get a simple answer
Posted: Mon Dec 03, 2018 11:58 am
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.