adding a party member further into the dungeon

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Shloogorgh
Posts: 45
Joined: Sat Sep 22, 2012 12:24 am

adding a party member further into the dungeon

Post by Shloogorgh »

I had an idea for a dungeon where you start off with 1 character, but encounter other characters down the line to add to your party.

I tried testing this out but I've hit a wall. I tested this two ways. One way was to limit the starting party via the SetDefaultParty Script and the other was to enter the dungeon with Toorum mode activated.

Basically, the test dungeon has a room with a skeletal warrior behind a portcullis, and when you step on a hidden plate a script checks if your player 1 slot is open or not. If you open the portcullis and your slot is full, he requests to have his soul freed (and it's an easy kill since it's a clone with 1 hitpoint, and he's in guard mode so he never attacks first)

But if you open the portcullis and your slot is open, then he joins it. Or he would, if the game didn't give the error "bad argument #1 to 'setEnabled' (boolean expected, got nil)"

Is there anyway to get around this? I assume it stems from confusion between one script (setdefault party and toorum mode) telling it to disable a champion while this script is telling it to enable a champion.

Maybe this is could be a function that runs within the setdefaultparty that is activated by stepping on that hidden plate? Hmm...

Here's the code:

Code: Select all

function lever1()
	if counter_1:getValue() == 0 then 
		if party:getChampion(1):getEnabled() == false or party:getChampion(2):getEnabled() == false or party:getChampion(3):getEnabled() == false or party:getChampion(4):getEnabled() == false then
		hudPrint("Give me freedom!")
	else
		hudPrint("Destroy me! Free my soul!")
	end
	else
	if door1:isOpen() then
		if party:getChampion(1):getEnabled() == false then
		hudPrint("I will accompany you...")
		party:getChampion(1):setEnabled(true)
		party:getChampion(1):setName("Miraja Fantoon")
		party:getChampion(1):setRace("Human")
		party:getChampion(1):setClass("Fighter")
		party:getChampion(1):setSex("male")
		party:getChampion(1):setPortrait("assets/textures/portraits/dead.tga")
	else
		hudPrint("Destroy me! Release my soul!")
	end
	end
	end
end
Last edited by Shloogorgh on Thu Sep 27, 2012 4:27 am, edited 1 time in total.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: adding a party member further into the dungeon

Post by petri »

As the error msg says, setEnabled requires a boolean argument, i.e. true or false. You are passing in the value of variable enabled which is probably nil in your case.
User avatar
Shloogorgh
Posts: 45
Joined: Sat Sep 22, 2012 12:24 am

Re: adding a party member further into the dungeon

Post by Shloogorgh »

Wow, changing it to setEnabled(true) was all it took!

Awesome, thanks
tyterrio
Posts: 7
Joined: Wed Sep 26, 2012 7:20 am

Re: adding a party member further into the dungeon

Post by tyterrio »

I had a question regarding this as well. I think im on the right track, but im a little confused. I've figured out how to script the party away, leaving solo play. But I'm having a hard time using a button or lever (or torch) to unlock (and add) a party member spot back.

I've managed to reverse the process by using a torch holder to get rid of my party. But I cant seem to get an interact-able asset to reverse the process. This is sort of where I'm at. Any thoughts/help would be great!

Ideally im looking for something that allows me to start with a party members, and add members in later.

function oneMember()
if torchHolder1:hasTorch() == true then
party:getChampion(2):setEnabled(false)
party:getChampion(3):setEnabled(false)
party:getChampion(4):setEnabled(false)
end
end
BlackHell
Posts: 27
Joined: Sat Mar 10, 2012 6:54 pm

Re: adding a party member further into the dungeon

Post by BlackHell »

WOW. If this would work so that you can start with an empty party and you can then get four members of your choice than we would have the real beginning of Dungeon Master. So i could write wall text with the Information of the Char and a door where he is behind ready to go.
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: adding a party member further into the dungeon

Post by HaunterV »

Iron man dungeons! only 1 party member!
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: adding a party member further into the dungeon

Post by SpacialKatana »

HaunterV wrote:Iron man dungeons! only 1 party member!
With a mage ;)
tyterrio
Posts: 7
Joined: Wed Sep 26, 2012 7:20 am

Re: adding a party member further into the dungeon

Post by tyterrio »

So is this even possible? Or am i grasping at straws here? :P
User avatar
Shloogorgh
Posts: 45
Joined: Sat Sep 22, 2012 12:24 am

Re: adding a party member further into the dungeon

Post by Shloogorgh »

tyterrio wrote:So is this even possible? Or am i grasping at straws here? :P
well, my script at the top of the page works, so it's possible. This is the relevant part, activated by a hidden plate.

Code: Select all

if party:getChampion(#):getEnabled() == false then
hudPrint("I will accompany you...")
party:getChampion(#):setEnabled(true)
Mine goes on to define the new party member's race, class, name, gender, etc.
Last edited by Shloogorgh on Thu Sep 27, 2012 4:25 am, edited 1 time in total.
tyterrio
Posts: 7
Joined: Wed Sep 26, 2012 7:20 am

Re: adding a party member further into the dungeon

Post by tyterrio »

awesome! i'll give it a go, thanks! :)
Post Reply