Author Topic: Aoe Problem [SOLVED]  (Read 447 times)

Legacy_Irisiri

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Aoe Problem [SOLVED]
« on: February 03, 2012, 06:02:37 pm »


               When I cast an AOE in a no PVP area, it doesn't harm anyone as intended. But  once I leave the server, it immediatly start to harm players.

how to fix?
               
               

               


                     Modifié par Irisiri, 03 février 2012 - 06:52 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Aoe Problem [SOLVED]
« Reply #1 on: February 03, 2012, 06:12:09 pm »


               the fix can be done via validity check in the AOE heartbeat script, alternatively you can dispell all AOE effects of the caster at OnClientExit event
               
               

               
            

Legacy_Irisiri

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Aoe Problem [SOLVED]
« Reply #2 on: February 03, 2012, 06:17:03 pm »


               I'm trying this on Module Exit


void CleanPlayerAOES(object oPC)
    {
      object oAREA = GetArea(oPC);
      object oSEEK = GetFirstObjectInArea(oAREA);
      while(GetIsObjectValid(oSEEK))
           {
           if(GetObjectType(oSEEK) == OBJECT_TYPE_AREA_OF_EFFECT)
             {
              if(GetAreaOfEffectCreator(oSEEK) == oPC)
                {
                 DestroyObject(oSEEK);
                }
             }
           oSEEK = GetNextObjectInArea(oAREA);
           }
    }


But it doesnt work, when player leave, some data is missing i guess
               
               

               


                     Modifié par Irisiri, 03 février 2012 - 06:19 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Aoe Problem [SOLVED]
« Reply #3 on: February 03, 2012, 06:40:57 pm »


               

Irisiri wrote...

I'm trying this on Module Exit


void CleanPlayerAOES(object oPC)
    {
      object oAREA = GetArea(oPC);
      object oSEEK = GetFirstObjectInArea(oAREA);
      while(GetIsObjectValid(oSEEK))
           {
           if(GetObjectType(oSEEK) == OBJECT_TYPE_AREA_OF_EFFECT)
             {
              if(GetAreaOfEffectCreator(oSEEK) == oPC)
                {
                 DestroyObject(oSEEK);
                }
             }
           oSEEK = GetNextObjectInArea(oAREA);
           }
    }

But it doesnt work, when player leave, some data is missing i guess


  I don't think you can get a valid area off an exiting player from the client exit script.  Even if you did somehow manage it, then it would still only affect the area they were last in with the script you have here.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Aoe Problem [SOLVED]
« Reply #4 on: February 03, 2012, 06:46:02 pm »


               rather than player exit... can you capture the area exit event?
               
               

               
            

Legacy_Irisiri

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Aoe Problem [SOLVED]
« Reply #5 on: February 03, 2012, 06:48:20 pm »


               --
               
               

               


                     Modifié par Irisiri, 03 février 2012 - 06:49 .
                     
                  


            

Legacy_Irisiri

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Aoe Problem [SOLVED]
« Reply #6 on: February 03, 2012, 06:52:44 pm »


               

henesua wrote...

rather than player exit... can you capture the area exit event?


Thanks, that worked.
I first thought that when a player leaves the module it wouldnt trigger the onExit of an area.
               
               

               


                     Modifié par Irisiri, 03 février 2012 - 06:53 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Aoe Problem [SOLVED]
« Reply #7 on: February 03, 2012, 07:11:14 pm »


               AFAIK - everything works as "in first, out last" like layers of an onion. So Area is entered after client enter when a player logs in, and exited before when a player logs out.

I think it goes
Client Enter
Area Enter
Trigger Enter
...
Trigger Exit
Area Exit
Client Exit