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

Re: A little script to change the default party.

Post 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
jagintedu
Posts: 5
Joined: Mon Apr 16, 2012 8:37 pm

Re: A little script to change the default party.

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

Re: A little script to change the default party.

Post 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)
jagintedu
Posts: 5
Joined: Mon Apr 16, 2012 8:37 pm

Re: A little script to change the default party.

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

Re: A little script to change the default party.

Post 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
Finished Dungeons - complete mods to play
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: A little script to change the default party.

Post 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)).
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: A little script to change the default party.

Post by antti »

Cool stuff! One feature that some folks might find useful could be the ability to disable champions. :)
Steven Seagal of gaming industry
Post Reply