GetResRef() Works for Areas?
#1
Posté 12 septembre 2011 - 08:27
Can someone confirm that either the Lexicon wasn't updated if this was fixed at some point, the Lexicon is wrong about the function not returning area resrefs, or that this function will reliably return the resref of an area?
#2
Posté 12 septembre 2011 - 10:10
I still get a NULL string return for ResRef's of doors.
#3
Posté 12 septembre 2011 - 10:17
#4
Posté 12 septembre 2011 - 10:23
#5
Posté 12 septembre 2011 - 10:29
#6
Posté 12 septembre 2011 - 11:06
#7
Posté 13 septembre 2011 - 05:25
ffbj wrote...
I use that for my treasure maps where once the PC has found treasure in that area, a hidden chest, they can never find it again.
One thing I use to love to do is script triggers to give treasure, not letting the PC"s just walk up to chest to take treasure.
This way the PC actually has to go "exploring areas" not relying on their vision or almighty Tab button to highlight stuff.
"You kicked over a dead log and found a hidden dagger!"
Modifié par _Guile, 13 septembre 2011 - 05:26 .
#8
Posté 14 septembre 2011 - 01:34
in an area where no such hidden treasure exists.
Modifié par ffbj, 14 septembre 2011 - 01:37 .
#9
Posté 14 septembre 2011 - 02:22
ffbj wrote...
Well with my treasure map there is no chest unless you have the item. Once you get inside the trigger and use the map it will say something like, treasure located 10 paces in this direction, turning you in that direction. As you get closer, zeroing in on the chest, fewer paces are needed to locate it. Then within 2 meters the chest appears. Usually it takes 3 or 4 activations of the map to find it. If you already found a treasure in that area, the map message is 'your map is dark.' If there is a treasure in that area but you have not found it and have not entered the trigger yet it wil say 'your map flickers then goes dark.' This indicates a buried treasure chest in that area that you have not yet found. Lastly I also put a local on the area Treasure set to 1. So if you activate the map with no local Treasure on the area you get the map is dark message. So you won't waste your time looking for hidden treasure
in an area where no such hidden treasure exists.
Very crafty indeed, me likes..
#10
Posté 14 septembre 2011 - 09:59
I use it for cataloging all my areas in the module.
eg- Loop through areas, and Get the resref (resrefs are unique at mod Load for areas)
Then I store a Local Object on the module, called "AREA_"+resref
The object being each area.
This allows me to use a function called
object GetAreaByResref(string sResref)
{
object oMod = GetModule();
return GetLocalObject(oMod,"AREA_"+sResref);
}
GetObjectByTag is not always useful for areas, because they can have duplicate tags.
However, ResRefs are 'required' by toolset to be unique.
Getting an area by resref, can be useful.
It should be noted, this only works for vanilla areas, that were added in toolset.
Areas made via nwnx_Areas will have duplicate resrefs, so they should not be added to the system via the SetLocalObject, as GetByResRef will simply mean that it returns the last duplicate area.





Retour en haut







