Skip to content

Scripting Help - Character Restrictions, Ghostly Creatures

I'm working on a new adventure, and I've come across a few things that I need a hand figuring out how to do. I'd appreciate any help that anyone has to offer!

1. Restrict race/class options during character creation or module load, such as disallowing halflings and monks as PCs. I'm pretty sure it's possible, but I can't find anything on how to do this.

2. Give creatures a "semi-transparent" appearance, similar to how an invisible creature looks when it has been sensed. Right now I'm doing this by just making them invisible OnSpawn, but that means they can't be seen at all when the PC is more than a few steps away. I'd like for them to always be semi-transparent, no matter where the PC is viewing them from. And if there's a way to give them other ghostly features (hazy appearance, glowing eyes, etc) without just using "ghost" creature models, that would be doubly awesome.

I'm sure there will be more that I can't figure out on my own, but that's what I'm struggling with now.

Comments

  • NeverwinterWightsNeverwinterWights Member Posts: 339
    edited February 2018
    1. Can probably be done during character creation by altering a 2da file somewhere. I'm not so familiar with that. As far as scripting it goes once the player gets into the game there are several different ways to go about it. For example if you wanted to boot a player once they enter the module or an area you might do something like:
    void main() { object oPC = GetEnteringObject(); int iRacialType = GetRacialType(oPC); if (iRacialType == RACIAL_TYPE_HALFLING) BootPC(oPC, "This server does not allow halflings."); //or int iClass = GetLevelByClass(CLASS_TYPE_MONK, oPC); if (iClass) BootPC(oPC, "This server does not allow monks."); }
    You could also use the same checks above to just prevent them from using a transition to leave the starting area or what not.

    2.) Again just depends on where you want to add the effects but basically something like:
    void main() { object oPC = GetEnteringObject(); effect eGhost = SupernaturalEffect(EffectCutsceneGhost()); effect eGhostVisual1 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_GHOST_SMOKE)); effect eGhostVisual2 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_GHOST_TRANSPARENT)); effect eGhostVisual3 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_ICESKIN)); effect eGhostVisual4 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_GREY)); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhostVisual1, oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhostVisual2, oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhostVisual3, oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhostVisual4, oPC); SetFootstepType(FOOTSTEP_TYPE_NONE, oPC); }
    I used the Supernatural effect link before hand so that the effects stay during resting. While in the script editor you can look over the other VFX_DUR_XXXXX constants and play around with different visuals and see what works for you. There are also glowing eyes in there. Different colors you can glow etc.
  • Lex23Lex23 Member Posts: 34
    Sweet, thank you! That's exactly what I had in mind, and also opens up all kinds of possibilities that I wasn't aware of.

    Does BootPC work in a single-player module? I can't get it to work OnClientEnter when I'm testing with a halfling monk character.
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    I believe BootPC is only for multiplayer servers.
    Rifkin
  • RifkinRifkin Member Posts: 141
    edited February 2018

    I believe BootPC is only for multiplayer servers.

    Yes, what you want instead is:

    EndGame("Ending");

    But perhaps, put a delay before ending, and send a message to the pc to inform them that they cannot use that class/feat/etc
    NeverwinterWights
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    edited February 2018
    As per @Rifkin suggestion:
    void main() { object oPC = GetEnteringObject(); int iRacialType = GetRacialType(oPC); if (iRacialType == RACIAL_TYPE_HALFLING) { SendMessageToPC(oPC, "This module does not allow halflings. The game will end in 5 seconds."); DelayCommand(5.0, EndGame("Ending")); } //or int iClass = GetLevelByClass(CLASS_TYPE_MONK, oPC); if (iClass) { SendMessageToPC(oPC, "This module does not allow monks. The game will end in 5 seconds."); DelayCommand(5.0, EndGame("Ending")); } }
    The delay may need to be longer or shorter or what not.
    Post edited by NeverwinterWights on
  • Lex23Lex23 Member Posts: 34
    Thanks, that did the trick! You guys are awesome
Sign In or Register to comment.