Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Help with something

Page: 1 of 1
 Darth_ToMeR
06-16-2004, 11:07 AM
#1
When I do Force Resistence my character appear like that-
http://members.lycos.co.uk/tomer06/ddd.JPG)
My question is, How can i get my character to always like that, but not in orange, i want it Red. Is there some way to do that?
Thanks.
 Drog
06-16-2004, 11:12 AM
#2
Originally posted by Darth_ToMeR
When I do Force Resistence my character appear like that-
http://members.lycos.co.uk/tomer06/ddd.JPG)
My question is, How can i get my character to always like that, but not in orange, i want it Red. Is there some way to do that?
Thanks. Well i dont think it works...
but it just might , just open the forces in a scripting program and you'll see it might take alot of workk or less .. i dunno
 Drog
06-16-2004, 11:15 AM
#3
You can also make the forces repeatly over and over again , require some scripting tough :)
 Darth333
06-16-2004, 11:41 AM
#4
You could apply a shield effect permanently, like ajunta pall in the tomb on Korriban. There is a red shield in the game. You would only need a simple script but right now i'm in the office so I can't give you all the details.
 Drog
06-16-2004, 1:40 PM
#5
Originally posted by Darth333
You could apply a shield effect permanently, like ajunta pall in the tomb on Korriban. There is a red shield in the game. You would only need a simple script but right now i'm in the office so I can't give you all the details.

Exactly what i found when i was looking ... maybe darth_tomer you should do something like this .. im sure i would enjoy it aswell others.
 tk102
06-16-2004, 1:57 PM
#6
Here's a script that should work, though I haven't tested it myself yet.

You could attach this to a dialog or make it into an armband if you were so inclined.

void main() {
/****************************************

shazam.nss:

Turn on/off a peramanent visual effect

Strategy: first check to see if PC has
an effect that is:
1) Permananent
2) Visual
3) Supernatural subtype

if so, then remove it
if not, then add it

by tk102 6-15-04
****************************************/

object oPC=GetFirstPC();
// check to see if effect is ON, if so turn it OFF
effect eCheck = GetFirstEffect(oPC);
while (GetIsEffectValid(eCheck)) {
if (
(GetEffectDurationType(eCheck) ==DURATION_TYPE_PERMANENT) &&
(GetEffectType(eCheck)==EFFECT_TYPE_VISUAL) &&
(GetEffectSubType(eCheck)==SUBTYPE_SUPERNATURAL)
) {
RemoveEffect(oPC, eCheck);
return;
}
eCheck=GetNextEffect(oPC);
}

// not ON, so turn it ON
effect eRedShield = EffectVisualEffect(VFX_DUR_SHIELD_RED_01);
eRedShield = SupernaturalEffect(eRedShield);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eRedShield, oPC);
return;
}
 Darth333
06-16-2004, 1:57 PM
#7
Thanks Tk :) Hmmm I sometimes wonder if you have Kotor with you at work...you certainly keep nwscript.nss not too far... :D
 Darth_ToMeR
06-16-2004, 2:26 PM
#8
Originally posted by tk102
Here's a script that should work, though I haven't tested it myself yet.

You could attach this to a dialog or make it into an armband if you were so inclined.

void main() {
/****************************************

shazam.nss:

Turn on/off a peramanent visual effect

Strategy: first check to see if PC has
an effect that is:
1) Permananent
2) Visual
3) Supernatural subtype

if so, then remove it
if not, then add it

by tk102 6-15-04
****************************************/

object oPC=GetFirstPC();
// check to see if effect is ON, if so turn it OFF
effect eCheck = GetFirstEffect(oPC);
while (GetIsEffectValid(eCheck)) {
if (
(GetEffectDurationType(eCheck) ==DURATION_TYPE_PERMANENT) &&
(GetEffectType(eCheck)==EFFECT_TYPE_VISUAL) &&
(GetEffectSubType(eCheck)==SUBTYPE_SUPERNATURAL)
) {
RemoveEffect(oPC, eCheck);
return;
}
eCheck=GetNextEffect(oPC);
}

// not ON, so turn it ON
effect eRedShield = EffectVisualEffect(VFX_DUR_SHIELD_RED_01);
eRedShield = SupernaturalEffect(eRedShield);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eRedShield, oPC);
return;
} Thanks!
With this script, my character will be with red shield even if i move areas? and how can i make this script into an armband?
 Drog
