Page 1 of 1

Scripting help request: Party Switch

Posted: Sat Jan 05, 2013 8:12 am
by Thread
Hi guys, I'm wrestling with some scripting, and I can't help but think I'm going about this all wrong.

Code: Select all

function talk()
	hudPrint("Elsin: You did it! I'll come with you for now.")
		Elsin:destroy()
	end
	
function switch()
	party:getChampion(4):setName("Elsin")
	party:getChampion(4):setPortrait("mod_assets/textures/Elsin.tga")
	party:getChampion(4):setClass("Rogue")
	party:getChampion(4):trainSkill("missile_weapons", 12, false)
end
What I've done here is taken the fourth member of the party and modified him to make a new character. The issue is I obviously can't recall the original character. Like I say, I can't help but think I'm going about this all wrong. Is there a way to define a champion and save champions so I can chop and change when I need to?

Help is much appreciated.

Re: Scripting help request: Party Switch

Posted: Sat Jan 05, 2013 1:23 pm
by Komag
You would have to save all the properties of the original champion (there are a lot of them!), or at least the ones you want to temporarily change, saving the info to a table, then you can restore them later from the table info