Author Topic: Some creatures unable to use transitions?  (Read 364 times)

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Some creatures unable to use transitions?
« on: November 11, 2013, 07:40:29 am »


               I've implemented a script to stop monsters from leaving their respective areas. If a monster uses a transition, whether it be a door, ground transition etc, they are teleported back to their original spawn point, and are force rested. Essentially they are reset.

This works, the problem I'm having is that not all creatures seem to be able to use transitions, most notably the ground transitions.

Does anyone know anything in regards to this?
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #1 on: November 11, 2013, 07:23:26 pm »


               Is it mainly lasrge creatures that aren't working properly?
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #2 on: November 11, 2013, 09:57:51 pm »


               Other questions:
(1) Does this only occur with Area Transition Triggers?
(2) Do these Area Transitions have correctly identified waypoints?
(3) What script is used in these transitions?
               
               

               
            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #3 on: November 12, 2013, 03:15:05 am »


               The first enemies I noticed who were unable to use transitions properly were leeches from the CEP.

-henesua

1: it appears to happen with both door and floor type transitions, but seems to occur more often with floor type

2: yes all transitions have valid waypoints

3: http://pastebin.com/6wZM7eHn

The custom coding I've added is this part

   // Stop enemies from chasing players into other areas. Returns them to their spawn point.
   if(GetLocalInt(oClicker, "PLACED") == 1){
       location lSpawnLoc = GetLocalLocation(oClicker, "SpawnLoc");
       AssignCommand(oClicker, ClearAllActions());
       AssignCommand(oClicker, ActionJumpToLocation(lSpawnLoc));
       ForceRest(oClicker);
       return;
       }

All manually placed creatures are tagged with the PLACED variable when they spawn. Their location is also stored when they spawn, which is what "SpawnLoc" is referring to.
               
               

               


                     Modifié par EzRemake, 12 novembre 2013 - 03:17 .
                     
                  


            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #4 on: November 12, 2013, 09:44:57 am »


               It seems like the ClearAllActions doesn't always seem to work fully. I've had times where the monster is teleported back to their spawn, and rested, but they retain agro and come crawling back from the other side of the map.

Is there a better way to cancel the actions of a monster? I might look for other ways to prevent monsters from leaving the area or congregating around transitions. I want to avoid the kill route if at all possible.
               
               

               


                     Modifié par EzRemake, 12 novembre 2013 - 09:45 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #5 on: November 12, 2013, 02:04:35 pm »


               ClearAllActions(TRUE)
               
               

               
            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #6 on: November 12, 2013, 10:29:26 pm »


               ClearAllActions(TRUE) by itself didn't seem to change much compared to how it was before, enemies sometimes retained their attack targets.

I tried rearranging the code a little bit, and added a wait, and it seems to work a little better. It may just be a placebo effect, but even if its not flawless it does its job.

How do other servers go about dealing with this issue? (Monsters using transitions, grouping on transitions etc)
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #7 on: November 13, 2013, 07:30:21 pm »


               hmm. sounds odd. But glad its working well enough.

For myself, I prefer that creatures follow transitions when i want them to because I like to lay out regions of many areas all stitched together with seamless area transitions.

For issues with bunching up at transitions etc... it can be a surprise, but as long as it doesn't break immersion I don't mind. Anyway it is an issue since creatures don't move around with no players in the area, but there are different ways to solve this: spawn/despawn controls, clean up scripts, your approach, and so on.
               
               

               
            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #8 on: November 16, 2013, 08:59:09 am »


               I was meaning to ask, when I store local variable on a creature and that creature later on dies does the variable get deleted and unloaded from the memory?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Some creatures unable to use transitions?
« Reply #9 on: November 16, 2013, 09:33:01 am »


               

EzRemake wrote...

I was meaning to ask, when I store local variable on a creature and that creature later on dies does the variable get deleted and unloaded from the memory?

yes variables are deleted once creature dies and disappears to void, if you already have access to the object Id of the dead creature and you need to retrieve some variable for any reason you can workaround this via setting the variable on module with variable name equal to ObjectToString(oNPC) but perhaps if you said what you need to do specifically we could suggest you better way