turf
warp1
icon = "warp1.dmi"
src.loc=locate(4,3,1)
Problem description:
Why wont that work. Its been 2 years since ive really coded and now i cant remember [expletive deleted] all.\
ID:146505
![]() Jun 1 2005, 4:05 am (Edited by moderator on Jun 1 2005, 7:24 am)
|
|
Code:
turf Problem description: Why wont that work. Its been 2 years since ive really coded and now i cant remember [expletive deleted] all.\ |
In addition to what Iain said, you can't set a variable to a variable value at compile-time. You'll have to set the loc of that warp in the map editor, or create it at run-time.
|
okay your problem is an easy one to fix :)
Code: do not copy this because I just spaced here not in DM may cause indention errors if you just copy and paste. turf Description: Your only problem was that you didn't call the Enter() procedure for whenever a mob enters that turf it teleports the user to whatever location he/she needs to be. -Travis(Niran) |
you should prolly do this instead
turf AND ENTER is called WHEN the thing tries to enter it, use Entered instead prolly. If you do, take out the return 1 |
Definitely use Entered() instead of Enter(). I made that mistake in one of my first game and was extremely confused when the pathfinding library I was using started causing all sorts of weird side effects. =P (The game ending as soon as it started, for one.)
Enter() should ONLY be used for saying whether or not the player is allowed to enter the turf. It should have no other effects; use Entered() for things like as teleportation. Also, that code has vars mixed up quite a bit, and will cause several compiler errors. Do this instead: turf (The change from /atom to /atom/movable isn't strictly necessary, but I included it anyway.) |
icon = 'warp.dmi'