Ok, so I made a script entity placed besides the starting cage and connected it to a wall button for testing purpose, but pressing the button gives me a "invalid script blablabla function" in console when testing in game. Here's the code:
---
wrong code removed---
Edit:
Ha, fixed. There was a mistake in syntax. Code needs to look like this, and it does work on level 1 as well...
Code: Select all
function extraSkillPoints()
for i = 1,4 do
local cChampion = party.party:getChampion(i)
hudPrint(tostring(cChampion:getName()))
local cRace = cChampion:getRace()
hudPrint(tostring(cChampion:getRace()))
if cRace == "dwarf" then
cChampion:addSkillPoints(1)
end
end
end
Now I just need to find a way to initialize the script without the press of a button. Counter? Connect the script to opening the cage gate? Any other suggestions?
Edit 2: A timer did the trick. Here are some screenshots to proof of concept...
Edit 3: Btw., before I break my head again. During CC, would it be possible to restrict certain races, if another race is already in your party?