[Script] SetDefaultParty (SDP)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: [Script] SetDefaultParty (SDP)

Post by Neikun »

HaunterV wrote:
Montis wrote:
Starnice wrote:Did you find a way to choose the traits?
I don't think there's a (documented) way to do this. -> Feature request!

custom traits just out of reach!
I want a Butterfingers trait where you drop a wepon on a 15% chance, counterbalanced by an additional +2 to all stats except dex.
This makes me picture a greasy Hulk Hogan D:
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Shloogorgh
Posts: 45
Joined: Sat Sep 22, 2012 12:24 am

Re: [Script] SetDefaultParty (SDP)

Post by Shloogorgh »

by the way, there's a small error several times in the code relating to the player 1 character. You have his name as ContarStonesKull, when it should be Contar Stoneskull. This is only a problem if you want to use the sdpUseDefaultOnly, which only turns on sdp if the player is using the default party. Well, sdp won't realize you're using the default party with the incorrect name, so the whole script ceases to function.

Code: Select all

if sdpEnable then
   if sdpUseDefaultOnly and party:getChampion(1):getName() == "ContarStonesKull" then
      setDefaultParty()
   elseif sdpUseDefaultOnly == false then
      setDefaultParty()
   end
end
User avatar
Huff
Posts: 18
Joined: Fri Jun 22, 2012 9:47 pm

Re: [Script] SetDefaultParty (SDP)

Post by Huff »

Dex and Willpower are not properly working on champion #2. Seems to keep using Mork's default stats for that.
I simply used this to override it.

Code: Select all

party:getChampion(2):setStat("dexterity", 10)
party:getChampion(2):setStat("willpower", 10)
User avatar
Trap
Posts: 67
Joined: Mon Sep 24, 2012 2:09 am

Re: [Script] SetDefaultParty (SDP)

Post by Trap »

HaunterV wrote:
Montis wrote:
Starnice wrote:Did you find a way to choose the traits?
I don't think there's a (documented) way to do this. -> Feature request!

custom traits just out of reach!
I want a Butterfingers trait where you drop a wepon on a 15% chance, counterbalanced by an additional +2 to all stats except dex.
haha.. or 15% chance the weapon slips from your hands and gets launched at the monster as well as damaging yourself. ;p
tymur
Posts: 27
Joined: Fri Jan 25, 2013 7:22 pm

Re: [Script] SetDefaultParty (SDP)

Post by tymur »

Hello, nice work.
I have question: How can I set default party (for example enable char 1 and other disable) and change it later (some chcarter will be found in the dungeon)?
Thanx a lot.
tymur
Posts: 27
Joined: Fri Jan 25, 2013 7:22 pm

Re: [Script] SetDefaultParty (SDP)

Post by tymur »

No one can help me?
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: [Script] SetDefaultParty (SDP)

Post by Komag »

It's in the scripting reference:
http://www.grimrock.net/modding/scripting-reference/
Champion:setEnabled(enabled)
Enables or disables the champion. A disabled champion is essentially an empty party slot.
You use it like:

Code: Select all

party:getChampion(2):setEnabled(false)
or

Code: Select all

for i=2,4 do party:getChampion(i):setEnabled(false) end
or

Code: Select all

party:getChampion(2):setEnabled(true)
Finished Dungeons - complete mods to play
tymur
Posts: 27
Joined: Fri Jan 25, 2013 7:22 pm

Re: [Script] SetDefaultParty (SDP)

Post by tymur »

Komag wrote:It's in the scripting reference:
http://www.grimrock.net/modding/scripting-reference/
Champion:setEnabled(enabled)
Enables or disables the champion. A disabled champion is essentially an empty party slot.
You use it like:

Code: Select all

party:getChampion(2):setEnabled(false)
or

Code: Select all

for i=2,4 do party:getChampion(i):setEnabled(false) end
or

Code: Select all

party:getChampion(2):setEnabled(true)

Thank You very much, its working! I try it previous, but I isn't working, may by I write something wrong. Thank you again.
tymur
Posts: 27
Joined: Fri Jan 25, 2013 7:22 pm

Re: [Script] SetDefaultParty (SDP)

Post by tymur »

Did anyone try to use custom portraits?
In editor, work perfect, but if I export dungeon and try play normally, the portraits are used defaults, not what I set...
tymur
Posts: 27
Joined: Fri Jan 25, 2013 7:22 pm

Re: [Script] SetDefaultParty (SDP)

Post by tymur »

tymur wrote:Did anyone try to use custom portraits?
In editor, work perfect, but if I export dungeon and try play normally, the portraits are used defaults, not what I set...
II solved it, the portraits must be in .dds, not in .tga. :)
Post Reply