The script works in the new test dungeon, and the editor version is 2.2.4. I'm assuming my issue is tied to the fact I'm trying to force custom portraits then?Isaac wrote:That means it ~seems~ to work for me, and not for you. What happens if you start a new project, and add my script & floor_trigger? (Test it in-game using the custom map.)
* Check the About Box in the editor's Help menu. Ensure that the editor version is 2.2.4.
New modder, need help (Default party, custom class)
Re: New modder, need help (Default party, custom class)
Re: New modder, need help (Default party, custom class)
The script is intended to force custom portraits. This of itself should not be a problem.
How deep are you into developing your map? How many scripts do you have? The only place the problem can be... is in one of those scripts; it works in a new map.
The course is to scrutinize the scripts you have; and possibly re-implement it from scratch. Pick through it until something stands out. The second time around is often the better design anyway.
How deep are you into developing your map? How many scripts do you have? The only place the problem can be... is in one of those scripts; it works in a new map.
The course is to scrutinize the scripts you have; and possibly re-implement it from scratch. Pick through it until something stands out. The second time around is often the better design anyway.
Last edited by Isaac on Sun Jul 30, 2017 3:48 am, edited 1 time in total.
Re: New modder, need help (Default party, custom class)
I'm only around two hours into making the current map. I don't have any other scripts on the map besides the one that activates when the players spawn, which changes their name and race.
Re: New modder, need help (Default party, custom class)
Post your script, and I will look at it.
Re: New modder, need help (Default party, custom class)
Isaac wrote:Post your script, and I will look at it.
Code: Select all
function setPortraits()
local images = {
"minotaur_male_11",
"minotaur_male_10",
"human_female_10",
"human_male_10"
}
for x = 1, #images do
local champ = party.party:getChampion(x)
local path = "assets/textures/portraits/"
local file = images[x]..".tga"
if champ:getEnabled() then
champ:setPortrait(path..file)
end
end
end
setPortraits()
party.party:getChampion(1):setName("test1")
party.party:getChampion(1):setRace("minotaur")
party.party:getChampion(1):setSex("male")
party.party:getChampion(2):setName("test2")
party.party:getChampion(2):setRace("minotaur")
party.party:getChampion(2):setSex("male")
party.party:getChampion(3):setName("test3")
party.party:getChampion(3):setRace("human")
party.party:getChampion(3):setSex("female")
party.party:getChampion(4):setName("test4")
party.party:getChampion(4):setRace("human")
party.party:getChampion(4):setSex("male")
Re: New modder, need help (Default party, custom class)
The problem is that the floor_trigger cannot call your statements unless they are in a function block.
Outside of a function, it runs earlier, and doubtless gets overwritten later. When the floor_trigger runs, it never calls them.
Outside of a function, it runs earlier, and doubtless gets overwritten later. When the floor_trigger runs, it never calls them.
Code: Select all
function setCustomPC()
party.party:getChampion(1):setName("test1")
party.party:getChampion(1):setRace("minotaur")
party.party:getChampion(1):setSex("male")
party.party:getChampion(2):setName("test2")
party.party:getChampion(2):setRace("minotaur")
party.party:getChampion(2):setSex("male")
party.party:getChampion(3):setName("test3")
party.party:getChampion(3):setRace("human")
party.party:getChampion(3):setSex("female")
party.party:getChampion(4):setName("test4")
party.party:getChampion(4):setRace("human")
party.party:getChampion(4):setSex("male")
end
Re: New modder, need help (Default party, custom class)
I tried using this script but now neither the races or names are altered, therefore it's back to the default party. I made a new dungeon to test it and the issue persists.Isaac wrote:The problem is that the floor_trigger cannot call your statements unless they are in a function block.
Outside of a function, it runs earlier, and doubtless gets overwritten later. When the floor_trigger runs, it never calls them.
Code: Select all
function setCustomPC() party.party:getChampion(1):setName("test1") party.party:getChampion(1):setRace("minotaur") party.party:getChampion(1):setSex("male") party.party:getChampion(2):setName("test2") party.party:getChampion(2):setRace("minotaur") party.party:getChampion(2):setSex("male") party.party:getChampion(3):setName("test3") party.party:getChampion(3):setRace("human") party.party:getChampion(3):setSex("female") party.party:getChampion(4):setName("test4") party.party:getChampion(4):setRace("human") party.party:getChampion(4):setSex("male") end
Re: New modder, need help (Default party, custom class)
Just to be sure... Did you choose the setCustomPC function as the target in the floor_trigger connection menu? Connectors only call one function. If one is set to call setPortraits(), you need a second connector to call setCustomPC().
Optionally, other functions can be called from within the called function, using only one connector; but that's not how your script is presently written.
Optionally, other functions can be called from within the called function, using only one connector; but that's not how your script is presently written.
Re: New modder, need help (Default party, custom class)
Isaac wrote:Just to be sure... Did you choose the setCustomPC function as the target in the floor_trigger connection menu? Connectors only call one function. If one is set to call setPortraits(), you need a second connector to call setCustomPC().
Optionally, other functions can be called from within the called function, using only one connector; but that's not how your script is presently written.
Is this what it should look like? This is the connector menu and how I have had it in which it's still causing the problem.
Re: New modder, need help (Default party, custom class)
That could work. It does not have to be separate scripts, but it shouldn't cause any problem.
Does it cause this problem in a new project? (as before, with setPortraits)
Does it cause this problem in a new project? (as before, with setPortraits)