06-16-2004, 2:41 PM
#9
Originally posted by Darth_ToMeR
Thanks!
With this script, my character will be with red shield even if i move areas? and how can i make this script into an armband?
Go to Create Custom Item by t7nowhere and then add the script into the uti file or make the script and then relate it to the armband..(gauntlet) NP..
 tk102
06-16-2004, 3:11 PM
#10
Actually, for an example of using an armband, take a look at the Darkside Choker mod on pcgm. Basically, it requires an entry into spells.2da and then in the .uti that you will create, under PropertiesList, make sure there exists the struct with the following parameters:

ChanceAppear: 100
Parm1: 255
Parm1Value: 0
PropertyName: 10
Subtype: <-- the entry into spells.2da

In spells.2da make sure your impactscript field is the name of the script you want to fire (shazam).

And obviously all these go into your override (shazam.ncs, spells.2da, and the uti).
 tk102
06-17-2004, 10:16 AM
#11
Checked the script and it seems to work fine. :)
 Darth_ToMeR
06-17-2004, 11:56 AM
#12
Thank you!!! I want it on character i want to recruit. If it will be good, i'll release it. Thanks one more time.
 Darth_ToMeR
06-17-2004, 1:29 PM
#13
Originally posted by tk102
Checked the script and it seems to work fine. :)
How can i make it that the NPC will be Red?
 Darth333
06-17-2004, 1:51 PM
#14
Originally posted by Darth_ToMeR
How can i make it that the NPC will be Red?
Why don't you add this to the recruit script?
or just attach it to a convo :)
If it's your recruit that you want to be red, you'll have to replace oPC by the tag of the npc in the script and GetFirstPC() by GetObjectByTag("my_npc");
 Darth_ToMeR
06-17-2004, 2:35 PM
#15
Originally posted by Darth333
Why don't you add this to the recruit script?
or just attach it to a convo :)
If it's your recruit that you want to be red, you'll have to replace oPC by the tag of the npc in the script and GetFirstPC() by GetObjectByTag("my_npc"); "GetFirstPC()" is appear just one time. do i need to do something with all the "oPC" ?
 tk102
06-17-2004, 3:53 PM
#16
Something like this, Darth Tomer:
void main() {
/****************************************

npc_shazam.nss:

Turn on a peramanent visual effect
during recruitment of an NPC

by tk102 6-15-04
****************************************/

object oNPC=GetObjectByTag("npc_tag_goes_here");
effect eRedShield = EffectVisualEffect(VFX_DUR_SHIELD_RED_01);
eRedShield = SupernaturalEffect(eRedShield);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eRedShield, oNPC);
return;
}

I believe there are points in the game (like when you put on a disguise (Sith, Sandperson) and then take it off that a script fires which removes all visual effects. You may need to compensate for that somehow.


Also, I think this would be a cool armband to have, similar to Holowan Cloakworks where you can turn on multiple effects... I'll construct one after KSE v2 gets released.
 Darth_ToMeR
06-17-2004, 3:57 PM
#17
Originally posted by tk102
Something like this, Darth Tomer:
void main() {
/****************************************

npc_shazam.nss:

Turn on a peramanent visual effect
during recruitment of an NPC

by tk102 6-15-04
****************************************/

object oNPC=GetObjectByTag("npc_tag_goes_here");
effect eRedShield = EffectVisualEffect(VFX_DUR_SHIELD_RED_01);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eRedShield, oNPC);
return;
}

The supernatural portion isn't necessary for just turning the effect 'ON'.

