A little script to change the default party.
Re: A little script to change the default party.
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:
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?
Code: Select all
if champAllow then
party:getChampion(champID):setEnabled(champAllow)
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.
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:
And link a button to this script (and select this function in the action tab)
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
Re: A little script to change the default party.
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.
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
viewtopic.php?f=14&t=3099&start=30
Finished Dungeons - complete mods to play
Re: A little script to change the default party.
Sorry, I have no clue how the potraits work.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?
Yeah but I'll upload a newer version where you can change their equipment/stats etc...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
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.
Cool stuff! One feature that some folks might find useful could be the ability to disable champions.
Steven Seagal of gaming industry