View Single Post
  #12  
Old 11-23-2009, 03:52 PM
nilbog nilbog is offline
Project Manager

nilbog's Avatar

Join Date: Oct 2009
Posts: 14,460
Default

I voted for I have another idea! Post below..

Ridable boats are actually something that are workable*, by perl code and db work. We got a chance to delve into these for a bit, and modified the current boat code (written by Angelox) to suite our needs in a couple of locations (thx aeolwind). Due to lots of private messages regarding how coders can help, this seems like an appropriate situation!

The following information is dedicated to purely technical details. If you are interested in how boats can* work, continue reading. I am not suggesting you make any modifications to what you currently have.

The old model boats (race 72 [You must be logged in to view images. Log in or Register.] )are hollow on the client, which I believe is an issue relating to Directx. This is also why the Translocators initially appeared on live eq.

In response to this, you can force another model into a zone that isn't hollow. This one works well. (Yes, its a downgrade from a ship, lol :T )

[You must be logged in to view images. Log in or Register.]

This model can be force loaded into zones by modifying globalload.txt and adding a line to the top. Here's what mine looks like. (Under no circumstances am I suggesting you change your globalload.txt file for this. I am merely explaining the difficulties in boat making. You will not receive a res if you try and ride these and go missing in the ocean.)

Code:
1,0,TFFF,erudnext_chr,Loading Characters
1,1,TFFF,GlobalFroglok_chr,Loading Froglok
Pretty much, the boats are summoned by timers, and invisible watchers in zones. Boats are npcs and can follow pathing grids. Invisible npcs wait on timers and then spawn the boats and send them on their way to the docks, where they pause, then continue on. When they reach the zoneline, you can have an invisible proximity npc port you to the next destination where another boat is spawned and waiting.

Here's some of the perl code from freporte.
Code:
## BOAT WATCHER!!
## SirensBane travels from oot to oot to freporte and back
## Angelox
## Qadar
sub EVENT_SPAWN { ## Starts in Oot

# --- START CODE FOR BOAT MOVER --- #

if($debugpl) {quest::shout("I currently see Stormbreaker's position set at $sirens");}
if($forceboats){
  if($freportelastseen==$sirens){   #boat hasnt changed waypoints yet

    $butcherstart = 0;                  # what $sirens is set at to start the boat in Butcher
    $oot1start = 14;                    # what $sirens is set at to start the boat in OOT to Freeport
    $fpstart = 39;                      # what $sirens is set at to start the boat in Freeport
    $oot2start= 60;                     # what $sirens is set at to start the boat in OOT heading to Butcher

    $oot1wait = 40;                     # number of spawns before it assumes boat in OOT to FP is stuck
    $fpwait = 40;                       # number of spawns before it assumes boat in FP is stuck
    $oot2wait = 40;                     # number of spawns before it assumes boat in OOT to Butcher is stuck
    $butcherwait = 40;                  # number of spawns before it assumes boat in Butcher is stuck
    
    if(($sirens>=$oot1start) && ($sirens < $fpstart) && ($freportetimer >= $oot1wait)){        #if waypoint hasnt changed in x spawns, and boat in oot on its way to fp
      if($debugpl){quest::shout("Stormbreaker is in OOT heading to Freeport, hasn't moved, giving up and moving it to Freeport");}
      quest::delglobal("sirens");  #boat obviously isnt moving... move it to fp
      quest::setglobal("sirens",$fpstart,7,"F");}
    elsif(($sirens>=$fpstart) && ($sirens < $oot2start) && ($freportetimer >= $fpwait)){        #if waypoint hasnt changed in x spawns, and boat in freeport
      if($debugpl){quest::shout("Stormbreaker is in Freeport, hasnt moved, giving up and moving it to OOT");}
      quest::delglobal("sirens");  #boat obviously isnt moving... move it to oot
      quest::setglobal("sirens",$oot2start,7,"F");}
    elsif(($sirens>=$oot2start) && ($freportetimer >= $oot2wait)){        #if waypoint hasnt changed in x spawns, and boat in oot on its way to bb
      if($debugpl){quest::shout("Stormbreaker is in OOT heading to Butcher... hasnt moved, giving up and moving it to butcher");}
      quest::delglobal("sirens");  #boat obviously isnt moving... move it to butcher
      quest::setglobal("sirens",$butcherstart,7,"F");}
    elsif(($sirens>=$butcherstart) && ($sirens < $oot1start) && ($freportetimer >= $butcherwait)){   #if waypoint hasnt changed in 15 spawns, and boat in butcher on its way to freeport
      if($debugpl){quest::shout("Stormbreaker is in Butcher heading to OOT... hasnt moved, giving up and moving it to OOT");}
      quest::delglobal("sirens");  #boat obviously isnt moving... move it to OOT
      quest::setglobal("sirens",$oot1start,7,"F");}
    else{                           #increase the timer
      $tempvar = $freportetimer+1;
      if($debugpl){quest::shout("Stormbreaker hasn't moved, increasing timer to $tempvar");}
      quest::delglobal("freportetimer");
      quest::setglobal("freportetimer",$tempvar,3,"F");}
  }else{                          #boat has changed waypoints, tell freportelastseen its new waypoint, reset timer to 0
    if($debugpl){quest::shout("Stormbreaker seems to be moving ok");}
    quest::delglobal("freportelastseen");
    quest::setglobal("freportelastseen",$sirens,3,F);
    $freportelastseen = undef;
    quest::delglobal("freportetimer");
    quest::setglobal("freportetimer",0,3,7);
    $freportetimer = undef;}}

# --- END : CODE FOR BOAT MOVER --- #


if (($sirens ==39) &&($sirens >=39) && ($sirens <=59)){ ##Oot
 quest::spawn_condition(freporte,2,0); #BoatThere
 quest::spawn_condition(freporte,1,1);
 # quest::shout ("Boat there");
 quest::depop();}
else{
 quest::spawn_condition(freporte,2,1); #BoatGone
 quest::spawn_condition(freporte,1,0);
# quest::shout ("Not there");
 quest::depop();}}
