Scripting help request: Party Switch

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Thread
Posts: 6
Joined: Thu Nov 29, 2012 10:35 am

Scripting help request: Party Switch

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

Re: Scripting help request: Party Switch

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