Well, for a long time now I've been trying to figure out how to make it so that entering land turfs are restricted when on a boat/ship.
So far I'm totally lost.. Maybe someone can help?
Heres what I have so far
atom/var/obj/boat
Ship
Boat//
icon_state = "1"
IsShip = 1//
DblClick()//
if(get_step_away(src,usr,1))
usr.Frozen=1
usr.client.eye = src
usr.client.perspective = EYE_PERSPECTIVE
usr.loc = locate(1,1,2)
alert("Click here to stop steering")
usr.loc = src.loc
usr.Frozen=0
usr.client.eye = usr
usr.client.perspective = MOB_PERSPECTIVE
client/Move(NewLoc,Dir)
if(src)
if(src.eye != src.mob)
var/Ship/M
for(var/Ship/T in view(0,usr.client))
if(T.IsShip)
M = T
if(!T.IsShip)
..()
step(M,Dir)
return 0
else/
..()e
else
..()
Ship
parent_type = /obj/
icon = 'Boats.dmi'
var/IsShip
density = 1
mob
var
Savedfromboat=0
Savedsomeone=0
Thanks in advance.
ID:156587
Sep 1 2010, 2:58 pm
|
|
land Doing it that way will allow you to make turfs just as normal, and shortens the pathway when you search for a certain type of turf. land |
In response to Albro1
|
|
And that's an excellent example of how not to do things. Thanks for that.
|
In response to Garthor
|
|
If you point out that something is wrong, could you at least point out a better way? If I do something wrong, I want to learn from it and say "I'll make sure to do that next time.", or something along those lines.
I mean no rudeness from this, and I apologize if I came over that way. I am a rather blunt person, and I often inadvertently offend people. |
In response to Garthor
|
|
Thank you.
|
In response to Skyspark
|
|
Skyspark wrote:
You could override the /turf/Enter() proc to disallow movement for things that are boats. > turf For the "if(A_is_A_Boat)" portion, you need some way to identify that the movable atom in question is, in fact, a boat. It looks like your boats are all a subtype of the /Ship type, so a line like if(istype(A, /Ship)) should work okay. I'm still new at coding unfortunately and I appreciate the help but where do i place if(istype(A, /Ship)) |
For the "if(A_is_A_Boat)" portion, you need some way to identify that the movable atom in question is, in fact, a boat. It looks like your boats are all a subtype of the /Ship type, so a line like if(istype(A, /Ship)) should work okay.