Aller au contenu

Photo

trouble adding an npc into an existing area.


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
Firinneach

Firinneach
  • Members
  • 13 messages
Hello, scripting isn't my strong suit but I'm hoping someone can help me.

I've successfully added an npc to some areas before (the pearl, the docks by lake calenhad, etc) and I usually get my script which spawns the character to run by creating a PRCSCR / .gda file. 

However, I'm now trying to get an npc to spawn in the Gnawed Noble Tavern of the market district in Denerim and I'm not having any luck.

My PRCSCR file doesn't seem to like the area code for this location: "den220ar_gnawed_noble"

I noticed that this happens to be the first area I've tried to use that in the toolset object inspector has something listed under "area list". In other areas I've created an npc this field says "none" but for the tavern it says "den2al_den_market.

Could this be preventing my PRCSCR file from working? If so, is there something I could be inputing or doing with my PRCSCR file in order to have my npc spawn? 

Many thanks.

p.s.: In case it matters here is my script ("lily" is the name of the npc I'm trying to spawn)

    #include "wrappers_h"
    void main()
    {
    object oPlayer = GetMainControlled();

    object oMerchant = UT_GetNearestObjectByTag(oPlayer, "lily");
    if (!IsObjectValid(oMerchant))
    {
    object oArea = GetObjectByTag("den220ar_noble_tavern");

    location lMerchantLocation = Location(oArea, Vector(10.142420, 5.520301, 0.034480), -81.268196106);

    CreateObject(OBJECT_TYPE_CREATURE, R"lily.utc", lMerchantLocation);
    }
    }

#2
amcnow

amcnow
  • Members
  • 511 messages
Where did you get "den220ar_gnawed_noble" for the PRCSCR? Shouldn't it be "den220ar_noble_tavern"?

EDIT: If that doesn't work, then you can still try "den02al_den_market" since that is the AreaList to which it actually belongs.

Modifié par amcnow, 19 janvier 2011 - 02:19 .


#3
Firinneach

Firinneach
  • Members
  • 13 messages
Thanks for the suggestion Amcnow. I must have been tired when I posted last night. You're right and I meant to say I'd been using "den220ar_noble_tavern."



I did try it with the "den02al_den_market" without any luck, but maybe I'll give it another go in case I had a typo.

#4
amcnow

amcnow
  • Members
  • 511 messages
Hmmm, you may be better off doing one of 3 things:



1. Use one of the NPCs already present in the tavern.

2. Use a different area (like The Pearl).

3. Create your own tavern and place an area transition to it in the denerim market.



Number 2 is the simplest solution. Number 3, however, is the most creative and scalable solution.

#5
Firinneach

Firinneach
  • Members
  • 13 messages
True enough amcnow. I was hoping perhaps there was just something simple I was missing, like perhaps certain areas need to be named differently for the PRCSCR to work, but your other solutions seem like the way to go.



Cheers.

#6
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages
It might help...

http://social.biowar...r-270034-1.html

Modifié par _L_o_B_o_, 19 janvier 2011 - 10:11 .


#7
Karma

Karma
  • Members
  • 391 messages
As others have said, you need to reference the area list name in the gda instead of the area. BUT there could also be something else going on that's causing it not to work. The game doesn't seem to like spawning things into areas that are not entered first in the area list. Others have suggested to edit the area script, but that might cause compatibility issues with any mods that also alter that script.



I had a similar problem a while back (http://social.biowar...55628/1#4459562). You could try the suggestion by Trylane on that page if you're still having problems after changing the area list name. I ended up spawning my creature in custom area, so I never got around to testing to see if Trylane's suggestion would work.

#8
Firinneach

Firinneach
  • Members
  • 13 messages
Thanks for the tips all. I tried one of the scripts mentioned in the thread L_o_B_o linked and at first glance at least I think it worked. Keeping fingers crossed!