Author Topic: I need a little bit of help...  (Read 24392 times)

Offline fireknight40

  • Sr. Member
  • ****
  • Posts: 277
    • MSN Messenger - fireknight40@hotmail.com
    • AOL Instant Messenger - fireknight40
    • Yahoo Instant Messenger - briortheforesaken
    • View Profile
    • http://members.dslextreme.com/users/fierynight3/Iceys%20Hints%20and%20Tips.htm
    • Email
I need a little bit of help...
« 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
« Last Edit: April 21, 2005, 01:28:35 AM by fireknight40 »

Lord of Doriath[/span]
[span style=\'color:blue\']Sentinel of GodSpire[/color]

Offline Mo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3051
    • MSN Messenger - cochy@msn.com
    • View Profile
    • http://lucidmagic.net
    • Email
I need a little bit of help...
« Reply #1 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

Offline fireknight40

  • Sr. Member
  • ****
  • Posts: 277
    • MSN Messenger - fireknight40@hotmail.com
    • AOL Instant Messenger - fireknight40
    • Yahoo Instant Messenger - briortheforesaken
    • View Profile
    • http://members.dslextreme.com/users/fierynight3/Iceys%20Hints%20and%20Tips.htm
    • Email
I need a little bit of help...
« Reply #2 on: April 21, 2005, 01:39:31 AM »
Thank you, Mo. :)
EDIT: It compile ty :)
« Last Edit: April 21, 2005, 01:40:50 AM by fireknight40 »

Lord of Doriath[/span]
[span style=\'color:blue\']Sentinel of GodSpire[/color]

Offline CleTus

  • Full Member
  • ***
  • Posts: 234
    • View Profile
    • http://
I need a little bit of help...
« Reply #3 on: April 21, 2005, 01:53:38 AM »
On a side note: You spelled conversation wrong in the beginning post.   B)
GIT-R-DONE!

Light travels faster than sound. That is why some people appear bright until you hear them speak.

Offline fireknight40

  • Sr. Member
  • ****
  • Posts: 277
    • MSN Messenger - fireknight40@hotmail.com
    • AOL Instant Messenger - fireknight40
    • Yahoo Instant Messenger - briortheforesaken
    • View Profile
    • http://members.dslextreme.com/users/fierynight3/Iceys%20Hints%20and%20Tips.htm
    • Email
I need a little bit of help...
« Reply #4 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.
« Last Edit: April 21, 2005, 02:19:28 AM by fireknight40 »

