The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sailing around the world
Author Message
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #1
Sailing around the world
I would like to hear people's ideas on how to safely (and unnoticably) send a ship (with all its contents and crew) from one location to another... For example, before they reach the west edge of the map while sailing westward, transport them to the east side of the map (still sailing westward.)
11-27-2012 04:58 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Sailing around the world
my idea is using forchars and foritems and change the p of all items in ships region like:

PHP Code:
[function sendship//usage: sendship x,y,z
ref1=<uid>
foritems 8
    
if (<region.uid> = <ref1>) && (<ref1> != <uid>)
         
p=<eval <argv[0]> +(<p.x>-<ref1.p.x>)>,<eval <argv[1] + (<p.y>-<ref1.p.y>)>,<eval <argv[2]> + (<p.z>-<ref1.p.z>)>
         
update
    
endif
endfor

forchars 8
    
...
endfor
p=<args>
update 

maybe code was wrong about coordinates but i think it shows my idea.
(This post was last modified: 11-27-2012 05:39 AM by Shaklaban.)
11-27-2012 05:36 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: Sailing around the world
Scrap all that and use SHIPGATE <location>

[Image: 2nis46r.jpg]
(This post was last modified: 11-27-2012 05:39 AM by Mordaunt.)
11-27-2012 05:38 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #4
RE: Sailing around the world
So the tricky part is not moving the ship, its contents, and its crew... the tricky part is detecting when the ship reaches the edge.

I tried to create a long narrow region on the west edge of the map, like so:

Code:
[AREADEF a_world_edge_west]
NAME=Western Ocean
GROUP=Ocean
P=5,5,0,0
RECT=0,0,10,4096,0
EVENTS=r_western_ocean_teleport

But it turns out that REGION triggers do not fire when a character is inside another region (the ship is a multi and therefore a region.)

I tried to override t_ship with some region triggers, but they do not fire either.

Unrelated, but still a bug... when you sail sideways, and hit the world edge with a boat, and then tell it to turn right or left you get some crazy errors... and if you logout or are at the edge when the world saves, parts of the boat are destroyed for being in invalid places.
(This post was last modified: 11-27-2012 09:28 AM by RanXerox.)
11-27-2012 09:26 AM
Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #5
RE: Sailing around the world
What you may need to do is start a timerf when the ship starts moving that checks it's location using a function like this...

Code:
[FUNCTION f_ship_watch]

IF (<link.p.x> > 5100)
link.wrapx 20
ENDIF
IF (<link.p.x> < 20)
link.wrapx 5100
ENDIF
IF (<link.p.y> > 4070)
link.wrapy 8
ENDIF
IF (<link.p.y> < 8)
link.wrapy 4070
ENDIF
timerf 2,f_ship_watch

[function wrapx]
shipgate <ARGN>,<p.y>,<mapplane>,<z>

[function wrapy]
shipgate <p.x>,<ARGN>,<mapplane>,<z>

This is a modified extract of an old ship sript I have that would do what you are looking for. I'm sure there are some modifications that you will need to do, but It should help you get going Smile

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
11-27-2012 11:38 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #6
RE: Sailing around the world
(11-27-2012 11:38 AM)Ben Wrote:  What you may need to do is start a timerf when the ship starts moving

What trigger is called when the ship starts/continues/stops moving?
11-28-2012 08:04 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: Sailing around the world
run it on a voice command in the region....

[Image: 2nis46r.jpg]
11-28-2012 09:59 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)