Creating a whole party

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Creating a whole party

Post by Eleven Warrior »

Hi all.

I don't know if what I need is already in this forum. I need to create a starter party with 4 Rat champs with classes, stats, items on them etc... Can anyone tell me how I can do this yeah I know how to in log 1 but things have changed these days lol. Anyhow thxs for any help guys :)
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Creating a whole party

Post by Drakkan »

just disable all champions at the start of the game and then use party hiring script, which can be set to hire champions automaticaly.
viewtopic.php?f=22&t=8464&hilit=hire+party
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Creating a whole party

Post by Eleven Warrior »

Thxs Drakkan will do as you said and get back to you :)
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Creating a whole party

Post by minmay »

I don't think it is possible to create new champions properly in Grimrock 2 because there is no way I know of to decrease the experience level of a champion. So if a party is imported with characters that aren't level 1 (or whatever level you want your new party to start with) there is no way to fix their experience level, unlike in Grimrock 1 where you could use setClass() to reset to level 1.

Of course you can easily have the mod check whether the player has imported a party with level >1 characters and prevent them from playing if so, but this is far from ideal. Personally I would suggest that you just allow your players to cheat this way if they want to.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Creating a whole party

Post by Eleven Warrior »

Hi Minmay thxs for the reply mate.

Ok what I intend to do is when the game starts the player wont select champs they are already done. In log 1 you could say have every champ as a human etc.. with changed stats, level, equipment, names etc.. So basic champ not new created one just the ones that come with log 2 but I want to change some of the stats, dex, str, etc..numbers. Its like a pre-made party like you could do in log1.

I think I get what your saying so the method below would not be the same in log 2 I know so how do I go about the game starting with 4 rattling champs with different classes etc...??

This is from log 1 just a example or what I am after:

Code: Select all

----Starting with one Champ----

function initChampion()
    local i = party:getChampion(1)
	i:setName("Juhon")
    i:removeItem(7)
    i:removeItem(8)

   -- i:insertItem(8, spawn("empty_wine_bottle"))
	i:setRace("Human")
	i:setClass("Rogue")
	i:setSex("male")

	i:trainSkill("daggers", 4, true)
	i:trainSkill("athletics", 6, true)
	i:trainSkill("dodge", 3, true)
	i:trainSkill("throwing_weapons", 2, true)
	
	i:addTrait("athletic",true)
	i:addTrait("agile",true)
	
	i:setStatMax("health", 65)
	i:setStat("health", 65)
	i:setStatMax("energy", 52)
	i:setStat("energy", 52)
	i:setStat("strength", 16)
	i:setStat("dexterity", 15)

	i:setPortrait("mod_assets/textures/portraits/cano.tga")
	hudPrint("")
	hudPrint("")
	hudPrint("")
	hudPrint("")
	
	party:getChampion(2):setEnabled(false)
	party:getChampion(3):setEnabled(false)
	party:getChampion(4):setEnabled(false)
end
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Creating a whole party

Post by minmay »

Well for starters that LoG1 example doesn't work. At a minimum you need to reset all the champions' stats and traits; your script leaves them with their existing vitality, willpower, protection, evasion, and traits. You might find this an interesting read.

Anyway you would do it the same way you did in LoG1, by calling the various methods of the Champion class, except that you no longer need to worry about removing skill bonuses manually (they are all either traits, which you will remove anyway, or tied to the skill level) and you can no longer reset champions' level.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply