Find out if party is empty and player is viewing a mirror?

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Find out if party is empty and player is viewing a mirror?

Post by Gambit37 »

I'd like something specific to happen when the player has not yet chosen a champion from a mirror but is viewing a mirror. How would I go about that? (All the ppos functions return a positive when a mirror is being viewed because they seem to consider that the mirror character is in the party at position 0, even though they haven't been selected yet.)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Find out if party is empty and player is viewing a mirror?

Post by Sophia »

Yes, DSB temporarily adds the mirror character to the party in order to inspect them. However, you can combine your check with dsb_current_champion which returns the ppos currently being viewed in a mirror, or nil if you aren't in a mirror. If there's only one character in the party, and that one character is being viewed in a mirror, then nobody has actually been selected.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Find out if party is empty and player is viewing a mirror?

Post by Gambit37 »

OK, ta. Is dsb_current_champion in the newest version of DSB? I'm still using 0.76 and I get a crash if I try to use that function.
EDIT: Never mind, I just read the release post for 0.77. Time for me to upgrade (I keep avoiding it due to how much modified code I have to check against the base code to ensure I don't miss anything important!)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Find out if party is empty and player is viewing a mirror?

Post by Sophia »

I wouldn't bother just yet. 0.78 is coming very soon!
Post Reply