LucidMagic.net

Neverwinter Nights => NwN Building => Script Request => Topic started by: fireknight40 on April 21, 2005, 01:27:30 AM

Title: I need a little bit of help...
Post by: fireknight40 on April 21, 2005, 01:27:30 AM
Okay here's the thing: when the PC uses the item it starts the conversation tagged "creaturesummon" so far here's the code yet it won't compile please help if you can.
Code: [Select]
if(GetTag(oItem) == "creature")
{
 StartNewConversaion == "creaturesummon"
}
}
NOTE: this is going under all the other activate things. That's why there is no VoidMain (I am not as stupid as some people may thing!) The error is
"4/20/2005 10:25:01 PM: Error. 'use' did not compile.
use.nss(76): ERROR: VARIABLE DEFINED WITHOUT TYPE" and highlights the "StartNewConversation" line.
signed,
Brior
Title: I need a little bit of help...
Post by: Mo on April 21, 2005, 01:37:04 AM
I'm not sure where you get StartNewConversation from, it's not a defined fuction in nwscript.  You should use ActionStartConversation();

most nwscript fuctions have default constructors, which means that they take certain variables and return a variable.

In this case ActionStartConversation() takes 4 variables:

 object oObjectToConverseWith,
    string sDialogResRef = "",
    int bPrivateConversation = FALSE,
    int bPlayHello = TRUE

these also have default values (ie. bPlayHello = TRUE), which means if you do not specify a value for this variable, TRUE is used.

ActionStartConversation(oPC,"creaturesummon");

Should do you fine.

For greater help and info use the NWN Lexicon (http://nwnlexicon.com/)
Title: I need a little bit of help...
Post by: fireknight40 on April 21, 2005, 01:39:31 AM
Thank you, Mo. :)
EDIT: It compile ty :)
Title: I need a little bit of help...
Post by: CleTus on April 21, 2005, 01:53:38 AM
On a side note: You spelled conversation wrong in the beginning post.   B)
Title: I need a little bit of help...
Post by: fireknight40 on April 21, 2005, 02:18:39 AM
Okay that didn't work for some reason all the tags seem to be right though. Maybe I am as stupid as everyone thinks. Here's the thing it compiled but when I tested in the module there was no conversation. Anyways here's the code updated:
Code: [Select]
if(GetTag(oItem) == "creature")
{
ActionStartConversation(oPC,"creaturesummon");
}
I probably didn't understand everything Mo said... I dunno.
Title: I need a little bit of help...
Post by: Mo on April 21, 2005, 03:01:34 AM
Quote
Okay that didn't work for some reason all the tags seem to be right though. Maybe I am as stupid as everyone thinks. Here's the thing it compiled but when I tested in the module there was no conversation. Anyways here's the code updated:
Code: [Select]
if(GetTag(oItem) == "creature")
{
ActionStartConversation(oPC,"creaturesummon");
}
I probably didn't understand everything Mo said... I dunno.
[snapback]22077[/snapback]

Well there are obviously bug/s in your scripts.  When you want help debugging scripts you need to offer up many more details other than "it doesn't work" here are my two lines of code.

In any case you should first refer to the Lexicon for help.  When you read the remarks of ActionStartConversation() you will noticed that items can not start conversations with a PC.  I'm figuring this info will help you discover your bugs.
Title: I need a little bit of help...
Post by: Talon on April 21, 2005, 04:43:06 AM
Quote
Well there are obviously bug/s in your scripts.  When you want help debugging scripts you need to offer up many more details other than "it doesn't work" here are my two lines of code.

In any case you should first refer to the Lexicon for help.  When you read the remarks of ActionStartConversation() you will noticed that items can not start conversations with a PC.  I'm figuring this info will help you discover your bugs.
[snapback]22078[/snapback]

Speak to yourself.
Title: I need a little bit of help...
Post by: Mo on April 21, 2005, 04:52:00 AM
Quote
Speak to yourself.
[snapback]22081[/snapback]

So helpful as always :D
Title: I need a little bit of help...
Post by: Illutian on April 21, 2005, 05:52:56 AM
if (GetTag(GetItemActivated()) == "****")
AssignCommand(GetItemActivator(), ActionStartConversation(GetItemActivator(), "***", TRUE, FALSE));


