Page 1 of 1

Causing a creature to drop an item

Posted: Tue Jun 09, 2020 10:51 am
by Leslie
Hi all,

is there a way to have a creature drop a carried item? I would like to implement some kind of pickpocketing, as an attack method, which causes a creature to drop an item.
Thanks for any clues!

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 1:15 pm
by Saumun
Is this an empty hand attack method?
It's easy to do if you're using an object, because you can use the object's 'convert' functions, but probably less so without one.
I think I have an idea of how it could work though. I'll get back to you if I come up with something.

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 1:28 pm
by Saumun
I should add that it can be done much more easily with direct clicking on the monster, but you mentioned attack methods so I guess this isn't what you want.

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 1:32 pm
by Leslie
It would be an empty handed attack method, which should only be available after some Ninja levels have been made.
But I guess clicking on the creature would also be okay. A relay could be put in between to check for the Ninja levels... and I would save a slot for empty handed attack methods :)

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 2:13 pm
by Saumun
Well for a direct click, you could clone the creature and name them, say, CREATURE_CARRYING and CREATURE_EMPTY, then set Click 1, under 'Additional Action', on the carrying creature to go to your relay to check for the ninja level. If this is high enough go to another relay to check that you clicked with the mouse empty (in the relay conditions, set 'party' as OBJECT_ON_MOUSE, then click to 'object' at the bottom, and leave it as NULL).
If it checks out, have it activate an action with SWAP_TILE_INFRONT (Object 1 as the carrying monster and Object 2 as the empty one), and also another action with CREATE_NEW_IN_MOUSE and the object of your choice.
Also make sure CREATURE_CARRYING converts to itself under 'convert on event' and NOT to the empty creature. Otherwise it will swap before the checks have taken place.

As far as using an attack method, I'd have to think on it more.

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 2:24 pm
by Leslie
Thanks Saumun, I will give that a try :)

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 2:39 pm
by Saumun
I also should have mentioned that the carrying creature doesn't have to actually be carrying the object, as it is created on the mouse.
In fact it's better to not have it carry the object in this case, as it would be unnecessarily added to the overall object count... for which there is a limit.

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 8:05 pm
by Leslie
I did not get it to work.
The step with the "click 1" action fails. I configured to ACTION_OBJECT_ACTIVATE and wanted to choose the relay. As I cannot select a specific relay but only the object type in general, I used a cloned relay called WALLITEM_RELAY_PICKPOCKET, which does the checks. One such relay is put on a wall.
But this action never happens. In fact, even if I use a simple text message instead of the relay, the object does not get activated.

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 9:21 pm
by Saumun
Did you set the monster to convert to itself in the 'convert on event' space above?
It will not work unless you give the creature a 'convert on event'. You cannot leave it blank.

I was going from memory when I posted, but I did the same thing in Underverse. It definitely works if set up right.

Re: Causing a creature to drop an item

Posted: Tue Jun 09, 2020 9:39 pm
by Saumun
Also, make sure CREATURE_EMPTY has all the info removed from 'Click 1'.

Re: Causing a creature to drop an item

Posted: Wed Jun 10, 2020 2:25 am
by Saumun
Hi Leslie,

I've just sent you a pm with a link to an example.
It uses ant men, and SWAP_TILE instead of SWAP_TILE_INFRONT. Explanation is in the pm.

Re: Causing a creature to drop an item

Posted: Wed Jun 10, 2020 4:14 pm
by Gambit37
Be aware that creatures click zones are offset from their actual size, see this bug which was never fixed:
viewtopic.php?f=4&t=28883

Re: Causing a creature to drop an item

Posted: Thu Jun 11, 2020 4:01 pm
by Leslie
I would have another question... if I use the SWAP action to replace a creature by another, can I configure how many health points the new creature should have?

Re: Causing a creature to drop an item

Posted: Thu Jun 11, 2020 4:09 pm
by Saumun
I’m afraid (as far as I know) it swaps to a creature with roughly full health (as set in the monster’s values).
I could be wrong here and you maybe could experiment, but I think that is how it works.

Using SWAP_GLOBAL_FAST retains a monster’s health and items, but of course you couldn’t use it in this case because it would swap ALL the monsters of that type.
You could name all of the monsters individually to get around it, but I definitely wouldn’t advise it because your custom content would rise rapidly towards the limit.

Re: Causing a creature to drop an item

Posted: Thu Jun 11, 2020 4:17 pm
by Leslie
Thanks a lot!
It appears that there are many things about RTC which I still don't know. :)

Re: Causing a creature to drop an item

Posted: Fri Sep 11, 2020 7:13 pm
by Chaos-Shaman
Hi there, been a very long time since I messed with RTC, Who knows how many ways this can be done. Maybe if the creature has a set attack of one tile, and that its attack is set to create new on floor the item it has been given and then swap the creature to a duplicate that no longer carries said item might work. If you are referring to a creature that has thieving skills then the creature has to be killed by a damager and then the item drops and at the same time the haze or whatever the creature turns into when killed can then be swapped out to the same monster type that has no more items. Sorry for the late reply but I am just returning to the community. I am so glad people still have interests in DM. RTC is a great little unfinished and unsupported engine yet still sparks interest in people. Amazing. Do not have the time right now to do testing but I am sure you'll find a way.