Causing a creature to drop an item

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
Leslie
Adept
Posts: 252
Joined: Wed Apr 27, 2011 2:25 pm
Location: Germany

Causing a creature to drop an item

Post 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!
What are the bells that never ring? Enchanting smell, beautiful thing.
What are the lions that never roar? The wind blows their children far over the shore.
What are the gloves not worn by the hand? But worn by the foxes throughout the land.
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Causing a creature to drop an item

Post 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.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Causing a creature to drop an item

Post 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.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
Leslie
Adept
Posts: 252
Joined: Wed Apr 27, 2011 2:25 pm
Location: Germany

Re: Causing a creature to drop an item

Post 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 :)
What are the bells that never ring? Enchanting smell, beautiful thing.
What are the lions that never roar? The wind blows their children far over the shore.
What are the gloves not worn by the hand? But worn by the foxes throughout the land.
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Causing a creature to drop an item

Post 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.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
Leslie
Adept
Posts: 252
Joined: Wed Apr 27, 2011 2:25 pm
Location: Germany

Re: Causing a creature to drop an item

Post by Leslie »

Thanks Saumun, I will give that a try :)
What are the bells that never ring? Enchanting smell, beautiful thing.
What are the lions that never roar? The wind blows their children far over the shore.
What are the gloves not worn by the hand? But worn by the foxes throughout the land.
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Causing a creature to drop an item

Post 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.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
Leslie
Adept
Posts: 252
Joined: Wed Apr 27, 2011 2:25 pm
Location: Germany

Re: Causing a creature to drop an item

Post 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.
What are the bells that never ring? Enchanting smell, beautiful thing.
What are the lions that never roar? The wind blows their children far over the shore.
What are the gloves not worn by the hand? But worn by the foxes throughout the land.
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Causing a creature to drop an item

Post 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.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Causing a creature to drop an item

Post by Saumun »

Also, make sure CREATURE_EMPTY has all the info removed from 'Click 1'.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Causing a creature to drop an item

Post 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.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Causing a creature to drop an item

Post 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
Leslie
Adept
Posts: 252
Joined: Wed Apr 27, 2011 2:25 pm
Location: Germany

Re: Causing a creature to drop an item

Post 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?
What are the bells that never ring? Enchanting smell, beautiful thing.
What are the lions that never roar? The wind blows their children far over the shore.
What are the gloves not worn by the hand? But worn by the foxes throughout the land.
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Causing a creature to drop an item

Post 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.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
Leslie
Adept
Posts: 252
Joined: Wed Apr 27, 2011 2:25 pm
Location: Germany

Re: Causing a creature to drop an item

Post by Leslie »

Thanks a lot!
It appears that there are many things about RTC which I still don't know. :)
What are the bells that never ring? Enchanting smell, beautiful thing.
What are the lions that never roar? The wind blows their children far over the shore.
What are the gloves not worn by the hand? But worn by the foxes throughout the land.
User avatar
Chaos-Shaman
High Lord
Posts: 2642
Joined: Wed May 03, 2006 7:26 pm
Location: The Gates of Hell

Re: Causing a creature to drop an item

Post 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.
keep your gor coin handy
Post Reply