ID:789772
 
Alright so I'm trying to make something along the lines of:


A player spawns in the world - walks up to a ship, boards the ship, walks to the steering portion of the ship, sets off in the ship thus controling it, wherever the ship docks, player can exit controls, walk around until exiting ship, and be at the new destination.

Now several things need to take place:

- Player (whomever happens to be driving) can carry crew/clan/guild members (a previously defined amount) with them, so most likely a new temporary turf must be created for other players to walk around in while the "captain" drives.

I am at a bit of a loss at this part, so far when i try to even board said ship the screen turns black. (I also do not understand very well the "swapmaps" tutorial in references.

---------------------------------------

-I know i need to focus on client.eye, move(), the entering/exiting of the player(s), and the transition of the icon, to the new mob/obj/etc.

- I do not want there to be just a simple change in look of the default mob, to give the illusion of having control over the ship. The player will be frozen (as i know how to do but i assume i may run into difficulty with this as well later on) upon attempting to steer the ship, and will be given control of the object/newmob/etc instead, on a new z axis,(probably just spawn new mob at the desired location) kinda like an overworld map so to speak.

- Finally, if the new mob is destroyed, or lands at a destination i need to release that control. I'm nto sure how to do this "exactly"

-Additional Question:I set a datum for the default mob, (does this apply to the ship as well, or should i just create it as its own entity (like a datum) ? Or even just as an object with its own vars?


-----

Discuss?
The most obvious way I can think of to do this is have a ship be a mobile object, and activating the steering column causes the player's client to be attached to mob/ship rather than mob/player.

If the ship is destroyed, set the client back to the appropriate mob/player and then handle the blowing-up of the ship ( and I assume everyone in it. )

As for the ship's ability to carry passengers; the ship should have some sort of exit mechanism. When a ship arrives at a destination then, depending on where that destination is ( Enter(), perhaps? personally I'd use areas, but I haven't thought about this extensively ) the exit would send mobs passing through it to the appropriate location.
In response to Deathguard
Example: The pokemon games.
[EDIT]
The pokemon games for the GBA, not byond.
[END EDIT]

The way it's explained sounds like he's doing a complete inside of the ship, which means there will be a enter/exit. Just alter the Exit() proc for the door/passage way that leads outside of the ship, check if the ship is docked or not, then use alert("It's too dangerous to exit the ship while sailing!"), then return. If the ship is docked, you simply allow them to pass through.
In response to Deathguard
As for the steering, you would probaly have to define custom move procs for each direction, like alot of games do. In which, you can check for a variable set to check if the mob is steering or not, then if the mob is, you could pass the commands to the ship(presumably a mob set in another part of the map used to traverse the world) and use client.eye = ship.

For the 'destroy' bit, you can add an attack verb that can fire out of whatever side you want, by using dirs of course. Just check what direction the ship is facing, then determain what direction you what the 'cannons' to fire. Asigning all the ships health, clearly, and then adding in a 'death' proc for the ship. In the death-proc you could check for mobs inside the ship(I assume you're just going to make a list that tells who's in the ship) and move them to where you wish.
well what about the datum part?

If i turn the ship into a mob, wont i get duplicate definitions?

I need alot of room, what type of ships etc.

Should I just stick that right under mob for an override, or create it as if it were its own datum?
In response to Komuroto
I don't deal with datums too often, but in theory it should be perfectly fine. But I'm not talking about turning the ship into a mob, I'm saying you make a seperate part of the map to be used for sailing, where you'll only spawn the boats(as a mob) and allow the mob to view the boat through client.eye. This would mean you should use two different icons for the boat, a bigger one for when it's docked(which would be just a turf), and a smaller one for the mob.

The mob version of the boat would only be used for combat and sailing, where-as the turf version of the boat will be for when the boat's docked. You could use the docked boat as a universal boat, allowing players who belong to a clan that owns a boat to board/unboard the boat, creating a seperate room for that clan so you don't have three 'clans' in the same boat.

If you would like to make the boats just one big boat per clan, you could make a big mob and use a bumped() proc to move the players inside, this would make it easier to manage the one boat at a time. And save you the hassle of making two kinds of boats, plus give you the advantage of not making another map.
You'll only get duplicate definition errors if mob is a parent of boat.
So basically copy the set turf, each time a clan/crew sets sail?

I dont really wanna move the players.

I kinda of want to do what you said before.

Players (after entering boat) are basically stationary; and only the driving player (captain of the boat, the helmsmen, and [whatever you call the guy who sits in the crows nest]) is able to see a different map, where the ship is moving.

Obviously the steering player would have control.

Once ship is docked at a new destination, the players would be teleported the new location.

Virtually every location would have a twin location just on different Z axis.

Problem is I'm not sure how to go about this, and several flaws come to mind.


I really need an example, or atleast a place to start, as what have, merely turns the screen black.
client
North()
var/mob/M = src.mob // Typecast player
if(M.InBoat) // If you're in a boat
step(M.Boat,NORTH) // Make it move
// Please note that because ..() isn't in the conditional, the player doesn't move //
else // If you're not in a boat
..() // Biz as usual

mob
var
Boat // Player Boat (reference)
InBoat = 0 // Whether or not player is in Boat

obj
Boat // Defining Boat
icon = 'Boat.dmi'

verb // Boat Verbs

Take() // Makes a boat your own
set src in oview()
usr.Boat = src

GetIn() // Get in the boat
set src in oview()
usr.InBoat = 1 // You are now in boat
usr.Move(src) // Put you in boat's contents

GetOut() // Get out of the boat
if(usr.InBoat) // If you're in a boat
usr.Move(get_step(src,SOUTH)) // Get out
usr.InBoat = 0 // No longer in boat


Note: This is done with me making the boat an obj. It was simply easier to make the boat an object than its own datum. Plus making a boat datum offered no advantages over making the boat an obj.
You should make the mob store a reference to their boat so you don't have to loop through all boats in the world to find which one is theirs.
I did.
What's wrong with

mob
var
Boat

if(M.Boat)
step(M.Boat,NORTH)

?
What your suggesting lugia, isnt what I'm looking for.

I'm actually wanting players to walk around an activate the steering mechnisms of the ship whenever their ready while already INSIDE the ship.

What you've suggested if I understand correctly, will make player immediatly gain control of ship as soon as he/she enters it.
Sort of, i guess i could use that as a basis
He wants a system where there is a ship on the 'world map,' and you can enter it ( like a building ) and then one person can take the helm of the ship, steer it around on the 'world map' and so on, whilst the passengers are free to wander around inside it.


I assume this is the case, Komuroto?
In response to Deathguard
Yes deathguard, except the overworld map and main map would be different z axis.



@Lige: Neither of those links do what I am suggesting- but they give a very small touch toward the idea. Inadequately though.