Page 1 of 1

Toorum mode - scripts and poll

Posted: Mon Nov 19, 2012 11:55 am
by Xanathar
In the last days I played a lot of mods using Toorum, specially all of those who reduce the party to a single character, because as I said elsewhere I'm a dirty cheater :lol:

Some magically works (Big friendly warden), some have odd issues (Wine basement - so far at least, This Rotten Place), some work ok with a varying range of difficulty from being much easier to being much harder (One Room Round Robin up to my room), others can't be completed (none so far, but it's not difficult to figure this scenario).

I think we have these choices:
  • Do not meddle with enabled/disabled champions, do not meddle with champion inventories, be careful with party iterations and Toorum magically works (sometimes, the Toorum bugs can be subtle however; for example you cannot ask the party to sacrifice the life of a champion!).
  • Detect Toorum mode, and kill the party instantly at startup, saying "hey, use a normal party ok ?" (see below)
  • Convert Toorum party to a standard one (see below)
  • Pray the devs to disable Toorum for mods in the next release
  • Do some heavy development to support Toorum (totally not trivial and quite time consuming) and playtest it at least twice.
I have made this two functions to help supporting Toorum:

Detect if standard Toorum party:
SpoilerShow

Code: Select all

function isToorumMode()
	local rangerDetected = 0
	local zombieDetected = 0

	for i=1,4 do
		local c = party:getChampion(i)
		if (c:getClass() == "Ranger") then 
			rangerDetected = rangerDetected + 1
		end
		if (not c:getEnabled()) and (c:getStatMax("health") == 0) then 
			zombieDetected = zombieDetected + 1
		end
	end
	
	return (rangerDetected >= 1) and (zombieDetected == 3)
end
De-zombify Toorum party
If you try to setEnabled/heal a toorum party, you end up with a party of zombies.
After running this function once, real but very weak characters would come out of that resurrection process. Note that this is very basic - for example all characters will be fighters. Change that to suite your tastes :) but consider that Toorum is very strong by himself so surrounding him with strong champions would probably unbalance the game.
SpoilerShow

Code: Select all

function DezombifyParty()
	local portraits = { "human_female_01", "human_female_02", "human_male_01", "human_male_02" }
	local genders = { "female", "female", "male", "male" }
	local names = { "Sylyna", "Yennica", "Contar", "Sancsaron" }

	for i=1,4 do
		local c = party:getChampion(i)
		if (c:getStatMax("health") == 0) then 
			c:setStatMax("health", 25)
			c:setStatMax("energy", 10)
			c:setPortrait("assets/textures/portraits/" .. portraits[i] .. ".tga")
			c:setName(names[i])
			c:setSex(genders[i])
		end
	end
end

I think at the very least we should specify in the mod description if Toorum is supported or not..

What do you think ?

Re: Toorum mode - scripts and poll

Posted: Mon Nov 19, 2012 11:59 am
by Komag
Wow, thank you for this. I think most authors forget about Toorum, and I would love to see him more supported and accommodated for sure! :)

Re: Toorum mode - scripts and poll

Posted: Mon Nov 19, 2012 2:44 pm
by Montis
Well, I actually did a "special mode" with Toorum for my Hypercube (first community contest winner) but apparently no one figured that out by themselves. :D

I didn't mention it at first and only hinting at it later since Toorum is a secret and thus should be handled as one. :)


btw, my script to detect him was something like this:

Code: Select all

function isToorumMode()
   if party:getChampion(1):getClass() == "Ranger" then
      return true
   else
      return false
   end
This works at the very start of the dungeon since when you enter the name Toorum, you will always have Toorum at the first position. I also did only a check at the start of the dungeon, so I didn't need to account for checks later. Else I might just have saved a variable that stores true or false.

Re: Toorum mode - scripts and poll

Posted: Mon Nov 19, 2012 5:49 pm
by Brodie301
My mod uses the "Ranger" but not Toorum. If you use default character it's Contar with 0 stats but that's in the editor. I haven't played the dat to see if I adjust stats how it plays out. I know I'm limiting the player who might download my mod but if I tell them upfront I don't see where that is a problem.

Re: Toorum mode - scripts and poll

Posted: Mon Nov 19, 2012 6:02 pm
by Xanathar
The script in the original post detects Toorum mode without getting mistaken on other rangers (it checks for zombie champions too, which are actually the problem, not Toorum himself).

Re: Toorum mode - scripts and poll

Posted: Tue Nov 20, 2012 11:41 am
by Montis
Xanathar wrote:The script in the original post detects Toorum mode without getting mistaken on other rangers (it checks for zombie champions too, which are actually the problem, not Toorum himself).
Well, if you implement "other rangers", this can only be done (yet) by the author of a map if I'm not mistaken. So he would know best how / if he added Rangers :P

Re: Toorum mode - scripts and poll

Posted: Tue Nov 20, 2012 11:57 am
by Xanathar
Well, if you implement "other rangers", this can only be done (yet) by the author of a map if I'm not mistaken. So he would know best how / if he added Rangers
Sure, but then you would have to worry about the order of execution of script entities if you put it into two different entities.. nitpicking I know :)

Re: Toorum mode - scripts and poll

Posted: Tue Nov 20, 2012 2:50 pm
by Montis
Yeah I actually had some problems with that but if you put all the functions into one entity and just call the check at the end, it's no problem :)