Smashing chests

Discussion in 'General Modification' started by Sokaijin, Jul 19, 2006.

Remove all ads!
  1. Sokaijin

    Sokaijin Established Member

    Joined:
    Apr 27, 2006
    Messages:
    166
    Likes Received:
    0
    Okay, as some of you might have seen in another thread I'm trying to find a way to smash open the chests. This will be my first modding project, if it can be done at all right now. It's not anything major to the game, but will be a major (probably not really worth the effort, except in the satisfaction of accomplishing it) task.
    Firstly, since attaching certain flags to objects like containers is not allowed, and trying to create a critter that looks and acts like a chest (which it would still be) would have many pitfalls. Not the least of which being replacing every chest in the game with the new prototype. I have to get the game to allow the chests to be hittable(?), then assign A.C. and H.P. values to each. If this doesn't sound right to someone let me know what your ideas are.
    There is also the problem of traps. Some would be triggered by smashing, while others would not. Probably would be difficult to get the game to recognise the difference, but would be more realistic. This is arguement against the 'critter' thing, I'm not sure the game allows traps to be attached to them (or locks for that matter).
    If anyone has any ideas that would help, like what files control what can be hit and what cannot, I'd be very appreciative. If you think it can't be done, say so, but give a reason why not. I'm very hard-headed most of the time, and won't give up without a good reason. Got a meeting to attend soon, so I'll let all the good ideas roll-in and check them out tonight. Thanx in advance
     
  2. rufnredde

    rufnredde Established Member Veteran

    Joined:
    Apr 8, 2006
    Messages:
    266
    Likes Received:
    1
    Well I can think of a couple of work arounds to the problems you detailed. Not sure which if any of them would work. However if I go to all the trouble of figuring that out, I may as well do this myself. You did indicate that you wished to take on this project, and you indicate that you are very stubborn and hardheaded and will not give up. So have at it.

    I will give you this much. I would probably not try to change the chest itself to a critter. But what if for example there was an invisible PC, a rogue with a script to account, for things like the rogue tool critter not being drawn into combat or anything else that would cause him to not be not noticeable by the player. This spawned critter could be made to make it appear as if your hitting the chest, set off the trap when needed, and even open the lock.

    Like I said have no idea if that would work, and don’t plan to find out.
     
  3. Shiningted

    Shiningted The Thunder of Justice Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,748
    Likes Received:
    376
    Maybe some of these for starters. I am not sure what to do with them, but the game recognises them :)

    'Q_Has_Temporary_Hit_Points'

    Code:
    obj_f_container_begin	102
    obj_f_container_end	120
    obj_f_container_flags	103
    obj_f_container_inventory_list_idx	107
    obj_f_container_inventory_num	106
    obj_f_container_inventory_source	108
    obj_f_container_key_id	105
    obj_f_container_lock_dc	104
    obj_f_container_notify_npc	109
    obj_f_container_pad_i64as_1	118
    obj_f_container_pad_i_1	110
    obj_f_container_pad_i_2	111
    obj_f_container_pad_i_3	112
    obj_f_container_pad_i_4	113
    obj_f_container_pad_i_5	114
    obj_f_container_pad_ias_1	117
    obj_f_container_pad_obj_1	115
    obj_f_container_pad_obj_2	116
    obj_f_container_pad_objas_1	119
    'container_flag_set',
    'container_flag_unset',
    'container_flags_get',
    'container_toggle_open'

    'attack'
    'perform_touch_attack'
     
  4. Sokaijin

    Sokaijin Established Member

    Joined:
    Apr 27, 2006
    Messages:
    166
    Likes Received:
    0
    I'm just looking for some off-the-cuff ideas, like this one. Thanks ruf. I'm beginning to think it'll end up being a fools errand, but then look who's runnin' it. I'll probably search for a solution to learn Troika tried it, found it too complicated and space consuming, so left it out altogether. I'm curious why not all 'objects' can be struck, which file dtermines if an object can be hit or not. Please, oh please, don't tell me it's hard coded or something similiar. Unless it is, then please save me from myself.
     
  5. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    I think the basic premise is if the object in question's object_type is obj_t_npc in the protos it can be struck. If it is something else, then it can't. And I believe that is hard coded. Whether or not a spell can target an object is usually handled in the spell script.

    An interesting experiment would be to write a script that has an NPC attack a chest, and see what happens.
     
  6. rufnredde

    rufnredde Established Member Veteran

    Joined:
    Apr 8, 2006
    Messages:
    266
    Likes Received:
    1
    I'm pretty sure its not a fools errand. I did some really intensive reasearch about how the game is put together in my quest to learn to mod. Even things that are hardcoded can sometimes be overcome. Ted's example is a good overview of what is hardcoded for containers, anything you find out about those functions in the process of trying to do this certainly can't hurt.

    Don't throw your hands up in the air and declare it to be impossible, without turning over a few rocks. There is a really good description of objects and their properties in the project toolset thread.

    Thats my advice for what it is worth.
     
  7. Sokaijin

    Sokaijin Established Member

    Joined:
    Apr 27, 2006
    Messages:
    166
    Likes Received:
    0
    I'm not quitting yet, not by a long shot. Just bracing myself for the worst, while pushing into the fray. Like I said before, just starting out in the modder arena, so I will be a bit slow at first. Oh well, you got to start somewhere. Thanks, again, for the help.
     
  8. Shiningted

    Shiningted The Thunder of Justice Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,748
    Likes Received:
    376
    Wait wait wait... all we need to do is achieve a combat animation, not an actual attack, the rest can then be thunk out internally: whether u succeeded, add a floatline to tell u the outcome, or a script to trigger the trap if it is there etc.

    Doesn't the breakfree script use the combat animation? How about turn the PC to face the container then send a breakfree signal? A variant of:

    target.obj.d20_send_signal(S_BreakFree)

    We can fire the prone animation at will, ditto the wand animation, i see no reason we can't figure this out.
     
  9. Sokaijin

    Sokaijin Established Member

    Joined:
    Apr 27, 2006
    Messages:
    166
    Likes Received:
    0
    okay, since I've got an early morning tomorrow (up at 4 f'ing a.m.), I'm going to just post quickly and get my modder hat on before bed (if I make it to bed). Just want to say thanks for input everyone, and I'll research all your ideas. 'specially that last one Ted, it sounds like the best solution at the moment.
    'Night all
     
  10. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    255
    Ok, before I start, I haven't read this thread in any great detail, but here are my ideas...

    Chests have a hardness value (much the same as damage reduction) and usually not too many HP.

    How about swapping out the real chest for a chest critter in the san_start_combat script, and swapping back to the chest in the san_end_combat script, the critter could have a script in it's san_dying script to either unlock the chest before swapping back to the chest, or giving the chest's key to the group.

    Just a thought.
     
  11. Shiningted

    Shiningted The Thunder of Justice Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,748
    Likes Received:
    376
    Axl, are u saying its not a strength thing, any chest can be just smacked thru if u do enough 'hp' damage? I guess that makes sense but it means locks become useless, the only issue becomes how many potions u smash (as far as i can tell).
     
  12. Lord_Spike

    Lord_Spike Senior Member Veteran

    Joined:
    Mar 25, 2005
    Messages:
    3,151
    Likes Received:
    1
    The Galeb Duhr comes to mind. But do we really want this to become NWN? Not because of Allyx's suggestion, but the smashing in general. It's either locked or unlocked. Smashing into them breaks things; opening locks does not. They are built for the sole purpose of securing valuables. Why tamper with this? Other things are far more important. Knock, Chimes of opening, and the abilities of the Rogue, et al, fix the locked chest problem. Keys...don't keys exist in this game? Allrem has one, IIRC. What is with all the bother of smashing chests?
     
  13. krunch

    krunch moving on in life

    Joined:
    Aug 9, 2005
    Messages:
    3,280
    Likes Received:
    0
    I don't see any great need to be able to smash chests, that is, unless to be able to roleplay and a character be able to vent frustration upon a chest when it is determined the chest has crappy loot. Regarding such, maybe a script could be written and added to Fruella for her to go berserk and smash a chest just for RPG entertainment value. Now, that would be funny.
     
  14. Sokaijin

    Sokaijin Established Member

    Joined:
    Apr 27, 2006
    Messages:
    166
    Likes Received:
    0
    This is one possibility I've mentioned ( I know you haven't read whole thread, no need to ) many potential problems. But if it turns out to be the best way, I'm willing to do the work.
    Yes, in fact, smashing chests is just a matter of doing enough HP damage to it. PHB has workable rules for breaking any object (chests,jewelry,building or city walls, etc...) taking into account the objects material hardness and size (DR and HP respectively). That's why you can buy a sledgehammer and/or crowbar, they work on locked or stuck doors as well. Not only do risk damage to the chests contents, you also run the risk of attracting unwanted attention from nearby residents of the dungeon, or setting off most traps.
    In a sense, these are the same issue. I agree with you, to a point. In the opener I admiitted this was not really important to ToEE. It is just that someones infantile rundorrings about the chest DC's got me thinking about how this would have been handled by my PnP group. Our response would, in many circumstances, be to smash it open. Which is more realistic than "hey, let's just come back to it later. It's not like there are any other adventurers in the world who might find it.", unless your used to DM's who don't give the possibility that anything left behind will be gone when you return (what were the gnomes doing in the moathouse? Just out for a stroll and fell in?). If thats the case, does he also let you never be surprised, stolen from, tricked, etc... I hope not. The purpose is to secure your rightful stake when your rogue is unable to do so, for whatever reason.
    Again, I admit it isn't of any real significance in ToEE, and probably won't be worth the effort in gaming terms. But if I can find a good, workable solution, then I'll consider it a learning experience at the very least. i do appreciate your comments, the pos. more than the neg., but even the negative comments help me keep the whole thing in perspective.
     
  15. Zebedee

    Zebedee Veteran Member Veteran

    Joined:
    Apr 2, 2005
    Messages:
    1,755
    Likes Received:
    0
    Even if it proves to be not such a great idea for chests at the moment, perhaps doors might be more generally acceptable and with less issues surrounding gameplay effects? Wouldn't the basic principles be the same as for chests in relation to how you implement it? And there's nothing to say that you can't overcome any problems which may occur with chests themselves :)

    Just a thought.
     
Our Host!