Author Topic: Something Odd  (Read 383 times)

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Something Odd
« on: October 09, 2014, 06:34:57 pm »


               

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



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Something Odd
« Reply #1 on: October 09, 2014, 06:55:16 pm »


               

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



               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Something Odd
« Reply #2 on: October 09, 2014, 07:03:49 pm »


               

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



               
               

               
            

Legacy_Cannonade

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Something Odd
« Reply #3 on: October 09, 2014, 07:12:58 pm »


               

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.



               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Something Odd
« Reply #4 on: October 09, 2014, 07:52:02 pm »


               


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.



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Something Odd
« Reply #5 on: October 09, 2014, 08:24:31 pm »


               

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.



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Something Odd
« Reply #6 on: October 10, 2014, 12:22:23 am »


               

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



               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Something Odd
« Reply #7 on: October 10, 2014, 12:29:52 am »


               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.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Something Odd
« Reply #8 on: October 10, 2014, 12:35:02 am »


               


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


               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Something Odd
« Reply #9 on: October 10, 2014, 01:10:30 am »


               


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.


               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Something Odd
« Reply #10 on: October 10, 2014, 02:28:10 am »


               

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



               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Something Odd
« Reply #11 on: October 10, 2014, 02:37:08 am »


               

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?



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Something Odd
« Reply #12 on: October 10, 2014, 02:53:37 am »


               

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.


               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Something Odd
« Reply #13 on: October 10, 2014, 12:25:18 pm »


               

@ 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