I've been messing around with the idea of creating an html based trading system in a pop-up window. Now, I can easily create the href's by simply looping through my inventory, however Im a little stuck with the client/Topic().
What I basically want to know is if there is any shorthand way of doing this, other than looping through all the names and seeing if they match up with the href.
~Zyhtyr.
ID:164105
Jul 16 2007, 2:29 pm
|
|
Jul 16 2007, 2:39 pm
|
|
Instead of using names, you can use references. DM comes with a very neat macro (\ref) that get the "address" of an object and stores it in a string. Therefore, the end output of \ref[some_reference] would look like "[0x30000000]", or something similar to that. To dereference the pointer, you use locate() proc. For your item-picking example, you can use \ref to point to an individual object in your inventory, and use locate() to get the reference of it when it is sent through Topic(). Here is an example from my article (unfortunately, not available at this time).
|
In response to Unknown Person
|
|
Thanks UP, Im pretty sure I can get a clean system working from the info you gave me. Appreciated.
~Zythyr |
In response to Zythyr
|
|
Ok, I've hit a snag.
mob I made this drop code to make sure everything would initially work fine, but it doesn't. Im having problems calling the Drop_Item function. As far as I can tell it isn't recognising O as the object, and I get the error - <font color=red>runtime error: Cannot execute null.Move(). proc name: Trade Item (/mob/proc/Trade_Item) usr: Dice1989 (/mob/Player) src: Dice1989 (/mob/Player) call stack: Dice1989 (/mob/Player): Trade Item("\[0x2000000]") Dice1989 (/mob/Player): Topic("src=\[0x3000000]&action=drop&v...", /list (/list))</font> Again, I'd appreciate any help you can give me to sort this out. ~Zythyr. |
In response to Zythyr
|
|
Simple careless error: you're using the "value" variable instead of the new type casted and dereferenced variable, "target".
|
In response to Unknown Person
|
|
Ungg...thanks again.
|