I believe there are points in the game (like when you put on a disguise (Sith, Sandperson) and then take it off that a script fires which removes all visual effects. You may need to compensate for that somehow.


Also, I think this would be a cool armband to have, similar to Holowan Cloakworks where you can turn on multiple effects... I'll construct one after KSE v2 gets released. Do i need just this part of the script?
And what can i do if the shield will stop?
 tk102
06-17-2004, 4:20 PM
#18
Do i need just this part of the script?
Yes, the above is a different script in and of itself.

And what can i do if the shield will stop?

You'll have to fire the script again somehow. I'd suggest using a custom OnSpawn script to make sure the effect is on. The OnSpawn script fires each time you enter a new area.

Of course you can fire the script anyway you like -- trigger, armband, force power, dialog, etc. OnSpawn just seems to be the most natural way.

Now your next question I anticipate: how? It's pretty easy:

1. In Kotor Tool
BIFs
-> scripts.bif
-> Source
-> k_def_spawn01.nss (extract this)

2. Look for this line in the code
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE_E ND);
And after it add the following:

effect eCheck = GetFirstEffect(OBJECT_SELF);
int nEffectIsOn=0;
while (GetIsEffectValid(eCheck)) {
if (
(GetEffectDurationType(eCheck) ==DURATION_TYPE_PERMANENT) &&
(GetEffectType(eCheck)==EFFECT_TYPE_VISUAL) &&
(GetEffectSubType(eCheck)==SUBTYPE_SUPERNATURAL)
) {
nEffectIsOn=1;
}
eCheck=GetNextEffect(OBJECT_SELF);
}
if (nEffectIsOn==0) {
ExecuteScript("npc_shazam",OBJECT_SELF);
}


Then save this script with a unique name, compile it, and put it in your override. Your .utc should then have its OnSpawn field set your new script.

Also, in this case, you'll need the supernatural flag set in npc_shazam.nss. :)
 Darth_ToMeR
06-18-2004, 11:45 AM
#19
It's not compile it. it says "Error: Undeclared identifier "oPC"
Error: requierd arguement missing in call to "GetNextEffect"
 tk102
06-18-2004, 4:32 PM
#20
I'm sorry Darth Tomer. I've edited the above script, and it should work this time. (oPC should've been OBJECT_SELF).
 Darth_ToMeR
06-19-2004, 7:32 AM
#21
It's still doesn't compile it. Can you please give me all the code?
(The two parts together). maybe i made a mistake with the copy past...
 tk102
06-19-2004, 3:20 PM
#22
Okay you asked for it. It compiles for me. (Watch the line breaks.)


//:: Originally: k_def_spawn01
//:: Modified by tk102 for Darth Tomer
/*
v1.0
Spawn In for Darth Tomer with
Permanent Red Shield Effect
*/

#include "k_inc_generic"
#include "k_inc_debug"

void main()
{
// WALK WAYPOINT BEHAVIORS (Comment In or Out to Activate ) ************************************************** **************************
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_CIRCU LAR);
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_ONCE) ;
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_PATH) ;
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_RANDO M);
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_RUN);
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_STOP) ; //Causes the creature to pause for 1 - 3 seconds at a waypoint
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_STOP_ LONG); //Causes the creature to pause for 6 - 12 seconds at a waypoint
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_STOP_ RANDOM); //Causes the creature to pause for 1 - 12 seconds at a waypoint
//GN_SetWalkWayPointsSeries(1); //If this function is uncommented a number from 1 to 99 must be passed. This number represents
//a waypoint series that uses the string "01" through "99" instead of the creature's tag.
// eg. WP_22_01 through WP_22_05. 22 is the series number set with this function.

//GN_SetSpawnInCondition(SW_FLAG_COMMONER_BEHAVIOR);
//GN_SetSpawnInCondition(SW_FLAG_FAST_BUFF);
//GN_SetSpawnInCondition(SW_FLAG_AMBIENT_ANIMATIONS) ;
//GN_SetSpawnInCondition(SW_FLAG_AMBIENT_ANIMATIONS_ MOBILE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.

//GN_SetSpawnInCondition(SW_FLAG_ON_DIALOGUE_COMPUTE R);
//When a creature with this flag is talked to a computer dialogue will come up instead of the usual screens.
// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_HEARTBEAT) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_PERCEPTION ); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_ATTACKED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DAMAGED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DISTURBED) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_COMBAT_ROU ND_END); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DEATH); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DISTURBED) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_BLOCKED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1009
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_FORCE_AFFE CTED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1010
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE_E ND); //OPTIONAL BEHAVIOR - Fire User Defined Event 1011

/*******************
begin tk102 code
*******************/

