ID:1638991
 
Keywords: bigicon
(See the best response by GhostAnime.)
Code:


Problem description:No code needed but i have created a cave a big icon and i coded it in as a turf i was wondering if thats bad considering its a cave idk if its a obj or Cave. when a mob enters a cave it teleports you but my real problem is i have to goto a certain part of the icon of the cave to get teleported when the opening of the cave is not there. any solutions to fixing this, ik it has to do with big icons searched on forum but couldnt find anything

I might be wrong, but I'm pretty sure you need to declare that atom's bound_x and bound_y for it to handle it properly. Right now it considers it a 32x32 tile and that's why if you go out of range of it, it vanishes.
sorry im a nub but how do i do that currently i did
turf
Pavement_1
icon = 'Turf.dmi'
icon_state = "Floor"
Enter()
usr.loc = locate(/turf/Pavement_2)
Pavement_2
icon = 'Turf.dmi'
icon_state = "Floor"
Enter()
usr.loc = locate(/turf/Pavement_1)
Cave
icon = 'cave entrance.dmi'
icon_state = "Cave"
density = 1
bound_x = 120
bound_y = 100
Enter()
usr.loc = locate(/turf/Pavement_2)
In response to YoungJR1232
Oops! Sorry, I meant to say bound_width and bound_height
In response to Crazah
Crazah wrote:
Oops! Sorry, I meant to say bound_width and bound_height
and how would declare thoes
In response to YoungJR1232
Best response
DO NOT USE USR IN ENTER() AND OTHER RELATED MOVEMENT PROCEDURES

There are few instances where usr is defined, often when a specific client action is invoved (ex: Click(), cling a verb, Login() and Stat()s IIRC).

For movement procedures, these are called indirectly thus there is a risk that usr may not be defined to who you expect and can cause weird "bugs" in your system that will take time to track down.

I remember it took me days to figure out that the reason people were dying rsndomly in a game I was programming because of usr.
but i cant use src
if i do i get : src.loc: cannot change constant value
In response to YoungJR1232
YoungJR1232 wrote:
if i do i get : src.loc: cannot change constant value

    Pavement_2
icon = 'Turf.dmi'
icon_state = "Floor"
Enter(mob/M)
if(!istype(M,/mob/)) return ..()
M.loc = locate(/turf/Pavement_1)