Code:
# Zone to Oot SirensBane event
# Zone: FreportE
# AngeloX
# Qadar
sub EVENT_SPAWN{
    $x = $npc->GetX();
    $y = $npc->GetY();
    quest::set_proximity($x - 100, $x + 100, $y - 100, $y + 100);}

sub EVENT_ENTER{
    if (($sirens >=53) && ($sirens <=60.5)){
     if($sirens != 60.5){
       quest::delglobal("sirens");
       quest::setglobal("sirens",60,7,"F");}
     if($debugpl){ quest::shout("Zoning PC's to Oot Setting to 60!!!");}
     quest::movepc(69,-10583.5,-3169.7,19.0);}}
Code:
## SirensBane travels from oot to oot to freporte and back
## Angelox
## Qadar

sub EVENT_DEATH {
 if(($sirens < 60) && ($sirens > 0)){
   if($debugpl){quest::shout("Zoning out!");}
   quest::delglobal("sirens");
   quest::setglobal("sirens",60,7,"F");
   $sirens=undef;}
 }

sub EVENT_WAYPOINT {
## In freporte > Butcher ####################### In freporte >Oot #################


if ($sirens ==40){
 if($debugpl){quest::shout("telling 10183 to depop");}
 quest::signal(10183);
 if($debugpl){quest::shout ("ZONEING in From oot setting 41");}
 quest::delglobal("sirens");
 quest::setglobal("sirens",41,7,"F");
 $sirens=undef;}
elsif($sirens==41){
 quest::delglobal("sirens");
 quest::setglobal("sirens",42,7,"F");
 $sirens=undef;}
elsif($sirens==42){
 if($debugpl){quest::shout ("Setting 43");}
 quest::delglobal("sirens");
 quest::setglobal("sirens",43,7,"F");
 $sirens=undef;}
elsif($sirens==43){
 quest::delglobal("sirens");
 quest::setglobal("sirens",44,7,"F");
 $sirens=undef;}
elsif($sirens==44){
 quest::delglobal("sirens");
 quest::setglobal("sirens",45,7,"F");
 $sirens=undef;}
elsif($sirens==45){
 quest::delglobal("sirens");
 quest::setglobal("sirens",46,7,"F");
 $sirens=undef;}
elsif($sirens==46){
 quest::delglobal("sirens");
 quest::setglobal("sirens",47,7,"F");
 $sirens=undef;}
elsif($sirens==47){
 quest::delglobal("sirens");
 quest::setglobal("sirens",48,7,"F");
 $sirens=undef;}
elsif ($sirens==48){
 quest::delglobal("sirens");
 quest::setglobal("sirens",49,7,"F");
 $sirens=undef;}
elsif ($sirens==49){
 quest::delglobal("sirens");
 quest::setglobal("sirens",50,7,"F");
 $sirens=undef;}
elsif($sirens==50){
 quest::delglobal("sirens");
 if($debugpl){quest::shout ("SET 50)");}
 quest::setglobal("sirens",51,7,"F");
 $sirens=undef;}
elsif($sirens==51){
 quest::delglobal("sirens");
 quest::setglobal("sirens",52,7,"F");
 $sirens=undef;}
elsif($sirens==52){
 if($debugpl){quest::shout ("Setting 53");}
 quest::delglobal("sirens");
 quest::setglobal("sirens",53,7,"F");
 $sirens=undef;}
elsif($sirens==53){
 quest::delglobal("sirens");
 quest::setglobal("sirens",54,7,"F");
 $sirens=undef;}
elsif ($sirens==54){
 quest::delglobal("sirens");
 quest::setglobal("sirens",55,7,"F");
 $sirens=undef;}
elsif ($sirens==55){  ##### TIMER ###
 if($debugpl){quest::shout ("Near ZoneLine Set 56!)");}
 quest::delglobal("sirens");
 quest::setglobal("sirens",56,7,"F");
 $sirens=undef;}
elsif($sirens==56){
 quest::delglobal("sirens");
 quest::setglobal("sirens",57,7,"F");
 $sirens=undef;}
elsif($sirens==57){
 quest::delglobal("sirens");
 quest::setglobal("sirens",58,7,"F");
 $sirens=undef;}
}
Any perl geniuses lurking around? I'd be willing to use those launches and skiffs, or another model if we could actually fix the boat system.
Last edited by nilbog; 11-23-2009 at 03:59 PM..