effect eCheck = GetFirstEffect(OBJECT_SELF);
int nEffectIsOn=0;
while (GetIsEffectValid(eCheck)) {
if (
(GetEffectDurationType(eCheck) ==DURATION_TYPE_PERMANENT) &&
(GetEffectType(eCheck)==EFFECT_TYPE_VISUAL) &&
(GetEffectSubType(eCheck)==SUBTYPE_SUPERNATURAL)
) {
nEffectIsOn=1;
}
eCheck=GetNextEffect(OBJECT_SELF);
}
if (nEffectIsOn==0) {
ExecuteScript("npc_shazam",OBJECT_SELF);
}

/*******************
end tk102 code
*******************/
// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ************************************************** ***************************************

GN_SetDayNightPresence(AMBIENT_PRESENCE_ALWAYS_PRE SENT);

GN_SetListeningPatterns(); //This function although poorly named sets up the listening patterns and other important data for the
//creature it should never be removed.
GN_WalkWayPoints();
}
 Darth_ToMeR
06-19-2004, 4:04 PM
#23
Still doesn't work. I have no idea what is the problem...
 tk102
06-19-2004, 4:06 PM
#24
Maybe you could post the error that is being generated by nwnnsscomp.
 Darth_ToMeR
06-19-2004, 4:12 PM
#25
 tk102
06-19-2004, 4:16 PM
#26
Well from your screenshot, the spawndarth.nss is compiling fine. You should be compiling npc_shazam not shazam.

npc_shazam is the 2nd script I posted in this thread. It compiles for me.
 Darth_ToMeR
06-19-2004, 4:18 PM
#27
I changed the "npc_shazam" to "shazam". That is the problem?
 tk102
06-19-2004, 4:23 PM
#28
You should be fine, as long as you're sure that the only 'shazam.nss' that is in the directory that you're compiling, is the one that contains the code from my 2nd script. It looks like the errors you were getting came from a much longer script (101 lines at least in that script) than what I posted.

They also appear to be associated with text that should be commented. The astrisk is a give away on that...

Comments in scripts begin with either a double slash for a single line comment or a /* */ set of characters for multiple line comments.
 Darth_ToMeR
06-19-2004, 4:25 PM
#29
so i need to delete all the comments?
 Darth333
06-19-2004, 4:25 PM
#30
Originally posted by Darth_ToMeR
I changed the "npc_shazam" to "shazam". That is the problem?

The above script posted by tk102 compiles fine. It's your other script called shazam.nss that doesn't compile. Could you post the contents of shazam.nss?
 Darth_ToMeR
06-19-2004, 4:27 PM
#31
I past the adove script into shazam.nss .
The First script compile fine, it's the last one that not compiles.
 tk102
06-19-2004, 4:30 PM
#32
1. Create a new folder.
2. Create a new text file in that folder.
3. Paste the npc_shazam code into the text file and enter the tag name of your npc where it says npc_tag_goes_here.
4. Rename the text file to shazam.nss.
5. Copy nwnnsscomp.exe into the folder.
6. Open a command prompt in that folder.
7. Type nwnnsscomp -v1.00 *.nss
 tk102
06-19-2004, 4:33 PM
#33
Also -- if you're renaming it to shazam.nss, make sure the spawndarth script refers to shazam and not npc_shazam as I have it posted. (The ExecuteScript function.)
 Darth_ToMeR
06-19-2004, 4:37 PM
#34
I don't get it. You say "tag goes here" but it's in the first script. I use the second. I made a big mistake but i don't know what it is...
 tk102
06-19-2004, 6:56 PM
#35
:rolleyes: :rolleyes: :rolleyes:

Post #6 = 1st script (shazam.nss)
Post #16 = 2nd script (npc_shazam.nss)
Post #20 = 3rd script (spawndarth.nss)

The 2nd script needs to refer to your .utc's tag. The 3rd script needs to refer to the 2nd script (now called 'shazam').
 Darth_ToMeR
06-20-2004, 10:30 AM
#36
I think i did it, but i didn't use the third script in the spawn script.
Here is what i did. I took the second script, and in the utc of my recruit, i typed in the "script spawn" or something, the name of the script. I didn't use the third script at all. It can make trouble to the game? in my little testing it was good.
Page: 1 of 1