Aller au contenu

Photo

Something Odd


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

#1
Tarot Redhand

Tarot Redhand
  • Members
  • 2 693 messages

I have a minimal module that I use to test the occasional script. All it has is one room with a corridor leading off from it. In the room currently there is one waypoint in the middle of the room and a generic trigger across the doorway. The start point is in the corridor so that the PC enters and exits the trigger upon entering the room. There is a single tiny script attached to the OnEnter event of the trigger.

void main()
{
    object oPC = GetEnteringObject();

    if(!(GetIsPC(oPC)))
        return;

    location lHere = GetLocation(GetObjectByTag("NW_WAYPOINT001"));
    object oClone = CreateObject(OBJECT_TYPE_CREATURE, "mohrg001", lHere);
} 

What I want to know is why the Mohrg does not appear. I know that the location is valid because I used the exact same peice of code when I used this module before to produce a copy of the PC using the copy object function where the CreateObject function is now. I know that the resref is correct because it is copied and pasted straight from the blueprints. I have tried this with and without the 

if(!(GetIsPC(oPC)))

without change. I am stumped.

 

I was carrying out this test because I have a large function that wasn't creating the monsters that it should. I figured that I would eliminate the low probability of cause script 1st.

 

In case anyone wants to look I have popped the little test mod into a 7z and posted it here in my dropbox/public folder.

 

Am I doing something wrong? Have I failed to include something essential? Thoughts anyone?

 

Thanks in advance.

 

TR



#2
henesua

henesua
  • Members
  • 3 882 messages

that doesn't look like the correct resref for the morgh. i'd check that.


  • Squatting Monk aime ceci

#3
BelowTheBelt

BelowTheBelt
  • Members
  • 394 messages

Came here to say the same thing .  The standard resref is "nw_mohrg", unless this is one of your own making.


  • Squatting Monk aime ceci

#4
Cannonade

Cannonade
  • Members
  • 18 messages

Yes and no. He has the correct resref from the default palette which is mohrg001, as described in the script. But he should be using the tag, which is NW_MOHRG.

 

Doing that makes it work.

 

Edit: Edit Copy isn't the way to get default palette resrefs.



#5
BelowTheBelt

BelowTheBelt
  • Members
  • 394 messages

Yes and no. He has the correct resref from the default palette which is mohrg001, as described in the script. But he should be using the tag, which is NW_MOHRG.

 

Doing that makes it work.

 

Sorry - "mohrg001"  is not the correct resref from the default palette.  "nw_mohrg" is the default creature resref (which coincides with the tag "NW_MOHRG").

 

Additionally, the function CreateObject uses an object's resref, not the tag.   Anytime you 'create' something, you use the resref.

 

What I suspect was done was that the creature in the palette was right-clicked and the 'edit copy' option selected.  Unfortunately, this creates a new resref for the creature (since you're editing a copy).  You can't use this method to get a standard creature's resref.

 

What should be done is use the preview window icon in the top row of the toolset to view an unchanged/original resref.  Alternatively, place a version of the creature in the game and then edit that creature to view the original resref.


  • Squatting Monk aime ceci

#6
kalbaern

kalbaern
  • Members
  • 824 messages

Also, the tag used for the waypoint is the generic default tag for bioware waypoints. If you've used waypoints elsewhere in the module and they retained that tag, its likely your creature is appearing there, even if on another map.

 

You should also use GetNearestObjectByTag instead of GetObjectByTag in this case so only the immediate area is checked for the matching tag. Your way checks the whole module, hence the  creature possibly spawning in elsewhere. If you do want the creature to appear in a different area, just change the waypoint tag to something unique in your current version.


  • Squatting Monk aime ceci

#7
Tarot Redhand

Tarot Redhand
  • Members
  • 2 693 messages

While I thank you all for your prompt replies it might have been useful if some of you had actually downloaded the test module that I linked to in my original post as some of your questions would have been answered. So here are some images to hopefully answer those questions.

 

This shows the whole of the testing module in it's entirety. As there is only the single waypoint and the single generic trigger I left their tags untouched.

 

c1.png

 

This shows what little I have put into the module.

 

c1a.png

 

This shows the single area that is the area in the module.

 

c2.png

 

This shows that I am using the standard palette and the undead listed under the other category.

 

c3.png

 

This shows what I get when I do an edit copy on the Mohrg

 

c4.png

 

This last shows what I get when I click on the advanced tab. As can be seen the resref is as I have described it and I can place this Mohrg into an area normally in the toolset.

 

c5.png

 

There is nothing in my standard override directory and nwn.ini points to the standard override folder. If anyone's interested I created an xls spreadsheet that has the following information in it - the name, tag, resref and CR of all the undead monsters in my standard palette. I made it for myself but in case there are other undead with dubious resrefs that someone would care to point out to me (I have had the same problem with the Vampire Warrior), it can be downloaded from here (this is so tiny I didn't compress it).

 

