Author Topic: Issues with creating new trap type?  (Read 345 times)

Legacy_TheSpiritedLass

  • Hero Member
  • *****
  • Posts: 1118
  • Karma: +0/-0
Issues with creating new trap type?
« on: January 28, 2012, 03:54:15 pm »


               So I'm working on a new custom banana peel trap type for the CCC Rogue theme and have hit a few problems. 

What is working correctly:
- A trap trigger drawn in the toolset works great in game and gleefully dumps players on their butt.  *cackles*
- Custom trap inventory item looks nifty in game.

What is making me giggle:
- Searching the tlk file there was no "banana" line but I did find an "Oops!" line.  Which works well for the trap name.  *grins*

traps.2da line:
          Label              TrapScript         SetDC   DetectDCMod   DisarmDCMod   TrapName   ResRef          IconResRef    
100   BananaPeel   t_naner_peel    2           2                         10                          38         CCC_IT_TRAP012  iit_trap_012

iprp_trapcost.2da line:
             Name   Label                Cost   Minor  Average  Strong   Deadly   Epic   
12         38         BananaPeel    1.2      12       24            36          48            60 

What is really ticking me off:
- Using the custom trap icon to set a trap DOES drop a green trap trigger.   However when I recover the trap I get Minor Blob of Acid Trap instead of the banana peel.  Did some poking about with the iprp_trapcost 2da line.  If I add a blank line at 12 and move my line down to 13, I get a different trap type.  So there is some connection going on there that I can't figure out.

- Still dealing with the trap my player layed down in game, when I trick a rat to run through it, the little rodent triggered a spike trap instead of slipping on a banana peel.  Which is funky on multiple levels.  One it didn't trigger my trap script and two it fires a different script than the trap type I got with the problem above (acid blob).

What is minorly ticking me off:
- I'd like the banana peel placeable to show up, in the middle of the trap area, when a player sets the trap but I'm guessing that isn't going to happen as I can't find a way to script it to do that.

Any clue how to get this silly banana peel to stop ticking me off?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Issues with creating new trap type?
« Reply #1 on: January 28, 2012, 04:58:46 pm »


               collumns Minor, Average, Strong etc. points into traps.2da so you need to create five different lines in there and put their numbers in there, then you can set up/recover correct trap

- I'd like the banana peel placeable to show up, in the middle of the trap area, when a player sets the trap but I'm guessing that isn't going to happen as I can't find a way to script it to do that.

it is not possible to get "middle" of trap/trigger, but you can create the placeable under object triggered the trap, or you can search nearest waypoint of the same tag as trap and if exist, create the banana placeable there
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Issues with creating new trap type?
« Reply #2 on: January 28, 2012, 05:21:31 pm »


               

TheSpiritedLass wrote...

So I'm working on a new custom banana peel trap type for the CCC Rogue theme and have hit a few problems. 

...

What is minorly ticking me off:
- I'd like the banana peel placeable to show up, in the middle of the trap area, when a player sets the trap but I'm guessing that isn't going to happen as I can't find a way to script it to do that.


  This part you could do with a tag script based on unaquire.  Make a delayed routine (not sure the time needed because I don't know the sequence when a trap is used) that checks if the trap item is still valid after the UnAquire event fires.  If it's still valid, do nothing.  If it isn't, the player must have set the trap up, and you could use their location to create the banana peel placeable at.

  Opposite this, OnAquire check for a nearby peel placeable, and destroy it if present (and within a reasonable distance).  This helps simulate picking it up again.
               
               

               
            

Legacy_Vibrant Penumbra

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Issues with creating new trap type?
« Reply #3 on: January 28, 2012, 05:38:38 pm »


               (partial disclosure, this is BF talking)

OR make the peel an item and use a tag-based script onAquire and unAquire.

That is, when the peel is dropped, create the trap around it and when it is picked up, destroy the trap.
Seems to me it would be easier to create a trap from the item-dropped location than finding a place to create a placeable from all that other stuff.

Hmmmm, also destroy item if trap is disabled.

If Pen lets me touch her banana, I'll work on this. But not real soon.
Edit: I've been informed that this is The Spirited Lass' banana and I am not allowed anywhere near it. Eh.
               
               

               


                     Modifié par Vibrant Penumbra, 28 janvier 2012 - 05:40 .
                     
                  


            

Legacy_TheSpiritedLass

  • Hero Member
  • *****
  • Posts: 1118
  • Karma: +0/-0
Issues with creating new trap type?
« Reply #4 on: February 01, 2012, 08:11:21 pm »


               *pounces on ShaDoOoW*  The values in iprp_trapcost.2da was exactly my problem.  Thanks =)

For now, I'm passing on the idea of having the banana peel mdl show up when a player sets the trap.  Thanks for the suggestions Failed.Bard and Pen. *beaming*

Aside from a minor issue with the timing of the voice chat versus the goofy trap triggered messages (ughs, timing is SUCH a pain in NWN), the trap is done. =)
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Issues with creating new trap type?
« Reply #5 on: February 01, 2012, 10:51:49 pm »


               <just noticing...>

Have the placeable appear *after* the trap is triggered... on the location of the triggerer. =)
Obviously, it was there all along, they just didn't notice it.

Like this sweet, rich piece of chocolate I'm about to eat ;-) It was here all along...

<...little things>
               
               

               
            

Legacy_TheSpiritedLass

  • Hero Member
  • *****
  • Posts: 1118
  • Karma: +0/-0
Issues with creating new trap type?
« Reply #6 on: February 02, 2012, 02:01:21 am »


               Heya Rolo,
I actually had the whole placeable peel thingy mapped out in my head, just not enough time to make it happen in reality. '<img'>  Combination of unaquire (kudos to Failed.Bard  for that idea) and dropping the placeable nearly on top of the player that set the trap.  Since the player normally ends up standing in the middle of the mischief they just planted.