Page 1 of 1
[solved] Possible to stop switching of positions?
Posted: Sun Nov 18, 2012 9:20 pm
by mahric
People are playing my dungeon "the Wine Merchant's Basement" and like real users they're doing stuff you don't expect.
In the game you start with a single character but you get some help as the story progresses.
The players swap the position of players, causing my to mix up characters in script.
My script even crashes if they swap a character with an empty position.
Therefore my question: Is there some way to disable the players switching around?
Re: Possible to stop switching of positions?
Posted: Sun Nov 18, 2012 9:31 pm
by Komag
I don't think that can done, but I'm pretty sure you can make scripts that are more fool-proof so even if the player has switched you can check for it with things like checking the character names at first and then searching for the names, searching for nil, etc
Re: Possible to stop switching of positions?
Posted: Sun Nov 18, 2012 9:50 pm
by mahric
Guess I'll do that, thanks!
Re: Possible to stop switching of positions?
Posted: Sun Nov 18, 2012 9:55 pm
by Xanathar
There is a getOrdinal() method for the champion. The ordinal is guaranteed not to change whatever the player does to the champs:
Champion:getOrdinal()
Returns champion’s ordinal index between 1 and 4. The ordinal index is an unique identifier for the champion. It is guaranteed that the ordinal index never changes after character creation.
Wine basement specific spoiler below.
Also, I'm playing your mod.. with Toorum because I'm a dirty cheater mwahahah.
However, I'm stuck at the ogre where you stare the flame and die

. If I ever get after that point I'll let you know how it behaves with Toorum as first character.
Re: Possible to stop switching of positions?
Posted: Sun Nov 18, 2012 10:29 pm
by mahric
I did a fix which might qualify for the most dirty solution ever .
In the onMove() and onTurn() event of the part I check the position of the party and use party:swapChampions() to reset them to the intended position.
But hey, it works!

Re: Possible to stop switching of positions?
Posted: Sun Nov 18, 2012 10:30 pm
by mahric
Xanathar wrote:There is a getOrdinal() method for the champion. The ordinal is guaranteed not to change whatever the player does to the champs:
Champion:getOrdinal()
Returns champion’s ordinal index between 1 and 4. The ordinal index is an unique identifier for the champion. It is guaranteed that the ordinal index never changes after character creation.
Wine basement specific spoiler below.
Also, I'm playing your mod.. with Toorum because I'm a dirty cheater mwahahah.
However, I'm stuck at the ogre where you stare the flame and die

. If I ever get after that point I'll let you know how it behaves with Toorum as first character.
stand on the square with the flame and have faith

Re: [solved] Possible to stop switching of positions?
Posted: Sun Nov 18, 2012 11:07 pm
by Xanathar
So that you know:
with Toorum it works, but "additional help" is dead characters. Still useful for teh extra inventory though.
BTW:
I've defeated the champion, the prison and the library.
Will let you know if I get stuck because of the Toorum choice. Nice mode anyway! I'm enjoying it a lot. And thanks for your help
