ozymundas1 Posted October 4, 2016 Share Posted October 4, 2016 Hello,I'm working on a persistent world (mostly for my own enjoyment) and I would like the World Map to show hotspots only after certain PC levels. So far, my scripting efforts always return FALSE and no hotspots show (unless using gc_true which most tutorials advise using, always returns TRUE). Does anyone here know what scripting will pull the PC's level and display a hotspot accordingly? I've tried: int StartingConditional(){object oPC = GetPCSpeaker();if (GetTotalLevels(oPC, 0) < 3) return FALSE;return TRUE;} And the same using "GetEnteringPC" and "GetHitDice" but neither seem to do the trick. Thanks! Link to comment Share on other sites More sharing options...
Tchos Posted October 4, 2016 Share Posted October 4, 2016 Levels are a little complicated since characters can multiclass, so you don't want a character to fail a level check for level 10 if they have 8 levels of rogue and 2 levels of bard, for instance. I think there are some custom functions in at least one of the include files that might handle that kind of thing. Have you looked through those? I use EC Super Include to make all custom functions available for searching in the list. Also, I think one of Kaldor Silverwand's OC makeovers includes level requirements for powerful weapons, so you might look through that to see how he did it. Link to comment Share on other sites More sharing options...
ozymundas1 Posted October 4, 2016 Author Share Posted October 4, 2016 "GetHitDice" pulls the total level of the PC including multiclasses. I'm specifically looking for a map conditional script that doesn't rely on Global variables as an example. Thanks though! Link to comment Share on other sites More sharing options...
Tchos Posted October 4, 2016 Share Posted October 4, 2016 So I guess I don't understand the question, if you're able to get the PC's level fine. That seemed to be the sticking point in your first post. What's the problem with global variables? I generally use local variables instead of global ones except when necessary, but I also haven't had occasion to use the World Map. I prefer the overland map system from SoZ (where you just spawn new hotspots as needed, or have them all there from the beginning and toggle their usability as needed) or signpost-based travel. Still, if you explain in more detail what exactly the problem is, I should be able to give some better scripting options. Link to comment Share on other sites More sharing options...
ozymundas1 Posted October 4, 2016 Author Share Posted October 4, 2016 I'm using the OC version of the World Map system, where in the OC campaign, hotspots only show up when a Global variable is set. This works fine if you are running a single-player module. In my module, setting a global variable and then using it would basically mean that every PC of any level would see the Hotspot based on the first person to play and set the variable. I want Area2 to only show it's Hotspot on the world map if a character is over level 2. The Map Conditionals from the OC do not support this. They base everything off of conversations and journal entries to set a Global variable that allows a Hotspot to be shown. Since this is (in theory) a Persistant World, Player 1 is level 10 but Player 2 is level 1, I dont want Player 2 to see Hotspots meant for higher levels. From what I can gather, map conditionals follow the same rules as conversation starting conditionals, but I must be missing something in that assumption.I suspect that the Map Conditional doesn't recognize (GetPCSpeaker) or (GetEnteringPC), but I dont know any other way of pulling the PC into the script. The OC scripts avoid this completely by using Global Variables (which again, would work for a single player module, but not a Persistent World, unless I create Global Variables for each player created and update each variable when they level up, there has to be a simpler way.) Any example of a Map Hotspot Conditional that doesn't rely on Global variables would point me in the right direction, so that I can see what operations they used to pull information not stored at the Global level. Link to comment Share on other sites More sharing options...
ozymundas1 Posted October 4, 2016 Author Share Posted October 4, 2016 A person from another forum found the answer for me. Thanks for all help though! i believe the check script runs on the OwnedPC of the clicking characterint StartingConditional(){ object oPC = OBJECT_SELF; // OwnedPC, regardless of clicker if (GetHitDice(oPC) > 2) return TRUE; return FALSE} Link to comment Share on other sites More sharing options...
Tchos Posted October 5, 2016 Share Posted October 5, 2016 Ah, well, it's good that someone else solved it. My expertise is in single-player modules, not persistent worlds. But if the object running the script is the PC, then yes, OBJECT_SELF is the way to go. GetPCSpeaker doesn't work because it's not a conversation, and GetEnteringObject is for a script in the On Enter or On Client enter script slots (the former can be used on triggers and AoEs as well). I would have tried GetLastUsedBy if the map is opened by using an object, but I suspect it's not. I hear that on PWs, a common trick to store conditionals is to give each player an inventory item that can't be dropped, and storing the variables on that item. Link to comment Share on other sites More sharing options...
Recommended Posts