Author Topic: Riddle me this: Where is a player when a player isn't anywhere?  (Read 320 times)

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Riddle me this: Where is a player when a player isn't anywhere?
« on: October 25, 2012, 08:22:05 pm »


               What happens during an area transition to the player object when an area transition is clicked and they are in-transition, but they have yet to transition to the next area?

I have some solo dungeons in my module and when entering, there is a check in all the maps of that dungeon to see if there are PCs present.  If positive, the PC trying to enter the dungeon is not admitted. 

In instances which *seem* to be when a PC is transitioning, a second PC can follow on his/her heels.  I presume that this is because the PC is not technically in any area as they are transitioning (e.g. some portion of the time during the loading screen), or at least that when the destination map is checked for PCs, the PC is not there yet.

Is this correct?  Or is the PC always assigned to an area - either the original area or the destination area?

Thanks!
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Riddle me this: Where is a player when a player isn't anywhere?
« Reply #1 on: October 25, 2012, 09:08:15 pm »


               when a PC is transitioning he will not have a valid location.

GetIsObjectValid(GetArea(oPC))   Will return FALSE
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Riddle me this: Where is a player when a player isn't anywhere?
« Reply #2 on: October 25, 2012, 09:15:02 pm »


               A solution to this is to track pc presence in the OnEnter event of each dungeon area, as well as flagging the PC as in the dungeon. When a PC that has the "dungeon flag" triggers the OnEnter event in an area other than the dungeon, you can clear the dungeon that flagged him of its "pc present flag"

Does this make sense?

Dungeon OnEnter
SetLocalInt on PC with Dungeon's unique ID
SetLocalInt on Dungeon as TRUE for occupied

Everywhere else OnEnter
Check to see if a PC has a special flag,
if TRUE, lookup a list for which dungeon needs to be set as "available", and erase the flag on the PC.

Small problem...
I forgot to track module exit. You'll need to run the same check as on "Everwhere else OnEnter"
               
               

               


                     Modifié par henesua, 25 octobre 2012 - 08:16 .