Jump to content

pro.digy

Members
  • Posts

    4
  • Joined

  • Last visited

  • Donations

    0.00 GBP 

About pro.digy

  • Birthday 01/01/1

pro.digy's Achievements

Newbie

Newbie (1/3)

0

Reputation

  1. i did it as stated above, you need SD2 and put in the constructor of any AI you want to be updated all the time, like this struct MANGOS_DLL_DECL npc_horde_spawnerAI : public ScriptedAI { npc_horde_spawnerAI(Creature *c) : ScriptedAI(c) { c->SetActiveObjectState(true); Spawn_Count = 0; Reset(); } only negative is that you need a player nearby once to set the active state, but that should be no problem.
  2. OK might be nice for just walking along a waypoint path, but I need the creatures to also fight and move in realtime, so this isn't suitable for my issue, I'll try the creature->SetActiveObjectState(true); stuff This made the trick, I wrote it in every SD2 script in the constructor, ran through the whole zone so every npc is spawned and end up with a CPU usage of 3% - as it was before the change just the mem raised a bit to 6.4% Thank you guys!! Oh i forgot to say: Lots of the creatures are fighting, so they aren't all just `idle` - which would explain no CPU usage gain
  3. I searched for it but didn't find anything. I made a few searches for different keywords and looked through the three to five first pages.. forcing the creature to be active with "creature->SetActiveObjectState(true);" seems for me impossible, since the only way you can call this is in SD2 and the SD2 scripts are not running if no player is nearby - so how to force this? I really need this - and the CPU is the last thing that makes problems.. Is it possible to 'hackforce' it on creature load just for a specific zone? I don't need a nice solution.. My problem is that there is no player from start on in the specific zone so the initial NPC can't force the others to update if he himself isn't updated.. I could create an "updater npc" following the player around and forcing the others to update.. but that would be even for me a too hacky solution
  4. I have a big problem: The creatures are not getting updated when no player is nearby! I really need this so the creatures are moving (and sd2 scripts are running, but thats not this important) even if NO player is nearby. So what parts of the code would I have to change in order to make the core update creatures even if they are NOT visible to any player but the map is loaded. Update criterias would then be if there's a player present on the map, not the grid. I searched through the code but it's still too complex for me to find out in the near future, any help is appreciated. Thanks in advance! Oh and btw. this is offi like, the creatures on offi do indeed move (travel along waypoints and such) when no player is nearby. I know it's CPU intensive but that's really no problem.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use