that's the lines i use for item-based conversations
Title: I need a little bit of help...
Post by: Tea-cup on April 21, 2005, 12:33:45 PM
Broir,

ActionStartConversation, is a action. You can't use the function on it's own, you have to assign it to something. Like in the second line Khadgar posted.

If you really can't get it running, let me know.

-Mel
Title: I need a little bit of help...
Post by: fireknight40 on April 21, 2005, 12:38:50 PM
Okay it's working now. Thank you all. :) I may post here again if I can't get the other scripts to work in the converstion...
signed,
Brior
Title: I need a little bit of help...
Post by: 420 on April 21, 2005, 01:10:49 PM
A side note for everyone, you can't have a conversation with an item, only with placeable objects, doors and creatures. For any item-started conversations the PC will have to have a conversation with themself.

-420
Title: I need a little bit of help...
Post by: Celestial1 on April 21, 2005, 01:14:07 PM
See? People in NWN need to stop talking to themselves so much.

~Celestial
Title: I need a little bit of help...
Post by: fireknight40 on April 21, 2005, 09:01:27 PM
Quote
Okay it's working now. Thank you all. :) I may post here again if I can't get the other scripts to work in the converstion...
signed,
Brior
[snapback]22112[/snapback]
I was right! I do need help on the scripts in the conversation. The main thing right now is how do I get it to summon two of the same creature say the resref is "icedragon"  how would I get it to summon 2 or even 4, I can get it to summon 1 easily, but it doesn't seem to work with 2-4 well the way I tried anyways I was wondering if there was a certain way and if so what? Thank you. :)
signed,
Brior
Title: I need a little bit of help...
Post by: CleTus on April 21, 2005, 09:31:46 PM
You need to define what spawns, and where it spawns. I'm not sure where you want it.. So example.

Code: [Select]
object oPC = GetPCSpeaker();
object oCreature;
location ILoc;

ILoc = GetLocation(oPC);

oCreature = CreateObject(OBJECT_TYPE_CREATURE, "Tag", lLoc);

That would create the creature next to whatever is defined as oPC.. I'm not sure where you wanted it.

Oh and to get more just copy the create line i think.
Title: I need a little bit of help...
Post by: 420 on April 21, 2005, 09:56:15 PM
Quote
I can get it to summon 1 easily, but it doesn't seem to work with 2-4 well the way I tried anyways I was wondering if there was a certain way and if so what?
[snapback]22188[/snapback]

Post the script that works and the script that doesn't.

When you say "summon" I'm guessing you mean your using CreateObjectAtLocation function and not EffectSummon. If you are using EffectSummon, each player can only have 1 summon at a time.

-420
Title: I need a little bit of help...
Post by: fireknight40 on April 21, 2005, 10:10:19 PM
Quote
When you say "summon" I'm guessing you mean your using CreateObjectAtLocation function and not EffectSummon. If you are using EffectSummon, each player can only have 1 summon at a time.

-420
[snapback]22199[/snapback]
Yeah that's what I meant sorry. :P

Okay here's for one:
Code: [Select]
void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = oPC;

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "icedragon", lTarget);

}

and here's two (yes it is stupid and I'm a noob scripter):
Code: [Select]
void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = oPC;

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "icedragon", lTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "icedragon", lTarget);

}
Title: I need a little bit of help...
Post by: 420 on April 22, 2005, 12:20:13 PM
Code: [Select]
void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = oPC;

lTarget = GetLocation(oTarget);

CreateObject(OBJECT_TYPE_CREATURE, "icedragon", lTarget);
CreateObject(OBJECT_TYPE_CREATURE, "icedragon", lTarget);

}

Try this, without declaring the oSpawn.

-420
Title: I need a little bit of help...
Post by: fireknight40 on April 22, 2005, 11:10:15 PM
Quote
Code: [Select]
void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = oPC;

lTarget = GetLocation(oTarget);

CreateObject(OBJECT_TYPE_CREATURE, "icedragon", lTarget);
CreateObject(OBJECT_TYPE_CREATURE, "icedragon", lTarget);

}

Try this, without declaring the oSpawn.

-420
[snapback]22263[/snapback]

Thank you. :)
signed,
Brior
Title: I need a little bit of help...
Post by: 420 on April 23, 2005, 02:00:32 PM
Quote
Thank you. :)
signed,
Brior
[snapback]22328[/snapback]

