Hi.
I'm new to Escripting and the only real base I have is a very small knowledge of C++. I have been reading through the guide for Escript in the Documentations section, and I understand it quite well.
The problem is, the scripts I create aren't working, and I just can't figure out why!
First of all, I pretty much copied and pasted the "return ring" script into various locations of my server, and the compiling goes well.
What goes wrong is that when I then create the item inside UO, it can't be doubleclicked, I just get the normal "don't know what to do with this" message. Inside the server window I also get an error message:
Exception caught while loading script scripts/items/return_ring.ecl: Unable to open scripts/items/return_ring.ecl for reading.
Unable to read script 'scripts/items/return_ring.ecl
I've done everything the right way, I think, so I'm guessing the problem lies elsewhere. Here's a few copypastes of what I've used.
config\itemdesc.cfg:
Code:
Item 0x5000
{
Name ring_of_returning
Desc Ring of Returning
Graphic 0x108A
Color 72
Script return_ring
}
pkg\items\return_ring-src:
Code:
use uo;
program ReturnRing(player, ring)
// remember this is a usescript, and the variables 'player' and 'ring'
// are the parameters passed to the script by the POL core.
var x,y,z;
x := GetObjProperty(player, "x_corpse");
y := GetObjProperty(player, "y_corpse");
z := GetObjProperty(player, "z_corpse");
if ( (x == error) or (y == error) or (z == error) )
SendSysMessage(player, "Could not find your corpse");
return 0; //exits the script
endif
MoveObjectToLocation(player, x, y, z);
EraseObjProperty(player, "x_corpse");
EraseObjProperty(player, "y_corpse");
EraseObjProperty(player, "z_corpse");
DestroyItem(ring);
endprogram
That's it. Any help is appreciated.
Thanks / Lunne