adding a party member further into the dungeon
Posted: Tue Sep 25, 2012 9:45 pm
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:
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