Does that mean it worked?

-420
Title: I need a little bit of help...
Post by: Daniel1975 on April 28, 2005, 10:56:55 PM
I found this version of a timestop-spell and i like it


Code: [Select]
//::////////////////////////////////////////////////////:://
//:: Invizible420's Alternate Time Stop Spell         //:://
//::                                                  //:://
//:: By: Invizible420                                 //:://
//:: (Created 12/20/02 updated 06/13/04 (v 1.75)      //:://
//::////////////////////////////////////////////////////:://
//::                                                  //:://
//:: Persistent World Workaround for Bioware's        //:://
//:: Default Time Stop Spell.  This will              //:://
//:: CutSceneDominate creatures within a radius       //:://
//:: of the caster.                                   //:://
//::                                                  //:://
//:: This version will not Time Stop the caster's     //:://
//:: familiar, summons, animal companion, and only    //:://
//:: the caster's first henchman (Does not support    //:://
//:: multiple henchmens.  Has been thoroughly tested  //:://
//:: and will Time Stop creature's with Immunity to   //:://
//:: Mind Affecting spells.                           //:://
//::                                                  //:://
//:: Contact info/Bug Reports: Digiddy777@yahoo.com   //:://
//::////////////////////////////////////////////////////:://
#include "NW_I0_GENERIC"

// Customize User Defined Variables
//float fDur   = 15.0; // Duration in seconds -- Change this to however long you want Time Stop to last Uncomment and Comment out 3rd ed duration

// This is the formula for accurate 3rd ed. Duration
float fDur     = IntToFloat(d4(1)+1)*6.0; // Least duration is 12 seconds, maximum duration is 30 seconds

float fDist    = 20.0; // Radius in meters -- for a wider area of affect increase this float

// Function to resume creature(s) previous actions wrapped for Delay
void ResumeLast(object oResumee, object oIntruder)
{
    // Delay DetermineCombatRound
    DelayCommand(fDur+0.25,AssignCommand(oResumee,DetermineCombatRound(oIntruder)));
}


// Function to control Time Stop effects
void TSEffects(object oEffector, object oCaster)
{
    // Check if stopped creature is a hostile
    if (GetIsReactionTypeHostile(oCaster,oEffector) == TRUE)
    {
    // Start the resume combat round after Time Stop
    ResumeLast(oEffector, oCaster);
    }

    // Clear the creature(s) action que
    AssignCommand(oEffector,ClearAllActions(TRUE));

    // Make module dominate the creature(s) for fDur seconds & Freeze the Animation to look like time stopped
    AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectCutsceneDominated(),oEffector,fDur));
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),oEffector,fDur);
    }


// Function to get creature(s) within radius and apply the alternate Time Stop
void TimeStop(object oTarget)
{
    object oNearestC;  // Define nearest creature

    // Begin loop to find all creatures within the fDist meter radius
    oNearestC = GetFirstObjectInShape(SHAPE_SPHERE, fDist, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE);
    while(GetIsObjectValid(oNearestC))
    {

        // To make sure it doesn't stop the caster or caster's familiar, first henchman, or summons
        if ((oNearestC != oTarget) &&
           (GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oTarget) != oNearestC) &&
           (GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oTarget) != oNearestC) &&
           (GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oTarget) != oNearestC) &&
           (GetAssociate(ASSOCIATE_TYPE_SUMMONED, oTarget) != oNearestC))
        {
            // Start the Time Stop effects
            DelayCommand(0.75,TSEffects(oNearestC,oTarget));
        }

        // Get the next creature in the fDist meter radius and continue loop
        oNearestC = GetNextObjectInShape(SHAPE_SPHERE, fDist, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE);
    }
}


// Begin Main Function
void main()
{
    //Signal event to start the Time Stop
    SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE));

    // Begin custom Time Stop
    TimeStop(OBJECT_SELF);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_TIME_STOP), GetSpellTargetLocation());
}


But I want to have a "fair" timestop so I have to add a saving throw, may be will save. How do I do that? And can someone show me where I have to add SELECTIVE_HOSTILE so that this spell will only affect hostiled targets??
Thx!
Title: I need a little bit of help...
Post by: 420 on April 29, 2005, 01:14:21 PM
If you want to affect all hostiles then replace this:

Code: [Select]
       if ((oNearestC != oTarget) &&
          (GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oTarget) != oNearestC) &&
          (GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oTarget) != oNearestC) &&
          (GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oTarget) != oNearestC) &&
          (GetAssociate(ASSOCIATE_TYPE_SUMMONED, oTarget) != oNearestC))

with this

Code: [Select]
GetIsReactionTypeHostile(oNearestC)

What type of saving throw do you want to use? Fort, Reflex or Will and what DC?

-420
Title: I need a little bit of help...
Post by: Daniel1975 on April 30, 2005, 10:46:18 PM
I thought a check on the will save might be a good idea.
But how high is the dc for that spell anyway?
Title: I need a little bit of help...
Post by: Daniel1975 on April 30, 2005, 10:51:52 PM
I just noticed I already added a line for will save check:

Code: [Select]
if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
is that correct?

and who is this Invizible420 ??
Is that another name of you 420? Or is it someone other??

Oh and there seems to be no effect on the hostile creature when the spell fails due to a succesful will save. Do I have to make an extra efect for that?
Title: I need a little bit of help...
Post by: fireknight40 on May 01, 2005, 12:16:18 AM
I was curious how would I get a spell to just... well... not work? I tried working with the script some but it still worked... :\
(I'm horrible at editing spells)
Title: I need a little bit of help...
Post by: CleTus on May 01, 2005, 01:32:37 AM
Just open the spell script.


void main()
{

FloatingTextStringOnCreature("This spell will not work on this server." ,OBJECT_SELF);

}

Assume you use the Hotu toolset right?
Title: I need a little bit of help...
Post by: 420 on May 01, 2005, 12:56:25 PM
Quote
and who is this Invizible420 ??
Is that another name of you 420? Or is it someone other??

Oh and there seems to be no effect on the hostile creature when the spell fails due to a succesful will save. Do I have to make an extra efect for that?
[snapback]22930[/snapback]

The will save looks right. Anyone with anything other than just "420" in their name is not me. Yes, you have to apply the VFX for a successful save.

Use this: VFX_IMP_WILL_SAVING_THROW_USE

fireknight40, for making spells not work (or work differently) use the "spellhook" method described in the script "x2_inc_spellhook".

The spellhook allows you to set certain conditions for spells after they are cast but before their missles/ray effect and impact scripts run.

So, for instance, in Smith Hold, if you cast Time Stop the spellhook script checks to see if you have a certain variable set. If it is set the spell will not work and you get a message that Time Stop can only be cast once every 24 hours. If it is not set, then set the variable and run the spell normally.

-420
Title: I need a little bit of help...
Post by: Daniel1975 on May 02, 2005, 05:05:05 AM
I changed the timestop spell like you said so it looked like this:

Code: [Select]
#include "NW_I0_GENERIC"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"

// Customize User Defined Variables
//float fDur   = 15.0; // Duration in seconds -- Change this to however long you want Time Stop to last Uncomment and Comment out 3rd ed duration

// This is the formula for accurate 3rd ed. Duration
float fDur     = IntToFloat(d4(1)+1)*6.0; // Least duration is 12 seconds, maximum duration is 30 seconds

float fDist    = 10.0; // Radius in meters -- for a wider area of affect increase this float

// Function to resume creature(s) previous actions wrapped for Delay
void ResumeLast(object oResumee, object oIntruder)
{
    // Delay DetermineCombatRound
    DelayCommand(fDur+0.25,AssignCommand(oResumee,DetermineCombatRound(oIntruder)));
}


// Function to control Time Stop effects
void TSEffects(object oEffector, object oCaster)
{
    // Check if stopped creature is a hostile
    if (GetIsReactionTypeHostile(oCaster,oEffector) == TRUE)
    {
    // Start the resume combat round after Time Stop
    ResumeLast(oEffector, oCaster);
    }

    // Clear the creature(s) action que
    AssignCommand(oEffector,ClearAllActions(TRUE));

    // Make module dominate the creature(s) for fDur seconds & Freeze the Animation to look like time stopped
    AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectCutsceneDominated(),oEffector,fDur));
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),oEffector,fDur);
    }


// Function to get creature(s) within radius and apply the alternate Time Stop
void TimeStop(object oTarget)
{
    object oNearestC;  // Define nearest creature

    // Begin loop to find all creatures within the fDist meter radius
    oNearestC = GetFirstObjectInShape(SHAPE_SPHERE, fDist, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE);

    while(GetIsObjectValid(oNearestC))
    {
        // To make sure it doesn't stop the caster or caster's familiar, first henchman, or summons
        GetIsReactionTypeHostile(oNearestC);
        {
             if (!MyResistSpell(OBJECT_SELF, oTarget))
     {
      //Make Will Save to negate effect
      if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
      {
            // Start the Time Stop effects
            DelayCommand(0.75,TSEffects(oNearestC,oTarget));
        }
       else
        {
         effect eVisWill = EffectVisualEffect(VFX_IMP_WILL_SAVING_THROW_USE);
         ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisWill, oNearestC);
        }
        }
        }

        // Get the next creature in the fDist meter radius and continue loop
        oNearestC = GetNextObjectInShape(SHAPE_SPHERE, fDist, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE);
    }
}


// Begin Main Function
void main()
{
    //Signal event to start the Time Stop
    SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE));

    // Begin custom Time Stop
    TimeStop(OBJECT_SELF);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_TIME_STOP), GetSpellTargetLocation());
}

But this line doesn't work the way it should:

Code: [Select]
GetIsReactionTypeHostile(oNearestC);
When the spell is cast still each creature in a 10m radius does a will save and is dominated if it fails, even the caster.
Then I tried to remove it with this line:

Code: [Select]
if (spellsIsTarget(oNearestC, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oNearestC != OBJECT_SELF)
but then I got an error message like:
"no right bracket in expression" ... sorry if the translation is not correct I have the german toolset

What wrong now??
Title: I need a little bit of help...
Post by: 420 on May 02, 2005, 01:04:57 PM
Try This:
Code: [Select]
if (GetIsReactionTypeHostile(oNearestC) == TRUE);
The error with the following code is usually cause by the line above it.
Code: [Select]
if (spellsIsTarget(oNearestC, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oNearestC != OBJECT_SELF)
-420
Title: I need a little bit of help...
Post by: Daniel1975 on May 03, 2005, 01:20:44 AM
Thanks for your help 420!  :)
Another question:

Is there a way to increase the spell's save dc?

Because it seems that nearly every creature or player saves succesful everytime doesn't matter what kind of level he is  :(
Title: I need a little bit of help...
Post by: 420 on May 03, 2005, 02:16:19 AM
Quote
Is there a way to increase the spell's save dc?
[snapback]23016[/snapback]

Bioware screwed up the spell functions so you can't set the level of a spell simply through scripting. You can use the spellhook option or make your creatures the proper spell caster level and assign them spells then manage the combat AI using custom scripts.

-420
Title: I need a little bit of help...
Post by: Daniel1975 on May 04, 2005, 05:14:33 AM
Okay next one:

I want to change the lighting of an area by using a script.
It's a 3x5 tileset area and the idea is to talk to a NPC, the whole area lighting
turns dark, an action happens, the lighting turns back to normal.
I understand it has something to do with SetTileMainLightColor and GetTileMainLight1Color / GetTileMainLight2Color
but I am not sure how to use it properly.
Title: I need a little bit of help...
Post by: 420 on May 04, 2005, 01:07:52 PM
Quote
I want to change the lighting of an area by using a script.

[snapback]23058[/snapback]

Go to this link (http://nwvault.ign.com/View.php?view=Modules.Detail&id=360) and download the "Dance Club.mod" file by Bioware. It's a demo mod showing examples of how to change tile lighting in-game.

-420
Title: I need a little bit of help...
Post by: Daniel1975 on May 04, 2005, 03:00:34 PM
Quote
Go to this link (http://nwvault.ign.com/View.php?view=Modules.Detail&id=360) and download the "Dance Club.mod" file by Bioware. It's a demo mod showing examples of how to change tile lighting in-game.

-420
[snapback]23078[/snapback]

Thanks, it's a funny module but it containts a load of scripts, many of which I don't understand at all  :( it's fun but no help *sigh*

in fact I only need to know how to use GetTileMainLight1Color and SetTileMainLight...
Just need a small example how to get a certain tile
Title: I need a little bit of help...
Post by: fireknight40 on May 09, 2005, 08:03:54 PM
Okay I need help again... Okay here's the deal it won't compile for some reason it says that on line 115 "5/9/2005 5:05:58 PM: Error. 'filter' did not compile.
filter.nss(115): ERROR: UNKNOWN STATE IN COMPILER"
here's the script.
Code: [Select]
void getrid(object oPC, object oItem)
{

   itemproperty property=GetFirstItemProperty(oItem);
   while(GetIsItemPropertyValid(property))
   {
       if (
       (GetItemPropertyType(property) == ITEM_PROPERTY_CAST_SPELL)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_ON_HIT_PROPERTIES)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_REGENERATION)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DAMAGE_VULNERABILITY)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DAMAGE_VULNERABILITY)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_TRAP)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_THIEVES_TOOLS)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_ON_MONSTER_HIT)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_ABILITY_SCORE)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_AC)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_DAMAGE)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_SAVING_THROWS)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_SKILL_MODIFIER)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_MONSTER_DAMAGE)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_REGENERATION_VAMPIRIC)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_DAMAGE_REDUCTION)
       || (GetItemPropertyType(property) == ITEM_PROPERTY_ONHITCASTSPELL)
       )
       {
            RemoveItemProperty(oItem, property);
       }
       property = GetNextItemProperty(oItem);
   }
   if(GetGoldPieceValue(oItem) > 500000)
   {
       DestroyObject(oItem);
   }
}
//the function that gets the items and uses the filter on them
void filter_items(object oPC)
{
   object oItem = GetFirstItemInInventory(oPC);
   object oSlot;
   //don't scan dm's
   if(GetIsDM(oPC) == TRUE)
   {
       return;
   }
   //scan inventory
   while(GetIsObjectValid(oItem))
   {
       getrid(oPC, oItem);
       oItem = GetNextItemInInventory(oPC);
   }
   //scan equiped items
   oSlot = GetItemInSlot(INVENTORY_SLOT_ARMS,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_ARROWS,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_BELT,oPC);
   getrid(oPC, oSlot);
   oSlot= GetItemInSlot(INVENTORY_SLOT_BOLTS,oPC);
   getrid(oPC, oSlot);
   oSlot= GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC);
   getrid(oPC, oSlot);
   oSlot= GetItemInSlot(INVENTORY_SLOT_BULLETS,oPC);
   getrid(oPC, oSlot);
   oSlot= GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
   getrid(oPC, oSlot);
   oSlot= GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
   getrid(oPC, oSlot);
   oSlot= GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_HEAD,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_NECK,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
   getrid(oPC, oSlot);
   oSlot = GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC);
   getrid(oPC, oSlot);
}
void main()
{
   object oPC = GetEnteringObject();
   string sKey = GetPCPublicCDKey(oPC);
   effect eLight = SupernaturalEffect(EffectVisualEffect(VFX_DUR_IOUNSTONE_GREEN));
   filter_items(oPC);
int nStatus = GetCampaignInt(sKey, "sent");
if (nStatus == 5)
{
              DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT ,eLight ,oPC));
             CreateItemOnObject("blueprint", oPC);
             CreateItemOnObject("blueprint001", oPC);
             CreateItemOnObject("teleporter", oPC);
}
void main()
{
   object oPC = GetEnteringObject();
   string sKey = GetPCPublicCDKey(oPC);
   effect eLight = SupernaturalEffect(EffectVisualEffect(VFX_DUR_IOUNSTONE_YELLOW));
   filter_items(oPC);
int nStatus = GetCampaignInt(sKey, "lord");
if (nStatus == 5)
{
              DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT ,eLight ,oPC));
             CreateItemOnObject("blueprint", oPC);
             CreateItemOnObject("blueprint001", oPC);
             CreateItemOnObject("blueprint003", oPC);
             CreateItemOnObject("blueprint002", oPC);
             CreateItemOnObject("blueprint004", oPC);
             CreateItemOnObject("restartrune", oPC);
             CreateItemOnObject("teleporter", oPC);
}
void main()
{
   object oPC = GetEnteringObject();
   string sKey = GetPCPublicCDKey(oPC);
   effect eLight = SupernaturalEffect(EffectVisualEffect(VFX_DUR_IOUNSTONE_BLUE));
   filter_items(oPC);
int nStatus = GetCampaignInt(sKey, "dm");
if (nStatus == 5)
{
              DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT ,eLight ,oPC));
             CreateItemOnObject("blueprint001", oPC);
             CreateItemOnObject("creaturerune", oPC);
             CreateItemOnObject("blueprint003", oPC);
             CreateItemOnObject("blueprint002", oPC);
             CreateItemOnObject("blueprint007", oPC);
             CreateItemOnObject("blueprint004", oPC);
             CreateItemOnObject("blueprint006", oPC);
             CreateItemOnObject("blueprint005", oPC);
             CreateItemOnObject("restartrune", oPC);
             CreateItemOnObject("blueprint", oPC);
             CreateItemOnObject("teleporter", oPC);
}
}
Title: I need a little bit of help...
Post by: CleTus on May 10, 2005, 12:40:36 AM
You can't have 2 void main() in 1 script. You also only need to declare those once, except the visual effects you are using. The Cd key and stuff is fine once. Just use these "if"
int nStatus = GetCampaignInt(sKey, "dm");
if (nStatus == 5)

