Server Totals
Wilderness - (1)
Le'Or - (0)
Ferrell - (0)
Elysia - (0)
M'Chek - (0)
Deglos - (0)
Visimontium - (0)
Underdark - (0)
Mikona - (0)
Total players: 1
Gallery

Links Menu

EffectPolymorph and merging items

Moderators: Nighthawk4, Dungeon Masters

EffectPolymorph and merging items

PostAuthor: RCon » Sun Feb 21, 2016 11:58 pm

I'm extremely new to NWN coding (but reasonably good at other coding like VBS, Powershell, etc.), but I wanted to give something a shot. I managed to create an item that executes a script when used. Specifically, the script does the following:

- Check if character has remaining uses of the feat Elemental Shape, and quit if not
- Apply the polymorph visual effect
- Apply a polymorph effect, using a row from polymorph.2da
- Decrement the remaining uses of the Elemental Shape

Basically, the idea is to use an item to add more options for Elemental Shape. The above all works, except that the item merging normally present with druid/shifter shape changing doesn't happen. Here's a shortened version of the code I'm using for this:

int POLYMORPH_TYPE_WISP = 84;
object oDruid = GetItemActivator();
if (!GetHasFeat(FEAT_ELEMENTAL_SHAPE, oDruid))
{
FloatingTextStringOnCreature("This form requires available Elemental Shape.", oDruid, FALSE);
return;
}
// Create Polymorph effect
effect ePoly = EffectPolymorph(POLYMORPH_TYPE_WISP);
// Create visual effect
effect eVis = EffectVisualEffect(VFX_IMP_POLYMORPH);
// Apply visual effect to target
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oDruid);
// Apply effect to object
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoly, oDruid);
// Take away one elemental shape
DecrementRemainingFeatUses(oDruid, FEAT_ELEMENTAL_SHAPE);

From what I can tell, the problem here is that EffectPolymorph is just a polymorph, but doesn't include druid/shifter item merging. Is there a different function I can call that will do the polymorphing with item merging? Obviously, such code exists, but is there a way to call it and pass it a polymorph.2da row number?
User avatar
RCon
Legacy DM
Legacy DM
 
Posts: 4719
Joined: Wed Sep 15, 2004 2:19 am
Location: New York, NY (GMT -5)

Re: EffectPolymorph and merging items

PostAuthor: Gorgon » Mon Feb 22, 2016 2:54 am

Avlis' nw_s2_elemshape.nss is probably what you want to look at, since it includes all the ws_inc_shifter.nss functions for merging items. I would have to spend a lot more time digging into it to be helpful (and my stuff is way out of date), but that should get you pointed in the right direction.
"God not only plays dice, he throws them in the corner where you can't see them."
-- Stephen William Hawking (b. 1942) --


Sprucing up ye olde NWN | Modifying nwn.ini and nwnplayer.ini | ~Rare Items Wanted~ | Stealth Modifiers
User avatar
Gorgon
QA's 2nd|CCC Mobster
QA's 2nd|CCC Mobster
 
Posts: 5866
Images: 38
Joined: Fri Oct 17, 2003 10:14 pm
Location: Vancouver, BC, Canada
Timezone: PDT -7

Re: EffectPolymorph and merging items

PostAuthor: RCon » Mon Feb 22, 2016 3:25 am

Yup, looks like all the merging and other code surrounding druid/shifter shapechanging is in nw_s2_elemshape, nw_s2_wildshape, and x2_s2_gwildshp. Anyone know how/where I would find those nss files from Avlis's code?
User avatar
RCon
Legacy DM
Legacy DM
 
Posts: 4719
Joined: Wed Sep 15, 2004 2:19 am
Location: New York, NY (GMT -5)

Re: EffectPolymorph and merging items

PostAuthor: Sarmanos » Mon Feb 22, 2016 3:45 am

I don't know the code for this stuff, but keep in mind that whatever you do may interact with mage transmutant shapeshifts since they seem to pull from the same tables.
Vetinari: I have noted before that you have a definite anti-authoritarian streak, Commander.
Vimes: Sir?
Vetinari: You seem to have retained this even though you are Authority.
Vimes: Sir?
Vetinari: That's practically Zen.
User avatar
Sarmanos
Team Member; Retired with Honors
 
Posts: 2607
Images: 1
Joined: Mon Aug 04, 2003 7:04 am
Location: Massillon, OH
Timezone: GMT -5

Re: EffectPolymorph and merging items

PostAuthor: RCon » Mon Feb 22, 2016 5:07 am

I think Avlis is using shifter code from Iznoghoud; possibly this one: http://neverwintervault.net/project/nwn ... ape-script

Anyway, I got my script working using the ws_inc_shifter.nss and x2_s2_gwildshp.nss from that mod (although obviously I'd want to copy Avlis's version, not the one I found on the vault). Created a plot item that, when used, shapeshifts the druid into Wisp form, with merging, and removes one use of Elemental Shape. Also created a plot item that shapeshifts the PC into Treant form, with merging, and removes one use of Construct Shape. In theory, could create unlimited forms for each shape via the use of such plot items. Vegepygmy Chieftain? Thorny? Gelatinous Cube? Hawk Beastman? Myconid?

Big thanks to Seka for giving me the idea (from the Bardic Music module).

As Sarmanos notes, I would need a copy of the Avlis polymorph.2da (and preferably other 2da files as well) in order to add new lines. Apparently, I need access to the SVN repository to find the Avlis code. Anyone know how I get access to that?
User avatar
RCon
Legacy DM
Legacy DM
 
Posts: 4719
Joined: Wed Sep 15, 2004 2:19 am
Location: New York, NY (GMT -5)

