Shop  •   Avatar  •   FAQ  •   Search  •   Memberlist  •   Usergroups  •   Profile  •   Log in to check private messages  •   Log in  •  Register 

treasure map coding
Post new topic   Reply to topic     Forum Index -> Customization & Modding Goto page Previous  1, 2, 3
View previous topic :: View next topic  
Author Message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Wed Apr 23, 2014 9:52 pm    Post subject: code insertion Reply with quote

Can't figure out where to put AdamMil's code.
Back to top
View user's profile Send private message
AdamMil
Cutthroat
Posts: 279



4759 Gold -

PostPosted: Wed Apr 23, 2014 10:36 pm    Post subject: Re: code insertion Reply with quote

parksbanyon wrote:
Can't figure out where to put AdamMil's code.
Jslangdo should really answer this, but from memory, you should:
  1. Find the two arrays by searching for "Governor" or whatever, and replace them with mine.
  2. Search for something like "decode_landmark" or "translate_landmark" or something. That function needs to be modified, but it's not as simple as copying/pasting the last three lines into it because it has a minor bug or two that needs to be fixed first. ($x and $y aren't parsed correctly, IIRC.) Also the flow control needs to be tweaked. If you know Perl, it's not hard. Otherwise, let me know and if jslagndo doesn't reply before then I'll reply later after I get back home.
Back to top
View user's profile Send private message Visit poster's website
AdamMil
Cutthroat
Posts: 279



4759 Gold -

PostPosted: Sat May 03, 2014 11:24 pm    Post subject: Reply with quote

Sorry, it seems I forgot to go home... Anyway, find the code in jslangdo's save editor 1.43 or later that says
Code:
my @landmark_names = qw(Skull Governor Hangman's Cutthroat Captain's Cutlas Rum Powder Knife Thunder Blade Black Jellyfish Dagger Devil's Shark Lookout Blood Anchor Gallows );

my @landmark_nouns = qw(Reef Point Shallows Stone Cape Head Rock);

sub translate_landmark {
  my ($string, $x, $y) = @_;
  if (length $string != 2) { return; }
  my $retval = "??";
  if ($landmarks{$string}) { return $landmarks{$string}; }
  if ($retval eq "Landmark") {
    my $offset = ($x - $y + 40000) % 20;
    return $landmark_names[$offset] . " " . $retval;
  }
}

and replace it with
Code:
my @landmark_adjectives = qw(
  Skull Blood Devil's Black Knife Cutlass Hangman's Gallows Lookout Dagger Blade
  Powder Captain's Governor Anchor Shark Jellyfish Thunder Rum Cutthroat);

my @landmark_nouns = qw(Rock Point Stone Head Reef Shallows Cape);

sub translate_landmark {
  my ($string, $x, $y) = @_;
  if (length $string != 2) { return; }
  my $retval = $landmarks{$string} || "??";
  if ($retval eq "Landmark") {
    $x =~ s/^[^_]+_//s;
    my $n = ($x*33 + $y*47) % 1000;
    my $adjective = $landmark_adjectives[$n % 20];
    my $noun = $landmark_nouns[$n / 20 % 7];
    $retval = "$adjective $noun $retval";
  }
  return $retval;
}

Jslangdo might have integrated it a bit differently, but I think this should work. (The formula worked when I first tested it weeks (months?) ago, but it's possible I've misremembered how to integrate it into the editor.) Let me know if you have any trouble.
Back to top
View user's profile Send private message Visit poster's website
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Mon May 12, 2014 1:55 am    Post subject: reply Reply with quote

Will do, and let you know. Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Customization & Modding All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group