Author Topic: Random heads sometime won't show  (Read 391 times)

Legacy_Krevett

  • Full Member
  • ***
  • Posts: 203
  • Karma: +0/-0
Random heads sometime won't show
« on: February 01, 2011, 09:42:05 am »


               I've made a simple script that randomize the head of my NPC for populating towns but sometime their head won't appear! It's not a matter of a non existing model number because I logged in as a DM and spawned the folks manually then with a custom DM tool get their model number for the head: I got the same number twice one had his head and the other had none 'Image. It appears to be totally random wether the model will appear or not...
Also for now the script is only tested with human heads (so no problem with race and varying number of models).

I really don't know what I'm missing here!
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Random heads sometime won't show
« Reply #1 on: February 01, 2011, 03:07:37 pm »


               Try limboing the NPCs and then porting them back. I bet that fixes them. If so, you may need to add a small delay to your appearance change is all. Even then, you'll likely occassionally see a few glitch.
               
               

               
            

Legacy_Krevett

  • Full Member
  • ***
  • Posts: 203
  • Karma: +0/-0
Random heads sometime won't show
« Reply #2 on: February 01, 2011, 06:19:53 pm »


               You're right limboing and then porting back the NPC fixes them ^^ I'll try to add some delay and see if that lessen the number of glitches, thanks!

Edit: Tried a small delay and it seems to work well still noticed few glitches as you stated in your post but less than without the delay so i'll keep it that way...
               
               

               


                     Modifié par Krevett, 01 février 2011 - 07:55 .
                     
                  


            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Random heads sometime won't show
« Reply #3 on: February 01, 2011, 08:21:09 pm »


               I'm not sure how you're doing it, bur for the NPC randomization we have in Thay, I actually create all the random NPCs at a waypoint in an inaccessible area and randomize them there. Then, jump them to random locations in your area (or wherever they are supposed to go) using something in the OnSpawn, OnHeartbeat script or similiar scripting trigger/event. The downside of this is NPCs may suddenly 'appear' in front of PCs some 1, 2, 3, 4, 5+ seconds after they've entered the area, but to me that is more acceptable than headless/armless/torso-less NPCs walking around.

This has been an ongoing problem since forever and is the only way I've found to address it 99% of the time...
               
               

               


                     Modifié par Thayan, 01 février 2011 - 08:22 .
                     
                  


            

Legacy_Krevett

  • Full Member
  • ***
  • Posts: 203
  • Karma: +0/-0
Random heads sometime won't show
« Reply #4 on: February 01, 2011, 08:59:41 pm »


               Thanks for your feedback thayan I replaced the delay by a jump like you suggest and it solves the problem! Great ^^
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Random heads sometime won't show
« Reply #5 on: February 17, 2011, 01:36:11 am »


               OK .. I was fooling around and failing trying to do the teleport and return thing. Can someone post and example of how to jump the NPC and return them after a delay? Thanks in advance.
               
               

               
            

Legacy_Krevett

  • Full Member
  • ***
  • Posts: 203
  • Karma: +0/-0
Random heads sometime won't show
« Reply #6 on: February 18, 2011, 04:26:56 pm »


               I added these lines in a custom user defined script:
//
else if (nUser == 1054)
{
location lLocation = GetLocation(OBJECT_SELF);
RandomizeHead();
AssignCommand(OBJECT_SELF, ActionJumpToObject(GetWaypointByTag("wpoubli")));
AssignCommand(OBJECT_SELF, ActionJumpToLocation(lLocation));
}
//
And I call user defined event number 1054 for creatures I want head randomized in their on spawn scripts like this:

if (GetLocalInt(OBJECT_SELF, "randomhead") != 0) SignalEvent(OBJECT_SELF, EventUserDefined(1054));

Of course the RandomizeHead() function is a custom one ^^
It worked for me so far, so good luck with this!
               
               

               


                     Modifié par Krevett, 18 février 2011 - 04:28 .
                     
                  


            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Random heads sometime won't show
« Reply #7 on: February 18, 2011, 09:42:01 pm »


               Thanks, was just the return to where they spawned part that I'd brain farted on. '<img'>

I've been not only randomizing many heads, but giving them random hair and sometimes skin tones along with clothing and weapons occassionaly.
               
               

               


                     Modifié par kalbaern, 18 février 2011 - 09:43 .