Page 1 of 2

A little script to change the default party.

Posted: Sat Sep 15, 2012 1:48 pm
by Magus
I think its pretty much self-explaining what it does :D

Code: Select all

--	Go to the bottom to set your default party.

function setParty(champID, champAllow, champName, champRace, champClass, champGender, champPortrait)
	if champAllow ~= true then
		party:getChampion(champID):setEnabled(champAllow)
	end
	if champName then
		party:getChampion(champID):setName(champName)
	end
	if champRace then
		party:getChampion(champID):setRace(champRace)
	end
	if champClass then
		party:getChampion(champID):setClass(champClass)
	end
	if champGender then
		party:getChampion(champID):setSex(champGender)
	end
	if champPortrait then
		party:getChampion(champID):setPortrait(champPortrait)
	end
end

--[[		Use the setParty(ID,ENABLE,NAME,RACE,CLASS,GENDER,PORTRAIT)
		Use "nil" without the quotes to keep the default value.
		Feel free to use it in your map without giving credits.
	ID		-	Which champion should be changed. 1=topleft, 2=topright etc...
	ENABLE	-	Enables(true) or disables(false) the champion.
	NAME	-	Changes the name of the Champion (Strings have " in the beginning and at the end.)
	RACE	-	Changes the race: "Human", "Minotaur" or "Lizardman"
	CLASS	-	Changes the class: "Fighter", "Rogue" or "Mage"
	GENDER	-	Changes the sex: "male" or "female" (keep it lowercase!)
	PORTRAIT	-	Changes the portrait of the champion
]]--

setParty(1,true,"ContarStonesKull","Human","Fighter","male", nil)
setParty(2,true,"Mork","Minotaur","Fighter","male", nil)
setParty(3,true,"Yennica Whitefeather","Human","Rogue","female", nil)
setParty(4,true,"Sancsaron","Human","Mage","male", nil)
EDIT: I think there is no way to edit the profile though.
EDIT2: Added potrait but set it to nil in the example, I don't know the filenames etc (thanks Emciel)

Re: A little script to change the default party.

Posted: Sat Sep 15, 2012 2:37 pm
by Emciel
if by profile you mean the picture,
couldn't you add another parameter of champPic and add another line

Code: Select all

if champPic then
party:getChampion(champID):setPortrait(champPic)
end
champPic being your tga file in mod assets

Re: A little script to change the default party.

Posted: Sat Sep 15, 2012 2:41 pm
by Magus
oh there is a setPotrait function. Didn't see that hahaha

thanks i'll fix that

Re: A little script to change the default party.

Posted: Sat Sep 15, 2012 3:02 pm
by Montis
cool, I meant to write something like that, I guess I don't need to anymore :D

Re: A little script to change the default party.

Posted: Sat Sep 15, 2012 4:59 pm
by Emciel
setPortrait, not setPotrait =)
just incase people directly copy out that code ^_^

Re: A little script to change the default party.

Posted: Sat Sep 15, 2012 5:04 pm
by Magus
Ops, thanks again^^

fixed it

Re: A little script to change the default party.

Posted: Sun Sep 16, 2012 6:43 pm
by Starnice
You do not know the name of the original portraits? And where to put new portraits in our mod?
This is for use in this great script of course.

Re: A little script to change the default party.

Posted: Sun Sep 16, 2012 6:51 pm
by Magus
You need to place them in "mod_assets" guess you could make a portrait folder to organize it better.
And for the default portraits I have no clue where they are stored.

Re: A little script to change the default party.

Posted: Sun Sep 16, 2012 8:28 pm
by Starnice
Thanks for the answer!

But, I can not do it ...

Whatever the place where I put my picture in the folder mod_assets (or its subfolders) in. Tga or. Dds (or both), that it makes me not found...

I note that creating a mage lizardman in slot 2 (with portrait : nil), I have a portrait of minotaur with the name I have indicated, the skills of a mage, but the traits and strength, dexterity, vitality and the Minotaur willpower (by choosing one lizardman)

Re: A little script to change the default party.

Posted: Sun Sep 16, 2012 8:43 pm
by Magus
Sets the image file to be used as champion’s portrait. The portrait must be a valid TGA file of size 128*128 pixels.
The file must be located in “mod_assets” folder or contained in the base game archive.
Thats whats the scripting reference says. Don't know if that works.
Starnice wrote:I note that creating a mage lizardman in slot 2 (with portrait : nil), I have a portrait of minotaur with the name I have indicated, the skills of a mage, but the traits and strength, dexterity, vitality and the Minotaur willpower (by choosing one lizardman)
Yeah i think you need to change the traits/stats manually. I could add them in the script but I don't know the stats of every class/race