Re: EffectPolymorph and merging items

PostAuthor: Gorgon » Mon Feb 22, 2016 5:34 am

If you don't have CCC access, you'll want to ask for it. Gets you the latest everything, and it is where you'd be submitting the proposal and work, before it goes to QA. I kinda thought you were already part of it for some reason, but I think Micah is still the one to poke about that, or maybe Pleth.

Good luck.
"God not only plays dice, he throws them in the corner where you can't see them."
-- Stephen William Hawking (b. 1942) --


Sprucing up ye olde NWN | Modifying nwn.ini and nwnplayer.ini | ~Rare Items Wanted~ | Stealth Modifiers
User avatar
Gorgon
QA's 2nd|CCC Mobster
QA's 2nd|CCC Mobster
 
Posts: 5866
Images: 38
Joined: Fri Oct 17, 2003 10:14 pm
Location: Vancouver, BC, Canada
Timezone: PDT -7

Re: EffectPolymorph and merging items

PostAuthor: Gorgon » Mon Feb 22, 2016 5:52 am

I'm curious why you want to use an item to add each new shape, instead of just adding it to the regular ability. Maybe as new dialog menu choices, or better yet, something like an ACP command. Is it some sort of reward or quest item?

I'm just not a big fan of even more crystals and plot (or worse, undroppable) items filling up more inventory space, if they really aren't needed. If you have your heart set on items for each shape, you could avoid more palette bloat with them by scripting their creation like augment crystals and the reprocessed junk (all renamed/retagged/altered generic misc items).
"God not only plays dice, he throws them in the corner where you can't see them."
-- Stephen William Hawking (b. 1942) --


Sprucing up ye olde NWN | Modifying nwn.ini and nwnplayer.ini | ~Rare Items Wanted~ | Stealth Modifiers
User avatar
Gorgon
QA's 2nd|CCC Mobster
QA's 2nd|CCC Mobster
 
Posts: 5866
Images: 38
Joined: Fri Oct 17, 2003 10:14 pm
Location: Vancouver, BC, Canada
Timezone: PDT -7

Re: EffectPolymorph and merging items

PostAuthor: tindertwiggy » Mon Feb 22, 2016 8:06 am

Looking great so far.

New shapes would need corresponding entries in Polymorph.2da?

I personally am fine with an item, but as Gorgon said widgets are seen as sub-optimal. Perhaps integration into the crafting menu (like current selection of summons), or slash+text entries in the chat box ala Nob's "/spellbook load/save/list ClassName UserString"?

You will need ccc access and svn access. One current wrinkle is that the svn hosting service is going down. We have not organized a replacement host yet.
Happiness is baked with one part bat guano, one part sulfur.

tindertwiggy
Legacy DM
Legacy DM
 
Posts: 6682
Images: 1
Joined: Tue Jul 16, 2002 12:20 am
Location: Nippon

Re: EffectPolymorph and merging items

PostAuthor: Seka » Mon Feb 22, 2016 8:31 am

tindertwiggy wrote:One current wrinkle is that the svn hosting service is going down. We have not organized a replacement host yet.

It was just recently migrated to a new host. PM avliswebadmin for access, and cc: Hamlet & Micah. Also, request to be added to CCC.
User avatar
Seka
CCC
CCC
 
Posts: 1301
Images: 6
Joined: Tue Jun 10, 2003 12:37 am
Location: Brooklyn
Timezone: EDT (GMT -4)

Re: EffectPolymorph and merging items

PostAuthor: Plethora » Mon Feb 22, 2016 10:14 am

we HAVE organized a replacement!!

pm krackq for svn access
Well, i've heard about the fella you've been dancing with, all over the neighborhood..
...why didn't you ask me baby? Or didn't you think I could..
User avatar
Plethora
Head DM
Head DM
 
Posts: 23767
Images: 10
Joined: Tue Jan 25, 2005 11:46 pm
Location: GMT +11 (DST in effect)
Timezone: +11 (DST)
DM Avatar: Verossa

Re: EffectPolymorph and merging items

PostAuthor: RCon » Mon Feb 22, 2016 2:22 pm

If I get some time tonight, I'll clean up my test mod a bit and post it somewhere for suggestions. I'll pm krackq for SVN access as well. Thanks all.
User avatar
RCon
Legacy DM
Legacy DM
 
Posts: 4719
Joined: Wed Sep 15, 2004 2:19 am
Location: New York, NY (GMT -5)

Re: EffectPolymorph and merging items

PostAuthor: Gorgon » Mon Feb 22, 2016 4:48 pm

You should probably see how CCC works before posting up plans for changes in Avlis to the public.

As far as DM rewards of new forms, persistent variables on the PC hide would do the same as handing out a bunch of items they have to carry (same idea as AMS/Trust unlocks, PrC stuff, quest settings etc). You could add new DM ACP commands for them to hand out the rewards (new DM wand/widget works too, but same problem with making more crap for them to carry).

Up to you how you do it, but less is more when it comes to valuable inventory space. :P
"God not only plays dice, he throws them in the corner where you can't see them."
-- Stephen William Hawking (b. 1942) --


Sprucing up ye olde NWN | Modifying nwn.ini and nwnplayer.ini | ~Rare Items Wanted~ | Stealth Modifiers
User avatar
Gorgon
QA's 2nd|CCC Mobster
QA's 2nd|CCC Mobster
 
Posts: 5866
Images: 38
Joined: Fri Oct 17, 2003 10:14 pm
Location: Vancouver, BC, Canada
Timezone: PDT -7


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Coco, galen_macbyrne, Google [Bot]