Page 1 of 1

Changing Condition of champion in script.

Posted: Sun Jan 13, 2013 7:40 pm
by vidarfreyr
I'm having some trouble getting this to work. I want the party to become invisible when a button is pressed or maybe make an item with charges. Only I'm not sure how to use the 'setConditions' command. This does not work:

Code: Select all

function invisigive()
	Party:setCondition(invisible)
end

Re: Changing Condition of champion in script.

Posted: Sun Jan 13, 2013 11:48 pm
by Komag
you have to do each champion individually, and put the condition in quotes

Re: Changing Condition of champion in script.

Posted: Mon Jan 14, 2013 1:16 am
by vidarfreyr
Thanks! Also turns out the condition name is "invisibility" not "invisible". So my completed script for a button that gives invisibility is like so.

Code: Select all

function invisigive()
     for i = 1,4 do
	   	hasInvisi = party:getChampion(i)
   		hasInvisi:setCondition("invisibility",120)
     end
end
Now I just need to figure out how to make some magical flash or other effect appear at the same time to indicate the change.

Re: Changing Condition of champion in script.

Posted: Mon Jan 14, 2013 1:35 am
by Komag
glad you got figured out! you can put it all on one line

for i=1,4 do party:getChampion(i):setCondition("invisibility",120) end

or

for i=1,4 do
party:getChampion(i):setCondition("invisibility",120)
end

for the light you'll want a short-lived fx spawned in. You could also play a magic sound.