Objects not moving Game engine not reading move

I had objects moving from inventory to a closet after running an after picking it up script, but because the scripts were playing out yet items were not moving from inventory, I changed the script to not have any add to inventory, which in retrospect was entirely unuseful, instead just run the script, and then move items to closet, but this is not my own script, it is tabs, so it should run, there's no room for typos, instead the script runs up to the point where it is supposed to move to the closet. It just sits there. The script to move was not put in brackets or separated out from the rest of the script. I just hit the plus sign, move object, and add, then, chose the object and room to move it to. It still does nothing. The object is accurate. The room is a real room. What's going on?


What do you mean it does nothing? Is the object accessible where it shouldn't be?


Yes, I had some objects in the room. Look script would add them to inventory. Inventory script would add points run an msg and move the object to another room, but the objects were just sitting in inventory. I thought I must have forgotten to save or added the script to a different copy of the game and not made the other copies, but I checked the script and indeed it said move (the correct item) to closet. I went and checked the code view because sometimes it has said something different from the tabs view, but it was all aligned. I decided it was the add to inventory tab affect and changed the script for these objects to not adding to inventory and just move to closet, but then they stayed in the room. They just stayed in the room. I looked at the tab. It said closet. It was a complete tab, not an expression, but room or object. I checked each of these items to move, they were all the right items, but when I thought about it, it wasn't hurting the game, just my sanity. Only, now I have redone everything in that area, and I think everything is moving to closet, now. It was last time I played. Now that I think of it, sometimes adjusting score and health takes an actual turn longer than it should (iny opinion) in another game, and I moved move object up to the first thing in the sequence in case it was waiting for status attributes to update, and that might be what was wrong with it, before.
So.
It is sometimes an unsettling experience.


Yes, I had some objects in the room. Look script would add them to inventory.

That sounds like it should work

Inventory script would add points run an msg and move the object to another room

Not sure what you mean by "inventory script". Do you mean the take script, which is run when the player uses the "take" command on an object? Because that doesn't run for objects that are moved to the inventory by another script.

If you want to make an object behave as if the player had taken it, you would do:

if (HasScript (object, "take")) {
  do (object, "take")
}
else {
  AddToInventory (object)
}

or if you want to check things like weight limits as well:

DoTake (object, false)

(note that DoTake starts by checking whether the object is reachable, the room isn't dark, and similar things, so using it can be quite inefficient if those checks aren't needed)

If the objects are still in the room, something weird seems to be happening. I've seen this problem come up a lot, but it usually seems to be a problem with expectations. (New users assume that the object is still in the room because there wasn't a message to say it moved).
If it's still showing in the "Places & Objects" pane, I'd wonder whether the sidebar has failed to update for some reason… this unfortunately seems to happen sometimes and I've still not been able to figure out why (objects move, but the sidebar doesn't always update)


No. That explains everything. They were not doing with he take script because they were "added to inventory" instead of taken. They are working fine now.

Thanks. I really enjoy getting to work with the scripts I get from you, mrangel, by the way.


Log in to post a reply.

Support

Forums