A little script to change the default party.

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

A little script to change the default party.

Post 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)
Last edited by Magus on Sun Sep 16, 2012 10:26 pm, edited 7 times in total.
User avatar
Emciel
Posts: 34
Joined: Fri Sep 14, 2012 2:19 am

Re: A little script to change the default party.

Post 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
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: A little script to change the default party.

Post by Magus »

oh there is a setPotrait function. Didn't see that hahaha

thanks i'll fix that
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: A little script to change the default party.

Post by Montis »

cool, I meant to write something like that, I guess I don't need to anymore :D
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Emciel
Posts: 34
Joined: Fri Sep 14, 2012 2:19 am

Re: A little script to change the default party.

Post by Emciel »

setPortrait, not setPotrait =)
just incase people directly copy out that code ^_^
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: A little script to change the default party.

Post by Magus »

Ops, thanks again^^

fixed it
User avatar
Starnice
Posts: 13
Joined: Thu Sep 13, 2012 7:08 pm
Contact:

Re: A little script to change the default party.

Post 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.
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: A little script to change the default party.

Post 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.
User avatar
Starnice
Posts: 13
Joined: Thu Sep 13, 2012 7:08 pm
Contact:

Re: A little script to change the default party.

Post 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)
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: A little script to change the default party.

Post 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
Post Reply