Lord of Doriath[/span]
[span style=\'color:blue\']Sentinel of GodSpire[/color]

Offline Mo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3051
    • MSN Messenger - cochy@msn.com
    • View Profile
    • http://lucidmagic.net
    • Email
I need a little bit of help...
« Reply #5 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.

Offline Talon

  • Hero Member
  • *****
  • Posts: 88772
    • View Profile
    • http://
    • Email
I need a little bit of help...
« Reply #6 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.

Offline Mo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3051
    • MSN Messenger - cochy@msn.com
    • View Profile
    • http://lucidmagic.net
    • Email
I need a little bit of help...
« Reply #7 on: April 21, 2005, 04:52:00 AM »
Quote
Speak to yourself.
[snapback]22081[/snapback]

So helpful as always :D

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
I need a little bit of help...
« Reply #8 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
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
I need a little bit of help...
« Reply #9 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

Offline fireknight40

  • Sr. Member
  • ****
  • Posts: 277
    • MSN Messenger - fireknight40@hotmail.com
    • AOL Instant Messenger - fireknight40
    • Yahoo Instant Messenger - briortheforesaken
    • View Profile
    • http://members.dslextreme.com/users/fierynight3/Iceys%20Hints%20and%20Tips.htm
    • Email
I need a little bit of help...
« Reply #10 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

Lord of Doriath[/span]
[span style=\'color:blue\']Sentinel of GodSpire[/color]

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a little bit of help...
« Reply #11 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

Offline Celestial1

  • Hero Member
  • *****
  • Posts: 625
    • AOL Instant Messenger - n1megakid92
    • Yahoo Instant Messenger - n1megakid92
    • View Profile
    • http://
    • Email
I need a little bit of help...
« Reply #12 on: April 21, 2005, 01:14:07 PM »
See? People in NWN need to stop talking to themselves so much.

~Celestial
Yes I know... I have no idea why these random animals are carrying 148 gold and a magic fire ring. It will be forever a mystery![/span]

[span style=\'color:green\']It's better to keep your mouth shut and appear stupid than to open it and remove all doubt.

-Samuel Langhorne Clemens, Mark Twain.

Offline fireknight40

  • Sr. Member
  • ****
  • Posts: 277
    • MSN Messenger - fireknight40@hotmail.com
    • AOL Instant Messenger - fireknight40
    • Yahoo Instant Messenger - briortheforesaken
    • View Profile
    • http://members.dslextreme.com/users/fierynight3/Iceys%20Hints%20and%20Tips.htm
    • Email
I need a little bit of help...
« Reply #13 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

Lord of Doriath[/span]
[span style=\'color:blue\']Sentinel of GodSpire[/color]

Offline CleTus

  • Full Member
  • ***
  • Posts: 234
    • View Profile
    • http://
I need a little bit of help...
« Reply #14 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.
« Last Edit: April 21, 2005, 09:34:09 PM by CleTus »
GIT-R-DONE!

Light travels faster than sound. That is why some people appear bright until you hear them speak.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a little bit of help...
« Reply #15 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

Offline fireknight40

  • Sr. Member
  • ****
  • Posts: 277
    • MSN Messenger - fireknight40@hotmail.com
    • AOL Instant Messenger - fireknight40
    • Yahoo Instant Messenger - briortheforesaken
    • View Profile
    • http://members.dslextreme.com/users/fierynight3/Iceys%20Hints%20and%20Tips.htm
    • Email
I need a little bit of help...
« Reply #16 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);

}
« Last Edit: April 21, 2005, 10:14:02 PM by fireknight40 »

Lord of Doriath[/span]
[span style=\'color:blue\']Sentinel of GodSpire[/color]

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a little bit of help...
« Reply #17 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
« Last Edit: April 22, 2005, 12:20:25 PM by 420 »

Offline fireknight40

  • Sr. Member
  • ****
  • Posts: 277
    • MSN Messenger - fireknight40@hotmail.com
    • AOL Instant Messenger - fireknight40
    • Yahoo Instant Messenger - briortheforesaken
    • View Profile
    • http://members.dslextreme.com/users/fierynight3/Iceys%20Hints%20and%20Tips.htm
    • Email
I need a little bit of help...
« Reply #18 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

Lord of Doriath[/span]
[span style=\'color:blue\']Sentinel of GodSpire[/color]

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a little bit of help...
« Reply #19 on: April 23, 2005, 02:00:32 PM »
Quote
Thank you. :)
signed,
Brior
[snapback]22328[/snapback]

Does that mean it worked?

-420

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
I need a little bit of help...
« Reply #20 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!
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a little bit of help...
« Reply #21 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

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
I need a little bit of help...
« Reply #22 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?
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
I need a little bit of help...
« Reply #23 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?
« Last Edit: April 30, 2005, 10:54:27 PM by Daniel1975 »
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline fireknight40

  • Sr. Member
  • ****
  • Posts: 277
    • MSN Messenger - fireknight40@hotmail.com
    • AOL Instant Messenger - fireknight40
    • Yahoo Instant Messenger - briortheforesaken
    • View Profile
    • http://members.dslextreme.com/users/fierynight3/Iceys%20Hints%20and%20Tips.htm
    • Email
I need a little bit of help...
« Reply #24 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)

Lord of Doriath[/span]
[span style=\'color:blue\']Sentinel of GodSpire[/color]

Offline CleTus

  • Full Member
  • ***
  • Posts: 234
    • View Profile
    • http://
I need a little bit of help...
« Reply #25 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?
GIT-R-DONE!

Light travels faster than sound. That is why some people appear bright until you hear them speak.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a little bit of help...
« Reply #26 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

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
I need a little bit of help...
« Reply #27 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??
« Last Edit: May 02, 2005, 05:07:12 AM by Daniel1975 »
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a little bit of help...
« Reply #28 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
« Last Edit: May 02, 2005, 01:06:20 PM by 420 »

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
I need a little bit of help...
« Reply #29 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  :(
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians