![]() |
|
Sailing around the world - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Sailing around the world (/Thread-Sailing-around-the-world) |
Sailing around the world - RanXerox - 11-27-2012 04:58 AM 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.) RE: Sailing around the world - Shaklaban - 11-27-2012 05:36 AM 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,zmaybe code was wrong about coordinates but i think it shows my idea. RE: Sailing around the world - Mordaunt - 11-27-2012 05:38 AM Scrap all that and use SHIPGATE <location> RE: Sailing around the world - RanXerox - 11-27-2012 09:26 AM 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]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. RE: Sailing around the world - Ben - 11-27-2012 11:38 AM 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]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
RE: Sailing around the world - RanXerox - 11-28-2012 08:04 AM (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? RE: Sailing around the world - Mordaunt - 11-28-2012 09:59 AM run it on a voice command in the region.... |