You're setting them as 5 I see. So change it for every part.

int nStatus = GetCampaignInt(sKey, "sent");
if (nStatus == 5)

int nStatus1 = GetCampaignInt(sKey, "lord");
if (nStatus1 == 5)

int nStatus2 = GetCampaignInt(sKey, "dm");
if (nStatus2 == 5)

That's just an example to change them to. They all have to be different. Just use certain "if"

Example:

int nStatus = GetCampaignInt(sKey, "dm");
if (nStatus == 5)
{
lights/items
}
int nStatus1 = GetCampaignInt(sKey, "lord");
if (nStatus1 == 5)
{
lights/items
}
int nStatus = GetCampaignInt(sKey, "sent");
if (nStatus == 5)
{
lights/items
}
Title: I need a little bit of help...
Post by: fireknight40 on May 10, 2005, 12:59:49 AM
Quote
You can't have 2 void main() in 1 script. You also only need to declare those once, except the visual effects you are using. The Cd key and stuff is fine once. Just use these "if"
int nStatus = GetCampaignInt(sKey, "dm");
if (nStatus == 5)

You're setting them as 5 I see. So change it for every part.

int nStatus = GetCampaignInt(sKey, "sent");
if (nStatus == 5)

int nStatus1 = GetCampaignInt(sKey, "lord");
if (nStatus1 == 5)

int nStatus2 = GetCampaignInt(sKey, "dm");
if (nStatus2 == 5)

That's just an example to change them to. They all have to be different. Just use certain "if"

Example:

int nStatus = GetCampaignInt(sKey, "dm");
if (nStatus == 5)
{
lights/items
}
int nStatus1 = GetCampaignInt(sKey, "lord");
if (nStatus1 == 5)
{
lights/items
}
int nStatus = GetCampaignInt(sKey, "sent");
if (nStatus == 5)
{
lights/items
}
[snapback]23210[/snapback]

