nate12357 Posted November 24, 2010 Share Posted November 24, 2010 I'm working on a mod that scans the cells around a player and identifies certain major objects like oblivion gates, doors, and other things. I've been unable to get the GetfirstRef or Getnextref to identify map markers. Am I missing something? Map markers are very useful to my mod as they cleanly identify the proximity of a dungeon (using getmapmarkertype). t Link to comment Share on other sites More sharing options...
Hickory Posted November 24, 2010 Share Posted November 24, 2010 Map markers are statics (28), but have persistent reference names (49). You could try using those. Link to comment Share on other sites More sharing options...
nate12357 Posted November 24, 2010 Author Share Posted November 24, 2010 (edited) Thanks for responding Hickory, I tested your suggestion and still came up with nothing. Here is my script: scriptname nateMapMarkerScript short dooncefloat fQuestDelayTime float mode begin GameMode if ( doonce != 4 ) set doonce to 4 set mode to 1.0 set fQuestDelayTime to 5 endif ref pMapMarkerref BaseMapMarkerfloat Mapmarkerfound set BaseMapMarker to "10"...set pMapMarker to GetFirstRef 49 1 1 (49 as suggested. Tried 28)while (pMapMarker) if pMapMarker.getbaseobject == BaseMapMarker message "Map Marker found" set Mapmarkerfound to 1 endif set pMapMarker to GetNextRefloop end Edited November 24, 2010 by nate_12357 Link to comment Share on other sites More sharing options...
QQuix Posted November 24, 2010 Share Posted November 24, 2010 Try "if pMapMarker.getbaseobject == MapMarker" Link to comment Share on other sites More sharing options...
Hickory Posted November 24, 2010 Share Posted November 24, 2010 Yes, what QQuix said. You are scanning for BaseObjects of type MapMarker. Your script is querying if the ref equals "10". Link to comment Share on other sites More sharing options...
nate12357 Posted November 24, 2010 Author Share Posted November 24, 2010 "10" is the hex refid for MapMarker. I did try switching it out for MapMarker and the script doesn't work. Link to comment Share on other sites More sharing options...
theNiceOne Posted November 25, 2010 Share Posted November 25, 2010 (edited) You must look for type 28, not 49. I know, because I have a working scan for Map Markers in my Map Marker Overhaul mod. Here is a shortened version of the script I use: let rMarker := GetFirstRef 28 2 While rMarker let oMarker := rMarker.GetBaseObject if oMarker == MapMarker if rMarker.GetDisabled == 0 let s1 := rMarker.GetName let i := rMarker.GetMapMarkerType if eval (sv_Length s1) <= 0 || i == 0 DebugPrint "MMO:Ignore non-valid marker %i, type: %.0f", rMarker, i else DebugPrint "MMO:found valid map marker %z", s1 endif endif endif let rMarker := GetNextRef Loop Edited November 25, 2010 by theNiceOne Link to comment Share on other sites More sharing options...
nate12357 Posted November 27, 2010 Author Share Posted November 27, 2010 That code worked perfectly. I think my issue involved improper use of variable types. I had never really used string_var type variables and mostly used float to store values. Strange that my code worked for doors/rocks and not map markers. Thanks to all those that helped me solve my issue! Link to comment Share on other sites More sharing options...
Recommended Posts