Changing Condition of champion in script.

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
vidarfreyr
Posts: 71
Joined: Sat Oct 20, 2012 4:40 am

Changing Condition of champion in script.

Post 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
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Changing Condition of champion in script.

Post by Komag »

you have to do each champion individually, and put the condition in quotes
Finished Dungeons - complete mods to play
User avatar
vidarfreyr
Posts: 71
Joined: Sat Oct 20, 2012 4:40 am

Re: Changing Condition of champion in script.

Post 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.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Changing Condition of champion in script.

Post 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.
Finished Dungeons - complete mods to play
Post Reply