scripting racial change

G

Guest

Guest
Archived from groups: alt.games.neverwinter-nights (More info?)

Being very new to the whole scripting thing I am at a loss on how to script
a racial change from whatever the player chooses at start up to "Undead". I
was thinking simply to change the Subrace to read "Vampire" (easy enough)
and then give the PC the vampire properties skin. This is where I come
undone. I am certain it should be fairly easy to do, but I just can't figure
it out. If anyone could help out here it would be much appreciated.

Thanks,
Pete
 
Archived from groups: alt.games.neverwinter-nights (More info?)

PMyers wrote:
> Being very new to the whole scripting thing I am at a loss on how to script
> a racial change from whatever the player chooses at start up to "Undead". I
> was thinking simply to change the Subrace to read "Vampire" (easy enough)
> and then give the PC the vampire properties skin. This is where I come
> undone. I am certain it should be fairly easy to do, but I just can't figure
> it out. If anyone could help out here it would be much appreciated.


AFAIK, you can't write the PC's race or subrace, you can only read them.
You can equip creature hides to the PC using INVENTORY_SLOT_CARMOR;
however, the hide must be identified in order for the PC to wear it
(can't equip unidentified items). You can either change the identified
flag within the script for create a custom hide in the toolset and check
it as identified.

E.g.

object oPC = GetFirstPC();
object oVampSkin = CreateItemOnObject("nw_creitemvam", oPC);
SetIdentified(oVampSkin, TRUE);
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionEquipItem(oVampSkin, INVENTORY_SLOT_CARMOR));

You might want to search for subrace on NWVault; there are a lot of
systems already out there you could modify. (I think there's even a
vampire subrace script.)

--
Barry Scott Will
Pyric RPG Publications
http://www.pyric.com/
 
Archived from groups: alt.games.neverwinter-nights (More info?)

PMyers wrote:
> Being very new to the whole scripting thing I am at a loss on how to script
> a racial change from whatever the player chooses at start up to "Undead". I
> was thinking simply to change the Subrace to read "Vampire" (easy enough)
> and then give the PC the vampire properties skin. This is where I come
> undone. I am certain it should be fairly easy to do,

I might be wrong about this, but off the top of my head I don't think you can equip a hide/skin to a PC.

What you could do is add a variable or an undroppable item to the PC, and have something in the module that scans the PC
for it on a heartbeat script. This script would apply the vampire properties to the PC if they don't already have them.
(This handles the situation if something dispells what should be permanent properties). Look at the internal script for
the "Oracle" card from the Deck of Many Things for an example. (x0_deck_oracle)

I know you said you were a beginner, so if all this seems rather vague, I apologize but I am short on time. If you need
further direction, ask again and I'll elaborate or someone else here will help you.
--
My NWN Work So Far: http://tinyurl.com/6xy2f
"Pits of red smoke and fog are usually bad."
- Tip from Doom3 Manual
 
Archived from groups: alt.games.neverwinter-nights (More info?)

That worked perfectly. Thanks.

In the end I had to create a custom hide and give it the "Weapon Proficiency
Creature" feat, as it was the only way I could get the PC to equip the hides
and bite.

Thanks again for your help.

Pete
 

TRENDING THREADS