I don't know if it makes a difference but I have NwN diamond (disk version) patched to 1.69 and all the premium modules.

 

TR



#8
Squatting Monk

Squatting Monk
  • Members
  • 446 messages
As others have pointed out, the resref shown when clicking Edit Copy is not the resref of the creature in the palette. Change the resref in the script to "nw_mohrg" and you should be good.

Edit: the Lexicon has a handy list of standard palette resrefs so you don't have to create your own.
  • BelowTheBelt, Tarot Redhand et kalbaern aiment ceci

#9
Shadooow

Shadooow
  • Members
  • 4 471 messages

As others have pointed out, the resref shown when clicking Edit Copy is not the resref of the creature in the palette. Change the resref in the script to "nw_mohrg" and you should be good.

this

and btw to get real resref, just place creature into area and then view her properties from there


  • BelowTheBelt, Tarot Redhand et Squatting Monk aiment ceci

#10
meaglyn

meaglyn
  • Members
  • 812 messages

this

and btw to get real resref, just place creature into area and then view her properties from there

You don't need to place it, just select it in the palette and use the preview button... even simpler and faster.


  • Tarot Redhand, Shadooow, Squatting Monk et 1 autre aiment ceci

#11
Tarot Redhand

Tarot Redhand
  • Members
  • 2 693 messages

Thanks guys.

 

@Shadooow I used your method and got the resref that everyone else was telling me to use.

 

@meaglyn Your method should save me time as I now have to go through all the undead that I was planning on using to make sure I have the correct resrefs.

 

What I don't understand is why the toolset apparently gives you the "wrong" one sometimes and on others it gives you the right one (I was able to spawn a Doom Knight Commander without a hitch). Cest la vie. I've got a lot of undead to go through tommorrow (/today/whatever - it's well past midnight here - bed soon).

 

Thanks again.

 

TR


  • Squatting Monk et henesua aiment ceci

#12
Squatting Monk

Squatting Monk
  • Members
  • 446 messages

It's not the "wrong" resref. When you click Edit Copy, you're making a copy of the blueprint, which gets its own resref, so you're getting the resref of the copy.

As for why it worked with the Doom Knight Commander... not sure. Perhaps, because of the length of the resref, it couldn't add "001" to the end?


  • henesua aime ceci

#13
meaglyn

meaglyn
  • Members
  • 812 messages

It will truncate the resref to add the 001, so it's not the length.

 

My guess is that sometimes when you do Edit Copy you then Cancel and sometimes you OK. Those you OK'd would be valid and the ones you Cancelled wouldn't.


  • Squatting Monk aime ceci

#14
Tarot Redhand

Tarot Redhand
  • Members
  • 2 693 messages

@ Squatting Monk Forgot to say thanks for that link. The reason for making my own as an xls is so that I have them all in one place and I can then sort them however I want (e.g. CR in ascending order). If nothing else it makes it easier to try to balance the sp mod for a PC of a certain level without repeatedly going through the different classifications of monster.

 

TR


  • Squatting Monk aime ceci