[SOLOUTION] printing automated object link of dropped items from list.

Shadow666999
14 Oct 2021, 08:56
InRoomFloor = ScopeReachable()
InRoomFloor = FilterByAttribute(InRoomFloor,"hasbeenmoved", true)
InRoomFloor = FilterByNotAttribute(InRoomFloor, "parent", Player)
list remove (InRoomFloor, Player)
foreach (obj, InRoomFloor) {
  msg (Replace(("{"+ obj + "}"), "Object: ", "object:"))
}

mrangel
14 Oct 2021, 09:44

This seems a rather convoluted way to do it. Why not something like:

InRoomFloor = ScopeReachableNotHeld()
InRoomFloor = FilterByAttribute(InRoomFloor,"hasbeenmoved", true)
foreach (obj, InRoomFloor) {
  msg (GetDisplayNameLink (obj, "object"))
}

or:

InRoomFloor = ScopeReachableNotHeld()
InRoomFloor = FilterByAttribute(InRoomFloor,"hasbeenmoved", true)
msg (FormatList (InRoomFloor, "<br/>", "<br/>", ""))

Shadow666999
15 Oct 2021, 00:16

@mrangel
it would still show player, and inventory, the code i have dose not and also will display object links automatically, and is far more superior then your code.


mrangel
15 Oct 2021, 08:20

it would still show player, and inventory,

No it wouldn't. ScopeReachableNotHeld returns only objects that are in the room.

You use ScopeReachable, which internally runs ScopeReachableNotHeldForRoom and ScopeReachableInventory, and combines those lists together. So you're taking the list you want, adding the inventory, and then removing the inventory items again.

The only difference between the results is that your script will display any objects inside a bag that the player is holding.