Aller au contenu

Photo

Looking for a script or guidance.


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
Rio420

Rio420
  • Members
  • 63 messages
Basically, we have immortals in the game that monitor and ref gameplay. I'm trying to find a script that will apply the same affects that a DM would have via disappear and appear. The script would be attached to an item, in my case, a wand. Any ideas how this can be accomplished without having to polymorph into something?
 

#2
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Have you considered SIMTools? If your immortals are in the role of dms, but logged in as players, it's pretty much exactly what you want and a ton more. dm_invuln gives godmode, and dm_invis makes them invisible.

If that doesn't suit, let me know, and I'll post code for dm_invis as an item instead of a chat command.

Funky

Modifié par FunkySwerve, 30 août 2013 - 09:52 .


#3
Rio420

Rio420
  • Members
  • 63 messages
Thanks for the reply Funky, yeah I pretty much have to go with option B, the module already has an existing system for immortals (Player DMs), but the way it handles going invisible is almost ludicrous. You basically polymorph into an invisible creature with movement speed increases, but you can't re-appear because you can't use the item that you did to disappear in the first place. The only work around is to carry around food and rest, which is on a 3 hour (game time) cooldown each time you want to rest.

Basically, I just need a simple script to add to their wand that causes them to go dm_invis and can be used again to make them reappear.

#4
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
You can't use items while poly'd, at least in vanilla (sans nwscript). You're right, that system is ludicrous, if that's the only reason it's done that way, which I kind of doubt (but I've seen sillier things). I could make you a potion that'd do that, but you'd be much better served by an item that made them cutscene invis and ghosted, I think - like the wand you're talking about. Are you using tag-based scripting?

Funky

#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
umm, I agree that I do not like the system. But can you not cancel a polymorph from the radial. At least that is, if they are using a polymorph and not just changing the appearance.

#6
WhiZard

WhiZard
  • Members
  • 1 204 messages
Setting a potion to plot will make it the equivalent of 1 use per day (rest). So you could have the potion force rest you (so you can use it again infinitely) in addition to its intended use.

#7
Rio420

Rio420
  • Members
  • 63 messages

FunkySwerve wrote...

You can't use items while poly'd, at least in vanilla (sans nwscript). You're right, that system is ludicrous, if that's the only reason it's done that way, which I kind of doubt (but I've seen sillier things). I could make you a potion that'd do that, but you'd be much better served by an item that made them cutscene invis and ghosted, I think - like the wand you're talking about. Are you using tag-based scripting?

Funky


Basically, I created the wand through the toolset first then wrote the conversation script. Then, I attached the script by using the module script for OnActivateItem which checks for the Item tag and then loads the appropriate conversation script.  Then I wrote the scripting for each of the item options in the wand.

- Arm

Modifié par Rio420, 31 août 2013 - 07:20 .


#8
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Here's a script that will do what you want. Just name it for the tag of the item. It assumes only that you aren't using the module as an effect creator for any other effects on the immortals; I did it this way for the sake of simplicity. A better way is to use a specific object as an effect creator, and check it instead of the module, but that requires placing a nonstatic place in an area (preferably plot), and giving it a unique tag you can use GetObjectByTag to find it with. It's better because sometimes other systems will use mod as an effect creator (a particular subrace system comes to mind), but this is simpler, and doesn't require any modifications outside of the script.

#include "x2_inc_switches"

void DoDMInvis(object oPC)
{
    effect eEffect = EffectCutsceneGhost();
    effect eEffect2 = EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
    effect eLink = SupernaturalEffect(EffectLinkEffects(eEffect, eEffect2));
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
}

void main() {

    object oPC, oItem, oMod;

    SetExecutedScriptReturnValue(X2_EXECUTE_SCRIPT_END);

    if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE)
        return;

    oPC = GetItemActivator();
    oItem = GetItemActivated();
    oMod = GetModule();

    effect eEffect = GetFirstEffect(oPC);
    int nAlreadyInvis = FALSE;
    while (GetIsEffectValid(eEffect)) {

        if (GetEffectCreator(eEffect) == oMod) {
            DelayCommand(0.1, RemoveEffect(oPC, eEffect));
            nAlreadyInvis = TRUE;
        }
        eEffect = GetNextEffect(oPC);
    }

    if (!nAlreadyInvis)
        AssignCommand(oMod, DoDMInvis(oPC));
}

Funky

Modifié par FunkySwerve, 01 septembre 2013 - 06:33 .


#9
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Whup. Forgot to say, that code will have the item toggle between invisibility and uninvisibility - simpler than using two items.

Funky

#10
Baaleos

Baaleos
  • Members
  • 1 330 messages
If you have nwnx - I'd recommend using nwnx_cool - for its toggle/mode detection.
Combined with nwnx_func's visibility functions, you can set it up so that when a certain player/subrace/group member toggles stealth, it actually applies a level of stealth that is effectively the same as DM Stealth.
No amount of Perception or True Seeing can penetrate it.
Although - monsters still see through it, but you can remedy that with the addition of Sanctuary at the same time.

Then the toggle mode can be used to remove both effects.

#11
Rio420

Rio420
  • Members
  • 63 messages
Thanks for the script Funky, I'll check into nwnx tonight, I have been so busy on this other script I haven't had time to do anything else today lol..

#12
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

Baaleos wrote...

If you have nwnx - I'd recommend using nwnx_cool - for its toggle/mode detection.
Combined with nwnx_func's visibility functions, you can set it up so that when a certain player/subrace/group member toggles stealth, it actually applies a level of stealth that is effectively the same as DM Stealth.
No amount of Perception or True Seeing can penetrate it.
Although - monsters still see through it, but you can remedy that with the addition of Sanctuary at the same time.

Then the toggle mode can be used to remove both effects.


That sounds identical to what mine does, absent client 2da edits. Can you elaborate on the difference? Neither perception nor true seeing can pierce cutscene.

Funky