Page 2 of 2

Re: A little script to change the default party.

Posted: Sun Sep 16, 2012 9:06 pm
by Magus
i'll rewrite this script with more options (including setting stats based on class/race automatically) but i don't see any functions to change traits

Re: A little script to change the default party.

Posted: Sun Sep 16, 2012 9:42 pm
by jagintedu
Hi, great code but im having some troubles with it. im trying to implement this code so that i can go on a switch and get a new party member. First problem was that i had to edit the code for the false statement to work. my lua is quiet bad but if i understand:

Code: Select all

   if champAllow then
      party:getChampion(champID):setEnabled(champAllow)
if set to false then the get id and set enabled will not run.
2nd problem is that now that i have managed to (with bad coding) get 1 party member instead of 4,
when i try to setparty with a champion ID of 2 it doesnt give a champion at all. is it doable and im doing it wrong or does this code only work as a startup function?

Re: A little script to change the default party.

Posted: Sun Sep 16, 2012 10:22 pm
by Magus
Ah sry I made a mistake, the if statement champAllow didn't run if you type false in the function, so he didn't remove the champion hahaha
fixed that. (thanks for finding it out)

The code automatically runs once the game starts, you need no buttons/other scripts for it.
If you want to change all(or only one) champion after a button press you need to make a function and run this function with a button.
For example:

Code: Select all

function changeChampion()
	setParty(3,true,"Awesome Minootaur Name","Minotaur","Mage","male", nil)
end
And link a button to this script (and select this function in the action tab)

Re: A little script to change the default party.

Posted: Mon Sep 17, 2012 2:20 am
by jagintedu
Thanks i figured out that i could nestle the functions and use buttons to fix it. next problem is that i cannot for the life of me figure out how to use the portrait function. i keep gettin errors when ive downloaded custom log portraits. ive tried out most things calling it "x.tga" and getting a error dds message in return. do you know how the portrait functions work?

Re: A little script to change the default party.

Posted: Mon Sep 17, 2012 2:41 am
by Komag
Hey Magus, this is awesome stuff, could you add this (if you're done with it) to the "Useful scripts repository" thread?
viewtopic.php?f=14&t=3099&start=30

Re: A little script to change the default party.

Posted: Mon Sep 17, 2012 9:25 am
by Magus
jagintedu wrote:Thanks i figured out that i could nestle the functions and use buttons to fix it. next problem is that i cannot for the life of me figure out how to use the portrait function. i keep gettin errors when ive downloaded custom log portraits. ive tried out most things calling it "x.tga" and getting a error dds message in return. do you know how the portrait functions work?
Sorry, I have no clue how the potraits work.

Komag wrote:Hey Magus, this is awesome stuff, could you add this (if you're done with it) to the "Useful scripts repository" thread?
viewtopic.php?f=14&t=3099&start=30
Yeah but I'll upload a newer version where you can change their equipment/stats etc...
And i'll also add some extra functions like (enable/disable this script without deleting it, enable/disable it if the player use the default (not custom made) party or set the stats(strength, vitality, ...)
based on the race(and for health based on class and race)).

Re: A little script to change the default party.

Posted: Mon Sep 17, 2012 9:27 am
by antti
Cool stuff! One feature that some folks might find useful could be the ability to disable champions. :)