:huh: Okay I didn't really understand all of that is there any simpler explination?
Title: I need a little bit of help...
Post by: CleTus on May 10, 2005, 02:42:12 AM
Code: [Select]
void getrid(object oPC, object oItem)
{

  itemproperty property=GetFirstItemProperty(oItem);
  while(GetIsItemPropertyValid(property))
  {
      if (
      (GetItemPropertyType(property) == ITEM_PROPERTY_CAST_SPELL)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_ON_HIT_PROPERTIES)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_REGENERATION)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DAMAGE_VULNERABILITY)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DAMAGE_VULNERABILITY)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_TRAP)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_THIEVES_TOOLS)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_ON_MONSTER_HIT)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_ABILITY_SCORE)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_AC)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_DAMAGE)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_SAVING_THROWS)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DECREASED_SKILL_MODIFIER)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_MONSTER_DAMAGE)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_REGENERATION_VAMPIRIC)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_DAMAGE_REDUCTION)
      || (GetItemPropertyType(property) == ITEM_PROPERTY_ONHITCASTSPELL)
      )
      {
           RemoveItemProperty(oItem, property);
      }
      property = GetNextItemProperty(oItem);
  }
  if(GetGoldPieceValue(oItem) > 500000)
  {
      DestroyObject(oItem);
  }
}
//the function that gets the items and uses the filter on them
void filter_items(object oPC)
{
  object oItem = GetFirstItemInInventory(oPC);
  object oSlot;
  //don't scan dm's
  if(GetIsDM(oPC) == TRUE)
  {
      return;
  }
  //scan inventory
  while(GetIsObjectValid(oItem))
  {
      getrid(oPC, oItem);
      oItem = GetNextItemInInventory(oPC);
  }
  //scan equiped items
  oSlot = GetItemInSlot(INVENTORY_SLOT_ARMS,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_ARROWS,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_BELT,oPC);
  getrid(oPC, oSlot);
  oSlot= GetItemInSlot(INVENTORY_SLOT_BOLTS,oPC);
  getrid(oPC, oSlot);
  oSlot= GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC);
  getrid(oPC, oSlot);
  oSlot= GetItemInSlot(INVENTORY_SLOT_BULLETS,oPC);
  getrid(oPC, oSlot);
  oSlot= GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
  getrid(oPC, oSlot);
  oSlot= GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
  getrid(oPC, oSlot);
  oSlot= GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_HEAD,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_NECK,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
  getrid(oPC, oSlot);
  oSlot = GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC);
  getrid(oPC, oSlot);
}
void main()
{
  object oPC = GetEnteringObject();
  string sKey = GetPCPublicCDKey(oPC);
  effect eLight = SupernaturalEffect(EffectVisualEffect(VFX_DUR_IOUNSTONE_GREEN));
  filter_items(oPC);
int nStatus = GetCampaignInt(sKey, "sent");
if (nStatus == 5)
{
             DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT ,eLight ,oPC));
            CreateItemOnObject("blueprint", oPC);
            CreateItemOnObject("blueprint001", oPC);
            CreateItemOnObject("teleporter", oPC);
}

{

effect eLight1 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_IOUNSTONE_YELLOW));
int nStatus1 = GetCampaignInt(sKey, "lord");
if (nStatus1 == 5)
{
             DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT ,eLight1 ,oPC));
            CreateItemOnObject("blueprint", oPC);
            CreateItemOnObject("blueprint001", oPC);
            CreateItemOnObject("blueprint003", oPC);
            CreateItemOnObject("blueprint002", oPC);
            CreateItemOnObject("blueprint004", oPC);
            CreateItemOnObject("restartrune", oPC);
            CreateItemOnObject("teleporter", oPC);
}



effect eLight2 = SupernaturalEffect(EffectVisualEffect(VFX_DUR_IOUNSTONE_BLUE));
int nStatus2 = GetCampaignInt(sKey, "dm");
if (nStatus2 == 5)
{
             DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT ,eLight2 ,oPC));
            CreateItemOnObject("blueprint001", oPC);
            CreateItemOnObject("creaturerune", oPC);
            CreateItemOnObject("blueprint003", oPC);
            CreateItemOnObject("blueprint002", oPC);
            CreateItemOnObject("blueprint007", oPC);
            CreateItemOnObject("blueprint004", oPC);
            CreateItemOnObject("blueprint006", oPC);
            CreateItemOnObject("blueprint005", oPC);
            CreateItemOnObject("restartrune", oPC);
            CreateItemOnObject("blueprint", oPC);
            CreateItemOnObject("teleporter", oPC);
}
}
}
Title: I need a little bit of help...
Post by: 420 on May 10, 2005, 01:31:22 PM
Quote
Thanks, it's a funny module but it containts a load of scripts, many of which I don't understand at all  :( it's fun but no help *sigh*

in fact I only need to know how to use GetTileMainLight1Color and SetTileMainLight...
Just need a small example how to get a certain tile
[snapback]23086[/snapback]

Sorry, I forgot that most of the modules scripts were being used for a chess game... d'oh!

See if this link helps at all: http://www.nwnlexicon.com/compiled/functio...ight1color.html (http://www.nwnlexicon.com/compiled/function.gettilemainlight1color.html)

-420
Title: I need a little bit of help...
Post by: Daniel1975 on May 10, 2005, 04:32:49 PM
Quote
Sorry, I forgot that most of the modules scripts were being used for a chess game... d'oh!

See if this link helps at all: http://www.nwnlexicon.com/compiled/functio...ight1color.html (http://www.nwnlexicon.com/compiled/function.gettilemainlight1color.html)

-420
[snapback]23237[/snapback]

I have NWNLexikon myself but with the description of this function I am as wise as before. Nevermind, I just forget about my idea  :(