Search found 18 matches

by Myk D'vor
Tue Nov 04, 2003 10:45 am
Forum: Avlis News
Topic: Oct Role Player of the month
Replies: 34
Views: 34000

Congratulations to both of you. Maelwydd there are reasons not to show the votes for those who didn't win, it's been discussed before. Like you, I was hoping for some kind of feedback in this way someday. My suggestion was to simply post a list of names of characters (NOT the # of votes received) th...
by Myk D'vor
Sun Sep 14, 2003 5:56 pm
Forum: NWN Scripting
Topic: recording speech
Replies: 29
Views: 31219

It's simply a matter of parsing the spoken text into words using FindSubString. Add this to the OnSpawn of the creature listening: SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 SetListenPattern(OBJECT_SELF,"**",777); SetListening(OBJECT_SELF,TRUE)...
by Myk D'vor
Fri Sep 05, 2003 4:22 am
Forum: NWN Scripting
Topic: Pull Chain for Shower
Replies: 8
Views: 11113

Wow, if that gets a 'genius', I definitely don't want to show you the special storage chests, you'd die of neural shock.

Myk
by Myk D'vor
Fri Sep 05, 2003 3:07 am
Forum: NWN Scripting
Topic: Pull Chain for Shower
Replies: 8
Views: 11113

object chain = OBJECT_SELF; int toggle = GetLocalInt(chain,"Shower on"); if(toggle == 0) { // the shower's not on, this is also the default state of the local if it was never set play the sound SetLocalInt(chain,"Shower on",TRUE); } else { // shower's already on turn off the sound SetLocalInt(chain...
by Myk D'vor
Thu Aug 28, 2003 4:35 am
Forum: NWN Scripting
Topic: switch/case
Replies: 19
Views: 22351

Correct, && is the symbol for logical AND. ! is the symbol for logical NOT, and || is the symbol for logical OR. The correct way to form up a switch/case type structure for non-integer options (like strings) is like this: if(string=="blah") { SpeakString("it was blah"); } else if (string=="foo") { S...
by Myk D'vor
Wed Aug 27, 2003 4:32 am
Forum: NWN Scripting
Topic: Spookeh creatures
Replies: 7
Views: 9935

I imagine that you wouldn't have to click again, though, because you're still locked in the attack. Their location just moves. The spell won't be broken, the attacker will automatically turn around, etc. unless you added a AssignCommand(oPC,ClearAllActions(TRUE)); to it... Just clear the PCs action...
by Myk D'vor
Mon Aug 25, 2003 5:11 pm
Forum: NWN Scripting
Topic: GetLevel
Replies: 7
Views: 10023

GetCharacterLevel is not a function within NWN, Jordicus, sorry. GetCasterLevel is, but not usable for this, and GetLevelByClass and GetLevelByPosition both get specific levels of a multiclass character, not the total. GetHitDice is the way to go.

Myk
by Myk D'vor
Mon Aug 25, 2003 5:05 pm
Forum: NWN Scripting
Topic: GetLevel
Replies: 7
Views: 10023

The easiest way to get the total level of a PC is GetHitDice(oPC). This adds all the multi-class levels if there are any. The easiest way to compute how much exp is needed for the NEXT level is: int iCurLvl = GetHitDice(oPC); int iXpNeeded = (iCurLvl*(iCurLvl+1)/2)*1000; int iAward = iXpNeeded - Get...
by Myk D'vor
Tue Jul 29, 2003 2:42 am
Forum: NWN Scripting
Topic: Equipping items
Replies: 18
Views: 19150

Little quibble... Random(4)+1 is not the same as d4()+1. Random(4) generates a number between 0 and 3, then add 1 and it becomes the same as d4(), which generates a number from 1 to 4.

Myk D'Vor
by Myk D'vor
Mon Jul 21, 2003 5:00 pm
Forum: NWN Scripting
Topic: Player visual puking effect
Replies: 9
Views: 11335

One thing I've been doing with the shovel and crafting placeables is to set up a queue of continuous animations that inherently have a duration parameter and last x amount of time. The nice thing is that they naturally start the next animation after the first one is finished. Once I have the queue s...
by Myk D'vor
Thu Jul 10, 2003 2:37 am
Forum: NWN Scripting
Topic: Item destruct after use
Replies: 3
Views: 6065

Re: Item destruct after use

I can't seem to create a script for this, though it should be something really easy :? I put the following in the OnActivateItem of the module : void main() { object oItem = GetItemActivated(); if(GetName(oItem) == "Berry") DestroyObject(oItem); } But that doesn't work... You're better off comparin...
by Myk D'vor
Fri Jun 20, 2003 4:00 pm
Forum: NWN Scripting
Topic: Container Dumping Script
Replies: 22
Views: 22874

What we really need next is a test of the OnDisturbed event. Put some debugging type messages in a quick script in the OnDisturbed event of your test chest, to see if the event fires for each item inside the bag as it's copies to the chest inventory or not. I -think- it will, in which case most of t...
by Myk D'vor
Thu Jun 19, 2003 11:29 pm
Forum: NWN Scripting
Topic: Container Dumping Script
Replies: 22
Views: 22874

The problem is actually line 24. Destroys of objects wait until the script is complete, so they still exist inside the bag when line 24 is executed, and it copies the bag, contents and all. What you are better off doing is a CreateItemOnObject of a new bag, same resref, but it will be empty. It's ei...
by Myk D'vor
Tue Jun 17, 2003 1:21 am
Forum: NWN Scripting
Topic: Container Dumping Script
Replies: 22
Views: 22874

You're right, that would work. It searches through all placeables in the area and finds one within 10 meters that has a tag that begins with "forge" or "anvil" (not case-sensitive), no matter what comes after that. I'm not positive that the persistent chest would fire the OnDisturbed event properly ...
by Myk D'vor
Mon Jun 16, 2003 3:04 am
Forum: NWN Scripting
Topic: teleporting people from a specific spot
Replies: 7
Views: 9655

The NWN Scripting Lexicon

I swear by it.

Myk
by Myk D'vor
Sun Jun 15, 2003 7:49 pm
Forum: NWN Scripting
Topic: Container Dumping Script
Replies: 22
Views: 22874

I'm afraid not. There's way too many possibilities out there to plan for. I do agree that having a container dump its inventory into the persistent chest automagically would be the best solution possible. The reason for the ore shovel is because the crafters deal with numbers of ore and ingots in an...
by Myk D'vor
Sun Jun 15, 2003 7:35 pm
Forum: NWN Scripting
Topic: teleporting people from a specific spot
Replies: 7
Views: 9655

This will take all PCs within 2 meters of the object with the tag "My_pressure_plate_tag" and teleport them to the waypoint with the tag "My_destination_waypoint". There should be some error checking done, and perhaps special effects added, but this is the gist of it. void main() { object PressurePl...
by Myk D'vor
Sun Jun 15, 2003 7:06 pm
Forum: NWN Scripting
Topic: Container Dumping Script
Replies: 22
Views: 22874

Through several conversations with Fegall we came up with a slightly more comprehensive object for moving ore and ingots, I called it an Ore Shovel. It has yet to be added to the module, but I believe it's in the final stages of approval by Papillon. It has 4 functions, you choose between them in a ...