How to access thrown items 'carried' by monsters?
How to access thrown items 'carried' by monsters?
For example if I throw an axe at a monster it will 'carry' it until it dies. Is there any way to access the items carried by monsters via script? I tried findEntity on the axe id, but it returns nil if the axe is being carried by a monster.
Alternatively... is there a way to stop items being carried by monsters when you throw them?
Alternatively... is there a way to stop items being carried by monsters when you throw them?
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: How to access thrown items 'carried' by monsters?
ok to answer this part of my own question...Grimwold wrote:Alternatively... is there a way to stop items being carried by monsters when you throw them?
Code: Select all
sharpProjectile = false,Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: How to access thrown items 'carried' by monsters?
Did you ever get an answer to this question? I really need to find out what items a monster is carrying using a script.Grimwold wrote:Is there any way to access the items carried by monsters via script?
Re: How to access thrown items 'carried' by monsters?
Unfortunately not. I found a way round my problem by forcing the throwing axe not to get "absorbed".Lark wrote:Did you ever get an answer to this question? I really need to find out what items a monster is carrying using a script.Grimwold wrote:Is there any way to access the items carried by monsters via script?
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: How to access thrown items 'carried' by monsters?
Okay, thanks. I've circumvented my problem by killing the monster, seeing what items it drops, destroying the dropped items, creating the monster again, and adding the items back in. Crazy, but it almost works. Some monsters drop extra items like shields and spears, so those are getting doubled up, but at least I'm not losing other more interesting items they're carrying. And yes, this is for another over engineered script that I'll post soon. I suppose I can check the type of monster in the square and delete the double items. More over engineering... Thank you, -Lark
Re: How to access thrown items 'carried' by monsters?
Thinking about the problem after replying to you, that was the solution I came up with too... although I was going to teleport the monster away before destroying it, and spawn a new one... my concern was that you would lose any damage done to the monster that way... but I was coming at it from the point of view of my returning throwing axe... where the monster would be right in front of the player when I wanted to access the items.
EDIT - so, without looking it up, it's possible to add items to monsters on-the-fly?? so completely random item drops are a possibility?
EDIT - so, without looking it up, it's possible to add items to monsters on-the-fly?? so completely random item drops are a possibility?
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: How to access thrown items 'carried' by monsters?
Monster:addItem(item) is a thing, yes.Grimwold wrote:EDIT - so, without looking it up, it's possible to add items to monsters on-the-fly?? so completely random item drops are a possibility?
Re: How to access thrown items 'carried' by monsters?
Fantastic, thanks for taking the time to reply. It just never occurred to me until now.Decayer wrote:Monster:addItem(item) is a thing, yes.Grimwold wrote:EDIT - so, without looking it up, it's possible to add items to monsters on-the-fly?? so completely random item drops are a possibility?
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: How to access thrown items 'carried' by monsters?
Just to be clear, you need to use something like monster:additem(spawn("blueberry_pie")) to make it work. I wonder what would happen if I added the items back to the new monster that fell on the floor. Would this duplicate them or move their location to the monster? I'll have to try that tonight.
I hadn't really thought about the health issues.
While I'd prefer the monster damage to be preserved, without the right query abilities, I'm happy with what I have because health isn't the big issue for what I'm doing... I was going to teleport the original monster away, work with the substitute, and then teleport the original back when needed, but I wasn't sure how to make the script really portable, yet have a hidden holding cell for the monster. It would solve the health and duplicate item problems very nicely, however... darn!
This is a much better solution and I just got everything working as is!
I wish we could just have a routine that would return items carried and ones that set and queried monster health. This would kill 50 lines or more of code and eliminate the need to save the original!
Thank you, -Lark
I hadn't really thought about the health issues.
I wish we could just have a routine that would return items carried and ones that set and queried monster health. This would kill 50 lines or more of code and eliminate the need to save the original!
Thank you, -Lark
Re: How to access thrown items 'carried' by monsters?
Petri counseled not to do this sort of thing, but I don't really understand what happens under the hood. I know that it will not move their location, but will duplicate them, and I had taken the step to then destroy the originals on the floor. Here is that thread:Lark wrote:I wonder what would happen if I added the items back to the new monster that fell on the floor. Would this duplicate them or move their location to the monster?
viewtopic.php?p=34191#p34191
Finished Dungeons - complete mods to play
